Minimal example showing SDK usage in ~20 lines. Creates a wallet, loads 3 plugins, checks balance, and resolves a .ton domain.
npm installSet your TON wallet mnemonic as an environment variable:
export TON_MNEMONIC="word1 word2 ... word24"bun index.ts- Creates a wallet from your mnemonic
- Initializes the agent with 3 plugins (Token, DeFi, DNS)
- Checks your TON balance
- Resolves
foundation.tonto an address - Demonstrates the
agent.methodsproxy shorthand
const agent = new TonAgentKit(wallet, rpcUrl, {}, "testnet")
.use(TokenPlugin)
.use(DefiPlugin)
.use(DnsPlugin);
const balance = await agent.runAction("get_balance", {});
const dns = await agent.runAction("resolve_domain", { domain: "foundation.ton" });