WDK logoWDK documentation

Get Started

Install and create your first TON wallet.

This guide explains how to install the package, create a wallet, and get your first account.

1. Install the Package

Prerequisites

  • Node.js: version 18 or higher.
  • npm: usually comes with Node.js.
Install @tetherto/wdk-wallet-ton
npm install @tetherto/wdk-wallet-ton

2. Create a Wallet

You can create a new wallet instance using the WalletManagerTon constructor with a BIP-39 seed phrase and a TON Center client configuration:

Create TON Wallet
import WalletManagerTon, { WalletAccountTon, WalletAccountReadOnlyTon } from '@tetherto/wdk-wallet-ton'

const seedPhrase = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about'

const wallet = new WalletManagerTon(seedPhrase, {
  tonClient: {
    url: 'https://toncenter.com/api/v3',
    secretKey: 'your-api-key' // Optional
  }
})

Secure the Seed Phrase: You must securely store this seed phrase immediately. If it is lost, the user will permanently lose access to their funds.

3. Get Your First Account

You can retrieve an account at a given index using wallet.getAccount():

Get Account
const account = await wallet.getAccount(0)
const address = await account.getAddress()
console.log('Wallet address:', address)

4. (optional) Convert to Read-Only

You can convert an owned account to a read-only account using account.toReadOnlyAccount():

Convert to Read-Only
const readOnlyAccount = await account.toReadOnlyAccount()

Next Steps

With your wallet ready, learn how to manage multiple accounts.

On this page