# useBalance

## Function: useBalance()

> **useBalance**(`UseBalanceParameters`): `undefined` | { `decimals`: `number`; `formatted`: `string`; `symbol`: `string`; `value`: `bigint`; }

Computes and retrieves the token balance, decimals, and symbol information for a specified wallet address on a specific blockchain.

This function leverages blockchain read operations to fetch the balance of a token for a given wallet address along with associated token metadata such as decimals and symbol. It also formats the token balance for easier readability.

### Parameters

#### UseBalanceParameters

`UseBalanceParameters`

The parameters for retrieving the balance.

### Returns

`undefined` | { `decimals`: `number`; `formatted`: `string`; `symbol`: `string`; `value`: `bigint`; }

An object containing the balance information or `undefined` if data is not available:

* `value` (BigInt): The raw token balance.
* `decimals` (number): The number of decimal places for the token.
* `symbol` (string): The symbol of the token.
* `formatted` (string): The formatted balance value as a string with a fixed precision of 8.

### Defined in

[packages/wagmi/src/hook/useBalance.tsx:40](https://github.com/haven1network/haven1-sdk/blob/df6267fec7b75040411529269f9c6a88e9c756ee/packages/wagmi/src/hook/useBalance.tsx#L40)


---

# 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.haven1.org/build/developer-tools/haven1-sdk/haven1-wagmi-sdk/hook-module/usebalance.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.
