I'm using web3 to deal with transactions, I have a custom token and I would like to be able to send it in the transactions.
const amount = web3.utils.toWei(amountPurchase, 'ether');
const value = web3.utils.toHex(amount);
const transactionParameters = {
nonce: '0x00',
to: 'my_wallet',
from: ethereum.selectedAddress,
value: value,
data:
'0x7f7465737432000000000000000000000000000000000000000000000000000000600057',
chainId: '0x3',
};
try{
const txHash = await ethereum.request({
method: 'eth_sendTransaction',
params: [transactionParameters],
});
This is my token contract address: 0x2e877C25bfaFbFE1F7643FCfcb14078e228D085F this is in the BSC but I think that it is the same. How can I send this token instead of BNB? The token is only in the test net for the moment. Thank you all in advance.