Note: This package is currently in beta. Please test thoroughly in development environments before using in production.
A Spark wallet module for WDK (Wallet Development Kit) by Tether. It creates and manages Spark accounts using BIP-39 seed phrases and the module's BIP-44 derivation paths. It supports Spark transfers and invoices, token transfers, Lightning payments, and Bitcoin layer 1 deposits and withdrawals.
About WDK
This module is part of the WDK (Wallet Development Kit) project, which empowers developers to build secure, non-custodial wallets with unified blockchain access, stateless architecture, and complete user control.
For detailed documentation about the complete WDK ecosystem, visit docs.wdk.tether.io.
Installation
npm install @tetherto/wdk-wallet-spark
Quick Start
The mnemonic below is public and for development only. Never send funds to its addresses. Use a securely generated seed phrase before handling funds.
The Spark SDK manages the signing wallet's network endpoints; this module does not expose overrides for those endpoints. Optional wallet configuration includes a read-only Spark client (client), SparkScan balance polling, send recovery with syncAndRetry, a withdrawal fee ceiling with withdrawMaxFee, and Spark SDK logging. See the Configuration guide for setup details.
Enabling syncAndRetry (default: false) snapshots outgoing history before a Spark send. If the send fails, the account syncs and returns a newly appeared matching transfer or throws, without submitting again. Avoid concurrent identical sends from the same wallet. With syncAndRetry enabled, Lightning payments retry once only for stale-leaf errors, reusing the same transferId.
Key Capabilities
BIP-44 Account Derivation: Derive indexed Spark accounts from one seed phrase using the module's path prefix m/44'/998'; custom derivation paths are not supported
Spark Transfers: Quote and send fee-free sats transfers through the unified wallet API
Token and Invoice Support: Query and transfer Spark tokens, and create or pay Spark sats and token invoices
Lightning Payments: Create and pay BOLT11 invoices, quote routing fees, and inspect payment status
Bitcoin Deposits and Withdrawals: Use single-use or reusable deposit addresses, claim or refund deposits, and quote cooperative withdrawals to Bitcoin layer 1
Balances and History: Query sats and token balances, inspect Spark transfer history, and optionally use SparkScan-backed balance polling
Read-Only Accounts and Message Signing: Monitor an address without private keys, sign messages, and verify signatures
Operational Controls: Enable Spark SDK logging, configure send recovery with syncAndRetry, and initiate cleanup with dispose() when done
Compatibility
Spark Networks: Use MAINNET (default) or REGTEST. TESTNET and SIGNET fall back to local endpoints in the bundled Spark SDK; this module does not expose overrides for those signing endpoints
Node.js: Default package entry point backed by @buildonspark/spark-sdk
Bare and Pear: Dedicated runtime entry points backed by @buildonspark/bare
SparkScan: Optional balance polling on MAINNET and REGTEST