Skip to main content

StandardErc20.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.transferFrom(fromAddress, toAddress, amount);

Signature:

transferFrom(from: string, to: string, amount: Amount): Promise<TransactionResult>;

Parameters

ParameterTypeDescription
fromstring
tostring
amountAmount

Returns:

Promise<TransactionResult>

Remarks

Transfer tokens from one wallet to another