# testChainBalances

## Description

The `testChainBalances` function is an asynchronous function used for testing purposes to retrieve the balances of various cryptocurrencies on different blockchain networks. It takes a mnemonic (a string representing a mnemonic phrase), an environment (a string indicating the blockchain network environment), and an `ecc` parameter (presumably representing an elliptic curve cryptography library).

## Parameters

| Parameter  | Data Type | Description                                                     |
| ---------- | --------- | --------------------------------------------------------------- |
| `mnemonic` | string    | A mnemonic phrase used for generating the wallet's private key. |
| `env`      | string    | A string indicating the blockchain network environment.         |
| `ecc`      | any       | An elliptic curve cryptography library or object.               |

## Response

| Field      | Data Type | Description                                                                                                 |
| ---------- | --------- | ----------------------------------------------------------------------------------------------------------- |
| `code`     | number    | Indicates the status code. 1 for success, 0 for error.                                                      |
| `balances` | object    | Contains the balances of various cryptocurrencies on different blockchain networks.                         |
| `error`    | any       | (Optional) Contains the error object if an error occurred during the process.                               |
| `message`  | string    | (Optional) Provides additional information about the error, typically indicating an inappropriate mnemonic. |

## Example Request and Response

### Prerequisites

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:

```sh
npm install @nest25/wallet-lib
OR
yarn add @nest25/wallet-lib
```

### Request

Here is an example of how to make a `testChainBalances`request using the NO.AI SDK:

{% code overflow="wrap" %}

```javascript
const { Wallet } = require('@nest25/wallet-lib');

const wallet = new Wallet('');

async function main() {
    const response = await wallet.testChainBalances('fun mixed elevator laundry length trap script boost purchase genuine arrest')
    console.log("response --> ", response);
}

main();
```

{% endcode %}

### Response

{% code overflow="wrap" %}

```sh
   response -->  {
        code: 1,
        balances: { AVA: 0, BNB: 0, ETH: 0, KLAY: 0, MATIC: 0, VLRY: 0, SOL: 0 }
      }
```

{% endcode %}

## Use Cases

* **Testing chain balances:** By invoking this function with a mnemonic and an environment, you can retrieve the balances of various cryptocurrencies on different blockchain networks.
* **Error handling:** If there is an error during the execution of the function, an error object is returned with the appropriate error message, indicating an inappropriate mnemonic.

###
