Is in Venom Wallet a function for sending USDT tokens like a sendMessage function for sending Venom tokens?

144 Views Asked by At

I want to open a wallet venom modal window with the transfer of a certain amount to a specific wallet address.

const send = async (args: SendInternalParams) => {
    await venomProvider.ensureInitialized();
    const { transaction } = await venomProvider.sendMessage({
      sender: args.sender,
      recipient: args.recipient,
      amount: args.amount,
      bounce: args.bounce,
    });
    return transaction;
  };

venomProvider - ProviderRpcClient

In this case venoms are sent. How to send USDT tokens from my address?

enter image description here

I tried to call the SendMessage function.

1

There are 1 best solutions below

0
Joseph Etim Ibok On

Use this.

await venomProvider.ensureInitialized();

        const senderTokenWalletAddress = await getWalletOf({
          provider: venomProvider,
          tokenRootAddress: selectedToken.rootAddress,
          myAddress: address,
        });

        const functionParams = {
          amount: 1000000000,
          recipient: recipientAddress,
          deployWalletValue: String(Math.round(10000000)),
          remainingGasTo: senderAddress,
          notify: false,
          payload: '',
        };

sender const contract = new venomProvider.Contract(TokenWalletAbi, new Address(senderTokenWalletAddress));

        const trx = await contract.methods.transfer(functionParams).send({
          from: senderAddress,
          amount: '1000000000',
        });

        // Set transaction
        transaction = trx;
      }

senderTokenWalletAddress is the token wallet address of the user's wallet for the selected token (eg. USDC token).