Configuration

Configuration options and settings for @tetherto/wdk

WDK Manager Configuration

Create WDK Instance
import WDK from '@tetherto/wdk'

const wdk = new WDK(seedPhrase)

The WDK Manager itself only requires a seed phrase for initialization. Configuration is done through the registration of wallets and protocols.

Wallet Registration Configuration

Register WDK Wallet
import WDK from '@tetherto/wdk'
import WalletManagerEvm from '@tetherto/wdk-wallet-evm'
import WalletManagerTon from '@tetherto/wdk-wallet-ton'

const wdk = new WDK(seedPhrase)
  .registerWallet('ethereum', WalletManagerEvm, {
    provider: 'https://eth.drpc.org'
  })
  .registerWallet('ton', WalletManagerTon, {
    tonApiKey: 'YOUR_TON_API_KEY',
    tonApiEndpoint: 'https://tonapi.io'
  })

Protocol Registration Configuration

Configuration Options

Wallet Configuration

Each wallet manager requires its own configuration object when registered. The configuration depends on the specific wallet module being used.

EVM Wallet Configuration

TON Wallet Configuration

Protocol Configuration

Protocols also require their own configuration objects when registered.

Swap Protocol Configuration

Bridge Protocol Configuration

Middleware Configuration

Middleware functions can be registered to enhance account functionality.

Environment Variables

For production applications, consider using environment variables for sensitive configuration:

Configuration Validation

The WDK Manager will validate configurations when wallets and protocols are registered:

  • Wallet Registration: Ensures the wallet class extends the required base class

  • Protocol Registration: Validates that protocol labels are unique per blockchain and protocol type

  • Middleware Registration: Validates that middleware functions have the correct signature

Error Handling

Configuration errors will be thrown during registration:


Next Steps


Need Help?