WDK logoWDK documentation

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():

Get Native TON Balance
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():

Get Jetton Token Balance
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:

Create Read-Only Account
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():

Read-Only Native Balance
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.

On this page