Usage
Installation, quick start, and usage examples for @tetherto/wdk-wallet-ton
Installation
npm install @tetherto/wdk-wallet-tonQuick Start
Importing from @tetherto/wdk-wallet-ton
@tetherto/wdk-wallet-tonCreating a New Wallet
import WalletManagerTon, { WalletAccountTon, WalletAccountReadOnlyTon } from '@tetherto/wdk-wallet-ton'
// Use a BIP-39 seed phrase (replace with your own secure phrase)
const seedPhrase = 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about' // Replace with actual seed generation
// Create wallet manager with TON client config
const wallet = new WalletManagerTon(seedPhrase, {
tonClient: {
url: 'https://toncenter.com/api/v3',
secretKey: 'your-api-key' // Optional
}
})
// Get a full access account
const account = await wallet.getAccount(0)
// Convert to a read-only account
const readOnlyAccount = await account.toReadOnlyAccount()
