TransferTokens
Last updated
Last updated
This function can transfer native currencies and tokens that follow the ERC-20 standard. It is recommended to first call the EstimateTransferTokensGas
function to get an estimate of the gas fees required for this transaction, which can be displayed to users before the confirm or deny the transaction.
This function should be called after the Login
has been invoked.
async TransferTokens(args, apiKey)
Parameter | Type | Definition |
---|---|---|
None
Calling TransferTokens for a native currency:
Calling TransferTokens for an ERC-20 token. For more information on the RegisterToken
function, please refer to this page.
args.callback
Function
Function to callback upon success or failed transfer. Structure of result object passed into callback function:
args.to
String
Address to send tokens to.
args.amount
String
Amount to send in display units of the currency. So if you want the user to pay 0.5 ETH, pass in '0.5' to this field.
args.currency
Asset (class)
Asset object of the currency you want to send. You can pass a custom token here as well, please refer to the example below.
apiKey
String
The API Key generated from the Developer Portal