|
|
|
|
|
|
|
|
const BuyButton = ({ |
|
|
const BuyButton = ({ |
|
|
Tezos, |
|
|
Tezos, |
|
|
FA2address, |
|
|
FA2address, |
|
|
|
|
|
sender, |
|
|
receiver, |
|
|
receiver, |
|
|
amount |
|
|
amount |
|
|
}: { |
|
|
}: { |
|
|
Tezos: TezosToolkit, |
|
|
Tezos: TezosToolkit, |
|
|
FA2address: string, |
|
|
FA2address: string, |
|
|
|
|
|
sender: string, |
|
|
receiver: string, |
|
|
receiver: string, |
|
|
amount: number |
|
|
amount: number |
|
|
}): JSX.Element => { |
|
|
}): JSX.Element => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const transfer_params = [ |
|
|
const transfer_params = [ |
|
|
{ |
|
|
{ |
|
|
from_: "tz1LigkX55duWS2pZt4u5qTAWUu6Sb9bMxbg", |
|
|
|
|
|
|
|
|
from_: sender, |
|
|
txs: [{ |
|
|
txs: [{ |
|
|
to_: "tz1hJncvXvL2VyctPE685GJPXDaRJ7dtiwjm", |
|
|
|
|
|
|
|
|
to_: receiver, |
|
|
token_id:0, |
|
|
token_id:0, |
|
|
amount: amount |
|
|
amount: amount |
|
|
}] |
|
|
}] |
|
|
|
|
|
|
|
|
<button |
|
|
<button |
|
|
className="myButton" |
|
|
className="myButton" |
|
|
onClick={makePayment} |
|
|
onClick={makePayment} |
|
|
> |
|
|
|
|
|
{FA2address} |
|
|
|
|
|
|
|
|
>Transfer {amount} |
|
|
|
|
|
µ-tokens from: |
|
|
|
|
|
{sender} |
|
|
|
|
|
to: |
|
|
|
|
|
{receiver} |
|
|
</button> |
|
|
</button> |
|
|
</div> |
|
|
</div> |
|
|
); |
|
|
); |