Skip to main content
Creates a SparkReadonlyClient authenticated with an identity key derived from a mnemonic or seed. Can query private wallets the key owns.

Method Signature

Parameters

config
ConfigOptions | undefined
required
Configuration options including network selection. Pass undefined for defaults.
mnemonicOrSeed
Uint8Array | string
required
BIP-39 mnemonic phrase, hex-encoded seed string, or raw seed bytes.
accountNumber
number
Account index for key derivation. Defaults to 0 for REGTEST, 1 otherwise.

Returns

client
Promise<SparkReadonlyClient>
required
An authenticated wallet viewer. Requests include an identity key signature for access to private wallet data.

Example