📌transfer
Description
The transfer
function is an asynchronous function that transfers a specified amount of ERC20 tokens from the caller's wallet to the specified receiver address and returns the transaction receipt.
Parameters
blockchain
string
Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam)
contractAddress
string
Requires the contract address of the token (ERC20) that is already deployed
receiver
string
Expects the receiving account address for the transfer of the token (ERC20)
amount
string
Requires an amount of tokens to be transferred
privateKey
string
The private key of the account to sign the transaction
Response
Promise<Object>
object
Returns the transaction receipt object
Example Request and Response
Prerequisites
Before making requests with NEST® SDK, you must have it installed.
You can install NEST® SDK using either npm
or yarn
. Use the following commands to install NEST® SDK:
Request
Here is an example of how to make a transfer
request using the NEST® SDK:
Response
Use Cases
Token transfer: The primary use case for the transfer function is to transfer a specified amount of ERC20 tokens from one address to another on a given blockchain network.
Payment processing: The transfer function can also be used to process payments in a decentralized way by allowing users to send ERC20 tokens as payment for goods or services.
Exchange trading: The transfer function can be used in decentralized exchanges to facilitate the trading of ERC20 tokens between different parties.
Last updated