Lightning (Spark) wallet
Create Spark wallets for Lightning payments, Spark transfers, deposits, withdrawals, and token balances.
Use the Spark wallet module for Spark network wallets, Lightning invoices, Spark invoices, token transfers, and Bitcoin layer 1 deposits or withdrawals.
These pages reflect @tetherto/wdk-wallet-spark@1.0.0-beta.28. A wallet manager shares one read-only Spark client across its accounts; you can also supply an existing client through client. Each account still has its own signing wallet.
With syncAndRetry, native sends submit once and recover a matching transfer from history after a failure. Lightning payments retry only stale-leaf failures and preserve their transfer ID.
Features
- Spark Blockchain Support: Full integration with the Spark Bitcoin layer 2 network
- Lightning Network Integration: Create and pay Lightning Network invoices directly
- Spark Invoices: Create and pay Spark invoices for receiving sats and tokens directly on the Spark network
- SparkScan Balance Polling: Use SparkScan-backed balance polling in
getBalance()whensparkscanis configured - Send Recovery and Lightning Retry: Optionally reconcile failed native sends against transfer history and retry stale-leaf Lightning failures once using the same transfer ID
- Spark SDK Logging: Enable Spark SDK logs with the
enableLoggingconfiguration option when debugging wallet setup or runtime behavior - Token Transfers: Transfer tokens to other Spark addresses
- Bitcoin Layer 1 Bridge: Deposit and withdraw Bitcoin between layer 1 and Spark
- Static Deposit Addresses: Reusable deposit addresses for Bitcoin layer 1 deposits
- Deposit Refunds: Refund static deposits back to Bitcoin addresses
- Withdrawal Fee Quotes: Get fee quotes before withdrawing funds
- BIP-44 Derivation Paths: Support for standard BIP-44 derivation paths with Spark-specific coin type (998)
- BIP-39 Seed Phrase Support: Generate and validate BIP-39 mnemonic seed phrases
- Multi-Account Management: Create and manage multiple accounts from a single seed phrase
- Single-Use Deposit Addresses: Generate unique deposit addresses for Bitcoin layer 1 deposits
- Fee-Free Transactions: Spark transactions are fee-free on the layer 2 network
- Transaction History: Complete transaction history with incoming/outgoing transfers
- Normalized Transfer Status: Read or wait for Spark transfer IDs with
pending,final, anddroppedfinality and the native Spark transfer attached - Message Signing: Sign and verify messages using Spark identity keys
- Memory Safety: Secure private key management with automatic memory cleanup
- TypeScript Support: Full TypeScript definitions included
- Network Support: Support for Spark mainnet and regtest networks
Supported Networks
This package supports the following Spark networks:
- Spark Mainnet: Production Spark network
- Spark Signet: Spark testing network
- Spark Regtest: Local Spark network for testing
Regtest Faucet
You can obtain test funds for your Regtest environment from the Lightspark Regtest Faucet.
Next Steps
Node.js Quickstart
Get started with WDK in a Node.js environment
WDK Spark Wallet Configuration
Get started with WDK's Spark Wallet configuration
WDK Spark Wallet API
Get started with WDK's Spark Wallet API
WDK Spark Wallet Usage
Get started with WDK's with Spark Wallet usage