> For the complete documentation index, see [llms.txt](https://docs.non-obvious.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.non-obvious.ai/sdks-guide/blockchain-sdks/evm-chains-sdk/wallet/getbalance.md).

# 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.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.non-obvious.ai/sdks-guide/blockchain-sdks/evm-chains-sdk/wallet/getbalance.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
