浏览代码

remove hardcoded addresses in Buy Button

master
Dom SP 3 年前
父节点
当前提交
886089f149
共有 2 个文件被更改,包括 10 次插入4 次删除
  1. +1
    -0
      src/App.tsx
  2. +9
    -4
      src/components/BuyButton.tsx

+ 1
- 0
src/App.tsx 查看文件

@@ -125,6 +125,7 @@ const App = () => {
</div>
<BuyButton
Tezos={Tezos}
sender={userAddress}
FA2address="KT1BB1uMwVvJ1M3vVHXWALs1RWdgTp1rnXTR"
receiver="tz1hJncvXvL2VyctPE685GJPXDaRJ7dtiwjm"
amount={100}

+ 9
- 4
src/components/BuyButton.tsx 查看文件

@@ -6,11 +6,13 @@ import { BeaconWallet } from "@taquito/beacon-wallet";
const BuyButton = ({
Tezos,
FA2address,
sender,
receiver,
amount
}: {
Tezos: TezosToolkit,
FA2address: string,
sender: string,
receiver: string,
amount: number
}): JSX.Element => {
@@ -20,9 +22,9 @@ const BuyButton = ({
const transfer_params = [
{
from_: "tz1LigkX55duWS2pZt4u5qTAWUu6Sb9bMxbg",
from_: sender,
txs: [{
to_: "tz1hJncvXvL2VyctPE685GJPXDaRJ7dtiwjm",
to_: receiver,
token_id:0,
amount: amount
}]
@@ -38,8 +40,11 @@ const BuyButton = ({
<button
className="myButton"
onClick={makePayment}
>
{FA2address}
>Transfer {amount}&nbsp;
µ-tokens from: &nbsp;
{sender}
&nbsp;to:&nbsp;
{receiver}
</button>
</div>
);

正在加载...
取消
保存