SparkReadonlyClient authenticated with an identity key derived from a mnemonic or seed. Can query a private wallet as its owner or as the viewer identity authorized by that owner.
Use a separate viewer mnemonic for services. Derive the public key with deriveViewerIdentityPublicKey(config, mnemonicOrSeed, accountNumber) and have the owner authorize it with setViewerIdentityPublicKey(). Use the same network and account number for derivation and authentication. See the complete setup.
Method Signature
Parameters
ConfigOptions | undefined
required
Configuration options including network selection. Pass
undefined for defaults.Uint8Array | string
required
BIP-39 mnemonic phrase, hex-encoded seed string, or raw seed bytes.
number
Account index for key derivation. Defaults to
0 for REGTEST, 1 otherwise.Returns
Promise<SparkReadonlyClient>
required
An authenticated wallet viewer. Requests include an identity key signature for access to private wallet data.