# evm

## Description

The `getBalanceByMnemonic` function is used to retrieve the balance of a wallet address associated with a given mnemonic phrase.

## Parameters

| Parameter    | Data Type | Description                                     |
| ------------ | --------- | ----------------------------------------------- |
| `blockchain` | string    | The name of the blockchain network.             |
| `mnemonic`   | string    | The mnemonic phrase associated with the wallet. |
| `env`        | string    | The environment or network configuration.       |

## Response

| Field    | Data Type | Description                                                         |
| -------- | --------- | ------------------------------------------------------------------- |
| `code`   | number    | The status code indicating the result of the operation.             |
| `result` | any       | The balance of the wallet address in the specified network.         |
| `error`  | any       | An error message or object if an error occurs during the operation. |

## Example Request and Response

### Prerequisites

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:

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

### Request

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

```javascript
// import wallet from the nest SDK
const { Wallet } = require('@nest25/wallet-lib');
// create a new wallet instance
const wallet = new Wallet('');
// set the mnemonic to use for the wallet
const testMnemonic = 'exchange fun mixed elevator laundry length trap script boost purchase genuine arrest';

async function main() {
  // get the balance of the wallet
  const response = await wallet.getBalanceByMnemonic('ava', testMnemonic);
  // log the response
  console.log(response);
}
main()
```

### Response

{% code overflow="wrap" %}

```sh
  
```

{% endcode %}

## Use Cases

* **Online Wallets:** By providing the `mnemonic`, the online wallet service can obtain the balance of a wallet address associated with a specific user. This information can be used to display the available balance to the user, track transaction history, or perform further operations related to the wallet.
* **Trading Platforms:** Trading platforms can utilize this function to verify the status of transactions made by their users on different blockchain networks. By utilizing the `getBalanceByMnemonic` function with the appropriate `blockchain` and `mnemonic`, the trading platform can fetch the balance of a user's wallet address.&#x20;


---

# 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/wallet-sdk/getbalancebymnemonic/evm.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.
