⛏️getBalance
Description
The getBalance
function you provided is specific to the Solana blockchain. It retrieves the balance of a given address.
Parameter
Parameter | Data Type | Description |
---|---|---|
| string | The environment or network (e.g., "mainnet", "testnet") in which the Solana address exists. |
| string | The Solana address for which the balance needs to be retrieved. |
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. |
| number | The balance of the specified Solana address in SOL (converted to a readable format). |
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 getAccountFromSecretKey
request using the NEST® SDK:
Response
Use Cases
This
getBalance function
can be used for various purposes such as displaying the account balance to the user, verifying account funds, or performing balance-related calculations.
Last updated