# btc

## Description

The `getBalanceByMnemonic` function retrieves the balance of a specific address associated with a mnemonic phrase on the Solana Blockchain.

## Parameters

| Parameter    | Data Type | Description                                                             |
| ------------ | --------- | ----------------------------------------------------------------------- |
| `blockchain` | string    | The blockchain network associated with the mnemonic (in this case, btc) |
| `mnemonic`   | string    | The mnemonic phrase used to derive the address.                         |

## Response

| Field    | Data Type | Description                                            |
| -------- | --------- | ------------------------------------------------------ |
| `code`   | number    | The status code indicating the success or failure.     |
| `result` | number    | The balance of the specified address in the network.   |
| `error`  | any       | An error object containing details if an error occurs. |

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

{% code overflow="wrap" %}

```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('sol', testMnemonic);
  // log the response
  console.log(response);
}
main()

```

{% endcode %}

### Response

{% code overflow="wrap" %}

```sh
  
```

{% endcode %}

## Use Cases

* **Cryptocurrency Exchanges**: Cryptocurrency exchanges can employ this function to fetch the balance of users' addresses associated with their mnemonic phrases. This information is crucial for displaying accurate wallet balances, calculating available funds for trading, and managing user accounts.
* **Blockchain Explorers:** Blockchain explorers can utilize this function to provide users with real-time balance information for specific addresses. By integrating this function, blockchain explorers can display the current balance of any address based on the mnemonic phrase provided.
* **Decentralized Applications (DApps):** DApps running on blockchain networks can make use of this function to retrieve the balance associated with the user's address derived from their mnemonic phrase. This balance information is vital for displaying account balances within the DApp, enabling users to manage their funds and interact with the application seamlessly.

###


---

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