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/v3

  • Testnet: 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)

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 transferMaxFee limits for your use case


Need Help?