Overview
TheSparkReadonlyClient lets you query wallet data without creating a full SparkWallet. It exposes read-only methods for balances, transfers, deposits, invoices, and token transactions.
Three use cases:
| Mode | Auth | Use case |
|---|---|---|
| Public | None | Dashboards, explorers, analytics. Query any non-private wallet |
| Master Key | Identity key | Query private wallets you own without full wallet initialization |
| Custom Signer | Identity key via signer | Partners (e.g., Privy) passing in a signer without a mnemonic |
Installation
The wallet viewer ships with the standard SDK package.Create a Public Client
No authentication. Queries public (non-private) wallet data.Public clients can query any wallet that hasn’t enabled privacy mode. Private wallets return empty results, not errors.
Create with Master Key
Authenticates with an identity key derived from a mnemonic or seed. Can query private wallets the key owns.Create with Custom Signer
For integrations where a partner provides aSparkSigner implementation instead of a mnemonic.
Query Examples
Balances
Transfers
Deposits and UTXOs
Invoices and Token Transactions
Privacy Model
The wallet viewer respects privacy mode:- Privacy off (default): Both public and authenticated clients see all data.
- Privacy on: Public clients get empty results. Authenticated clients (master key / signer) see everything.