Quellcode durchsuchen

remove hardcoded addresses in Buy Button

master
Dom SP vor 3 Jahren
Ursprung
Commit
886089f149
2 geänderte Dateien mit 10 neuen und 4 gelöschten Zeilen
  1. +1
    -0
      src/App.tsx
  2. +9
    -4
      src/components/BuyButton.tsx

+ 1
- 0
src/App.tsx Datei anzeigen

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

+ 9
- 4
src/components/BuyButton.tsx Datei anzeigen

@@ -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>
);

Laden…
Abbrechen
Speichern