Configuration
Configuration options and settings for @tetherto/wdk-wallet-solana
Wallet Configuration
The WalletManagerSolana accepts an optional configuration object that defines how the wallet interacts with the Solana blockchain:
import WalletManagerSolana from '@tetherto/wdk-wallet-solana'
const config = {
rpcUrl: 'https://api.mainnet-beta.solana.com', // Solana RPC endpoint
wsUrl: 'wss://api.mainnet-beta.solana.com/', // Optional: WebSocket endpoint
transferMaxFee: 10000000 // Optional: Maximum fee in lamports
}
const wallet = new WalletManagerSolana(seedPhrase, config)Account Configuration
import { WalletAccountSolana } from '@tetherto/wdk-wallet-solana'
const accountConfig = {
rpcUrl: 'https://api.mainnet-beta.solana.com',
wsUrl: 'wss://api.mainnet-beta.solana.com/', // Optional
transferMaxFee: 10000000 // Optional: Maximum fee in lamports
}
const account = new WalletAccountSolana(seedPhrase, "0'/0/0", accountConfig)Configuration Options
rpcUrl
The rpcUrl option specifies the Solana RPC endpoint for blockchain interactions.
Type: string (optional)
Default: If not provided, wallet functionality that requires RPC will throw an error
Examples:
wsUrl
The wsUrl option specifies a custom WebSocket endpoint for real-time subscriptions and confirmations.
Type: string (optional)
Default: If not provided, the WebSocket URL will be automatically derived from the rpcUrl
Example:
transferMaxFee
The transferMaxFee option sets the maximum allowed fee (in lamports) for transfer operations. This helps prevent unexpectedly high transaction fees.
Type: number (optional)
Unit: Lamports (1 SOL = 1,000,000,000 lamports)
Example:
Complete Configuration Example
Network Endpoints
Mainnet
RPC:
https://api.mainnet-beta.solana.comWebSocket:
wss://api.mainnet-beta.solana.com/
Devnet
RPC:
https://api.devnet.solana.comWebSocket:
wss://api.devnet.solana.com/
Testnet
RPC:
https://api.testnet.solana.comWebSocket:
wss://api.testnet.solana.com/
Derivation Paths
Solana wallets use BIP-44 standard derivation paths. The default derivation path follows ecosystem conventions:
Default path:
m/44'/501'/{index}'/0'(where{index}is the account index)
Default Derivation Path Change in v1.0.0-beta.4+
The default derivation path was updated in v1.0.0-beta.4 to match ecosystem conventions:
Before (<= v1.0.0-beta.3):
m/44'/501'/0'/0/{index}After (v1.0.0-beta.4+):
m/44'/501'/{index}'/0'
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 RPC endpoints
Set appropriate
transferMaxFeelimits for your use caseConsider using environment variables for configuration in production
Use trusted RPC providers or run your own Solana validator for production applications

