Skip to main content

Balance Queries

The xyz balance command queries account balances including native XYZ and CW20 tokens.

Basic Usage

Or by key name:

Query Native Balance

By Address

Output:

By Key Name

The CLI resolves the address from your keyring automatically.

Query All Balances

Include CW20 token balances with --all:
Output:
CW20 balances require tracked tokens in config. Add tokens with:

JSON Output

For scripting and automation:
With --all:

Command Options

Examples

Check Test Account Balance

Check Multiple Accounts

Monitor Balance Changes

Parse Balance in Script

Understanding Amounts

All on-chain amounts are in uxyz (micro XYZ): The table output shows both:

CW20 Token Balances

Setup Tracked Tokens

  1. Get token contract addresses
  2. Add to configuration:
  1. Query with --all:

Query Single Token

For a specific token, use the token commands:

Troubleshooting

The address may not exist on-chain yet (no transactions):
Fund the account first or check the address is correct.
Node may not be running:
Ensure token is tracked:
And use --all flag:
  • Check address is correct
  • Check you’re on the right network (chain-id)
  • For localnet, use test accounts (alice, bob)