2 years ago

#142797

test-img

ka a

use walletconnect nodejs client How do I set up custom token transfers?

transfer() {
      const tx = {
        from: "0x57B1c15E83A87bF856e3eDb8765ac2d2b3CaA94C", // Required
        to: "0x1C6B45866aff7Ac71628bd93F0307e28E783EB76", // Required (for non contract deployments)
        data: "0x00", // Required
        gasPrice: "0x02540be400", // Optional
        gas: "0x9c40", // Optional
        value: "0x0", // Optional
        nonce: "0x0114", // Optional
      };
      this.$wc
          .sendTransaction(tx)
          .then((result) => {
            // Returns transaction id (hash)
            console.log(result);
          })
          .catch((error) => {
            // Error returned when rejected
            console.error(error);
          });
    },
  • The default transfer currency of the above code is BNB. What should I do if I want to transfer other BEP20 currencies through the contract address settings?

walletconnect docs

node.js

ethereum

bep20

wallet-connect

0 Answers

Your Answer

Accepted video resources