# getBalance

## Description

The **`getBalance`** function takes a blockchain network name and an account address as inputs and returns the balance of that account in the specified cryptocurrency

## Parameters

<table><thead><tr><th width="247">Parameter</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>blockchain</code></td><td>string</td><td>Takes a string parameter specifying the name of the blockchain network (For eg. bsc, polygon, eth, ava, gnosis, moonbeam)</td></tr><tr><td><code>address</code></td><td>string</td><td>The address for which to retrieve the balance</td></tr></tbody></table>

## Response

| Property             | Type      | Description                                                                                                |
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
| `Promise<BigNumber>` | BigNumber | Returns the current ether balance of the specified address on the specified blockchain network blockchain. |

## Example Request and Response

### Prerequisites&#x20;

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/evm-chains-lib
OR
yarn add @nest25/evm-chains-lib
```

### Request

Here is an example of how to make a `getBalance` request using the Volary SDK:

```jsx
// import the Nest SDK
const { Wallet } = require('@nest25/evm-chains-lib');

// create a new wallet
const wallet = new Wallet();

// define the main function
const main = async () => {
    // get the balance of the contract
    let balance = await wallet.getBalance('gnosis', '0xE668C72D4C67236A712Ce69A91C74358586f31ed');

    // convert the balance to a string
    const balanceToString = balance.toString();
    // print the balance
    console.log(balanceToString);
};
// call the main function
main();
```

### Response

```jsx
 6803371899323
```

## Use Cases

* **Wallet Balance:** The function can be used to get the balance of a wallet address for a specific blockchain network, helping users to keep track of their crypto assets.
* **Payment Systems**: Payment systems can use the function to verify the balance of a user's account before processing transactions, ensuring that the user has sufficient funds to complete the payment.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.volary.io/sdks-guide/blockchain-sdks/evm-chains-sdk/wallet/getbalance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
