ShieldedRepository
Repository for shielded (zswap) wallet operations.
Uses its OWN WebSocket client, independent from the shared IndexerClient. This prevents the unshielded SubscriptionManager from killing the shielded subscription when it resets the shared WebSocket connection.
Constructors
Functions
Get current shielded balances.
Get number of shielded coins.
Check if cached shielded state exists.
Load the checkpoint (state + cursor) as ONE consistent snapshot — both keys from a single DataStore emission, so the pair can't be torn across a concurrent write. Returns null if EITHER half is missing or the state fails to deserialize (a legacy state saved by saveState has no cursor → reads as absent → caller does a clean full sync that establishes the cursor). The returned ZswapCheckpoint.state is owned by the caller and must be closed.
Persist the checkpoint (serialized state + resume cursor) ATOMICALLY — both keys in one edit — so a reader can never observe a torn pair (an old state with a new cursor would make the next delta resume at the wrong frontier; see loadCheckpoint).
Subscribe to zswap events using dedicated WebSocket (not shared with unshielded).
Sync shielded (zswap) state from blockchain (#279/#1 — checkpoint + delta).