githubEdit

gearConfiguration

Configuration options and settings for @tetherto/wdk-wallet-ton-gasless

Wallet Configuration

import WalletManagerTonGasless from '@tetherto/wdk-wallet-ton-gasless'

const config = {
  // Required: TON Center API client
  tonClient: {
    url: 'https://toncenter.com/api/v3',
    secretKey: 'your-api-key' // Optional, for higher rate limits
  },
  // Required: TON API client (used for gasless transaction relay)
  tonApiClient: {
    url: 'https://tonapi.io/v2',
    secretKey: 'your-tonapi-key' // Optional but recommended
  },
  // Required: Paymaster token used to pay gas fees
  paymasterToken: {
    address: 'EQ...' // Paymaster Jetton master contract address
  },
  // Optional: Maximum fee for transfer operations (in paymaster token base units)
  transferMaxFee: 10000000
}

const wallet = new WalletManagerTonGasless(seedPhrase, config) // config is required

Account Configuration

Read-Only Account Configuration

Configuration Options

tonClient

The tonClient option configures the TON Center API client for blockchain interactions. You can pass either a configuration object or an existing TonClient instance.

Type:

Required: Yes

tonApiClient

The tonApiClient option configures the TON API client used for gasless transaction relay and fee estimation. You can pass either a configuration object or an existing TonApiClient instance.

Type:

Required: Yes

paymasterToken

The paymasterToken option specifies the Jetton token used to pay gas fees in gasless transactions.

Type:

Required: Yes

Example:

transferMaxFee

The transferMaxFee option sets the maximum allowed fee for transfer operations, denominated in the paymaster token's base units. This helps prevent unexpectedly high transaction fees.

Type: number | bigint

Required: No

Example:

Complete Configuration Example

Here's a complete configuration example with all options:

Security Considerations

  • Keep API keys and secrets secure and never expose them in client-side code

  • Use environment variables for sensitive configuration values

  • Always use HTTPS URLs for API endpoints

  • Set appropriate transferMaxFee limits to prevent excessive fees

  • Validate contract addresses before using them in configuration


Need Help?