Configuration
Configuration options and settings for @tetherto/wdk-wallet-ton
Wallet Configuration
The WalletManagerTon accepts a configuration object that defines how the wallet interacts with the TON blockchain:
import WalletManagerTon from '@tetherto/wdk-wallet-ton'
const config = {
tonClient: {
url: 'https://toncenter.com/api/v3',
secretKey: 'your-api-key' // Optional
},
transferMaxFee: 1000000000 // Optional: Maximum fee in nanotons (1 TON)
}
const wallet = new WalletManagerTon(seedPhrase, config)Account Configuration
import { WalletAccountTon } from '@tetherto/wdk-wallet-ton'
const accountConfig = {
tonClient: {
url: 'https://toncenter.com/api/v3',
secretKey: 'your-api-key' // Optional
},
transferMaxFee: 1000000000 // Optional: Maximum fee in nanotons
}
const account = new WalletAccountTon(seedPhrase, "0'/0/0", accountConfig)Configuration Options
tonClient
The tonClient option configures the TON Center API client for blockchain interactions.
Type:
Examples:
transferMaxFee
The transferMaxFee option sets the maximum allowed fee (in nanotons) for transfer operations. This helps prevent unexpectedly high transaction fees.
Type: number (nanotons)
Default: No maximum (undefined)
Examples:
Read-Only Account Configuration
For read-only accounts, you only need the TON client configuration:
Network Selection
The TON network (mainnet or testnet) is determined by the TON Center API endpoint URL:
Mainnet:
https://toncenter.com/api/v3Testnet:
https://testnet.toncenter.com/api/v3
Derivation Paths
TON wallets use BIP-44 standard derivation paths. The default derivation path follows ecosystem conventions:
Default path:
m/44'/607'/{index}'(where{index}is the account index)
Default Derivation Path Change in v1.0.0-beta.6+
The default derivation path was updated in v1.0.0-beta.6 to match ecosystem conventions:
Previous path (<= v1.0.0-beta.5):
m/44'/607'/0'/0/{index}Current path (v1.0.0-beta.6+):
m/44'/607'/{index}'
If you're upgrading from an earlier version, existing wallets created with the old path will generate different addresses. Make sure to migrate any existing wallets or use the old path explicitly if needed for compatibility.
Use getAccountByPath to supply an explicit derivation path when importing or recreating legacy wallets.
Security Considerations
Always use HTTPS URLs for TON Center API endpoints
Keep API keys secure and never expose them in client-side code
Consider using environment variables for API keys
Set appropriate
transferMaxFeelimits for your use case

