Skip to main content

Balance

Blockchain state changes constantly as new blocks are produced. This has implications for when and how to check TON wallet contract balances:
  • Discrete one-off checks have almost no value on their own — the state might change immediately after the query completes, invalidating its results. Thus, such checks are only practical when making outgoing transfers.
  • Continuous monitoring is useful for UI display, showing the most recent balance to users, but should not be used for transaction confirmations.
Notice that both cases require querying the blockchain data via the API client set during the AppKit initialization. Obtain and provide the key from the selected client to access higher requests-per-second limits.

On-demand balance check

Balances are returned as strings representing fractional Toncoin units. For example, '0.1' is a balance of 0.1 Toncoin or 100000000 nanoToncoin. Decimal precision of Toncoin is 9 digits, so the smallest possible balance is '0.000000001' Toncoin or 1 nanoToncoin.

Continuous balance monitoring

Obtain real-time balance updates with a streaming API provider and fallback to polling at regular intervals to keep the displayed value up to date. For polling, use an appropriate interval based on UX requirements — shorter intervals provide fresher data but increase API usage.

With streaming

Modify the following examples according to the application logic:

Only polling

Modify the following examples according to the application logic:

Transfers

Modify the following examples according to the application logic:

Confirm transaction delivery

TON achieves transaction finality after a single masterchain block confirmation. Once a transaction appears in a masterchain block, it becomes irreversible. Therefore, to reliably confirm the transaction delivery and status, one needs to check whether a transaction has achieved masterchain finality using the selected API client. Applications should not block the UI while waiting for such confirmation. With continuous balance monitoring, watchTransactions() streaming, and subsequent transaction requests, users will receive the latest information either way. Confirmations are only needed to reliably display a list of past transactions, including the most recent ones. For detailed transaction tracking and message lookups, the message lookup guide covers finding transactions by external message hash, waiting for confirmations, and applying message normalization.

Next steps

Work with jettons

See also