Initialize the AppKit before using examples on this page.
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.
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.
Do not store the balance check results anywhere in the wallet service’s state, as they become outdated quickly. For UI purposes, do continuous balance monitoring.