Configuration

Configuration options and settings for @tetherto/wdk-wallet-spark

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 0

Configuration Options

Network

The network option specifies which Spark network to use.

Type: string

Values:

  • "MAINNET" - Spark mainnet (production)

  • "TESTNET" - Spark testnet (development)

  • "SIGNET" - Spark signet (testing)

  • "REGTEST" - Spark regtest (local development)

Default: "MAINNET"

Example:

SparkScan API Key

The sparkScanApiKey option allows you to provide an API key for SparkScan API requests. This is used for read-only operations like fetching balances and transaction receipts.

Type: string (optional)

Example:

Network Configuration

The wallet can be configured for different Spark networks:

BIP-44 Derivation Path

Spark uses the BIP-44 coin type 998, resulting in derivation paths like:

  • m/44'/998'/0'/0/0 for MAINNET account index 0

  • m/44'/998'/0'/0/1 for MAINNET account index 1

  • m/44'/998'/1'/0/0 for TESTNET account index 0

  • m/44'/998'/2'/0/0 for SIGNET account index 0

  • m/44'/998'/3'/0/0 for REGTEST account index 0

The path follows the pattern m/44'/998'/{networkNumber}'/0/{index} where:

  • 998 is the coin type for Spark

  • networkNumber is 0 for MAINNET, 1 for TESTNET, 2 for SIGNET, or 3 for REGTEST

  • index is the account index

This ensures compatibility with standard BIP-44 wallets while using Spark's unique coin type identifier.

Complete Configuration Example


Need Help?