Polkadot Apps
    Preparing search index...
    • Query the free, reserved, and frozen balances for an on-chain address.

      Thin typed wrapper around System.Account.getValue that returns a clean AccountBalance object. Uses structural typing so it works with any PAPI typed API that has the System pallet — no chain-specific imports needed.

      Parameters

      • api: BalanceApi

        A PAPI typed API with query.System.Account. Pass the chain-specific API (e.g., client.assetHub), not the multi-chain ChainClient wrapper.

      • address: string

        The SS58 address to query.

      Returns Promise<AccountBalance>

      The account's balance breakdown.

      import { getBalance } from "@polkadot-apps/utils";
      import { formatBalance } from "@polkadot-apps/utils";

      const balance = await getBalance(api.assetHub, aliceAddress);
      console.log(formatBalance(balance.free, { symbol: "DOT" })); // "1,000.5 DOT"