Check Balances
Query native TON and Jetton token balances.
This guide explains how to check native TON balances, Jetton token balances, and read-only account balances.
Native TON Balance
You can retrieve the native TON balance using account.getBalance():
const balance = await account.getBalance()
console.log('Native TON balance:', balance, 'nanotons')On TON, values are expressed in nanotons (1 TON = 10^9 nanotons).
Jetton Token Balance
You can check the balance of a specific Jetton token using account.getTokenBalance():
const jettonAddress = 'EQ...' // Jetton contract address
const jettonBalance = await account.getTokenBalance(jettonAddress)
console.log('Jetton token balance:', jettonBalance)Read-Only Account Balances
You can check balances for any public key without a seed phrase using WalletAccountReadOnlyTon:
import { WalletAccountReadOnlyTon } from '@tetherto/wdk-wallet-ton'
const readOnlyAccount = new WalletAccountReadOnlyTon(publicKey, {
tonClient: {
url: 'https://toncenter.com/api/v3',
secretKey: 'your-api-key' // Optional
}
})You can retrieve the native balance from a read-only account using readOnlyAccount.getBalance():
const balance = await readOnlyAccount.getBalance()
console.log('Read-only account balance:', balance)You can also create a read-only account from an existing owned account using account.toReadOnlyAccount().
Next Steps
With balance checks in place, learn how to send TON.