📌balanceOf
Description
The balanceOf
function is an asynchronous function that retrieves the balance of a specific token for a given address in a specified contract on a particular blockchain.
Parameters
Parameter | Data Type | Description |
---|---|---|
| string | The name or symbol of the blockchain. |
| string | The address of the contract on the blockchain. |
| string | The address for which the token balance is to be retrieved. |
| string | The ID of the token for which the balance is to be retrieved. |
| string | The environment or network where the contract exists (e.g., 'mainnet', 'testnet'). |
Response
Field | Data Type | Description |
---|---|---|
| number | A numeric value indicating the execution status (1 for success, 0 for error). |
| any | The error object containing details about the encountered error, if applicable. |
| string | The balance of the specified token for the given address. |
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 balanceOf
request using the NEST® SDK:
Response
Use Cases
The
balanceOf
function can be used to retrieve the balance of a specific token for a given address in a contract.
Last updated