Erc20.transferFrom() method
Transfer Tokens From Address
Example
// Address of the wallet sending the tokens
const fromAddress = "{{wallet_address}}";
// Address of the wallet you want to send the tokens to
const toAddress = "0x...";
// The number of tokens you want to send
const amount = 1.2;
// Note that the connected wallet must have approval to transfer the tokens of the fromAddress
await contract.token.transferFrom(fromAddress, toAddress, amount);
Signature:
transferFrom(from: string, to: string, amount: Amount): Promise<TransactionResult>;
Parameters
Parameter | Type | Description |
---|---|---|
from | string | |
to | string | |
amount | Amount |
Returns:
Promise<TransactionResult>
Remarks
Transfer tokens from one wallet to another