Usage
Installation, quick start, and usage examples for @tetherto/wdk-wallet-spark
Installation
npm install @tetherto/wdk-wallet-sparkQuick Start
Importing from @tetherto/wdk-wallet-spark
@tetherto/wdk-wallet-sparkCreating a New Spark Wallet
import WalletManagerSpark from '@tetherto/wdk-wallet-spark'
// Use a BIP-39 seed phrase (replace with your own secure phrase)
const seedPhrase = 'your twelve word seed phrase here'
// Create wallet manager with default configuration
const wallet = new WalletManagerSpark(seedPhrase)
// Or with custom network configuration
const wallet = new WalletManagerSpark(seedPhrase, {
network: 'MAINNET' // 'MAINNET' or 'REGTEST'
})
// Get a full access account
const account = await wallet.getAccount(0)
// Get the account's Spark address
const address = await account.getAddress()
console.log('Account address:', address)
