# 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 NO.AI SDK, you must have it installed.

You can install NO.AI SDK using either **`npm`** or **`yarn`**. Use the following commands to install NO.AI 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 NO.AI 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.
