Configuration
Configuration options and settings for @tetherto/wdk-wallet-spark
Known Issue: Thread Hanging in Bare runtime Environments
There is a known issue with this module causing thread hanging when used in bare runtime environments. The module is not production-ready in bare runtime at this time.
For the latest updates and workarounds, please check the GitHub Issues.
Wallet Configuration
const config = {
network: 'MAINNET' // 'MAINNET', 'TESTNET', or 'REGTEST'
}
const wallet = new WalletManagerSpark(seedPhrase, config)Account Creation
// WalletAccountSpark is created by the WalletManagerSpark
// It does not take configuration parameters directly
const account = await wallet.getAccount(0) // Get account at index 0Configuration Options
Network
The network option specifies which Spark network to use.
Type: string
Values:
"MAINNET"- Spark mainnet (production)"TESTNET"- Spark testnet (development)"REGTEST"- Spark regtest (local testing)
Default: "MAINNET"
Example:
const config = {
network: 'TESTNET' // Use testnet for development
}Network Configuration
The wallet can be configured for different Spark networks:
// Mainnet configuration
const mainnetConfig = {
network: 'MAINNET'
}
// Testnet configuration
const testnetConfig = {
network: 'TESTNET'
}
// Regtest configuration
const regtestConfig = {
network: 'REGTEST'
}BIP-44 Derivation Path
Spark uses the BIP-44 coin type 998, resulting in derivation paths like:
m/44'/998'/0'/0/0for account 0m/44'/998'/1'/0/0for account 1etc.
This ensures compatibility with standard BIP-44 wallets while using Spark's unique coin type identifier.
Complete Configuration Example
import WalletManagerSpark from '@tetherto/wdk-wallet-spark'
// Create wallet manager with configuration
const wallet = new WalletManagerSpark(seedPhrase, {
network: 'MAINNET'
})
// Get accounts (no additional configuration needed)
const account0 = await wallet.getAccount(0)
const account1 = await wallet.getAccount(1)
// Clean up when done
wallet.dispose()</tbody>
