# How to get account balance · Chromia Docs (concept)

> This recipe demonstrates how to fetch an FT4 account balance using an EVM key pair.

Source: https://docs.chromia.com/build/cookbook/query-creation/get-account-balance/

# How to get account balance

On this page

* [Prerequisites](#prerequisites)
* [Demo script](#demo-script)
* [Key Features](#key-features)
* [Balance Query Process](#balance-query-process)
* [Common Use Cases](#common-use-cases)
* [Requirements](#requirements)
* [Learn more](#learn-more)

This recipe demonstrates how to fetch an FT4 account balance using an EVM key pair. This is essential for checking asset
balances before performing transfers or for displaying account information in applications.

JS/TS client

## Prerequisites

* **Node.js**
* **FT4 client:** `npm install @chromia/ft4`
* **Postchain client:** `npm install postchain-client`

## Demo script

* [Get account balance demo](https://bitbucket.org/chromawallet/recipes/src/main/get_account_balance/)

## Key Features

This recipe includes examples for:

* **FT4 balance queries** - Using the [`getBalanceByAccountId`](https://docs.chromia.com/pages/ft4-ts-client/functions/asset.getBalanceByAccountId/) function for specific assets
* **EVM key integration** - Working with EVM key pairs to resolve FT4 accounts
* **Asset-specific balances** - Querying balances for particular assets (e.g., CHR)
* **Account resolution** - Converting EVM keys to FT4 account identifiers

## Balance Query Process

The recipe follows this workflow:

1. **Create keystore** - Initialize an EVM keystore with your private/public key pair
2. **Resolve accounts** - Use the keystore interactor to find associated FT4 accounts
3. **Create connection** - Establish an FT4 connection to the blockchain
4. **Query balance** - Call [`getBalanceByAccountId`](https://docs.chromia.com/pages/ft4-ts-client/functions/asset.getBalanceByAccountId/) with account ID and asset ID

## Common Use Cases

This pattern is useful for:

* **Wallet applications** - Displaying current asset balances to users
* **Payment validation** - Checking sufficient funds before transfers
* **Portfolio tracking** - Monitoring asset holdings across accounts
* **Exchange integrations** - Validating account balances for withdrawals

## Requirements

* **Registered EVM key** - Your EVM key must be registered on the target blockchain
* **FT4 account** - An associated FT4 account must exist for the EVM key
* **Asset ID** - The hex-encoded asset ID you want to query (e.g., CHR asset ID)

## Learn more

* [FT4 client documentation](https://docs.chromia.com/build/clients/ft4-client/) — covers account management and FT4 operations.
* [Asset management](https://docs.chromia.com/build/ft4/asset-management/) — detailed guide on FT4 assets and balance queries.
* [Account management](https://docs.chromia.com/build/ft4/account-management/) — understanding FT4 accounts and key management.

[View this page on docs.chromia.com](https://docs.chromia.com/build/cookbook/query-creation/get-account-balance/)Content mirrored from the live docs
