Skip to content

@armada/sdk / index / loadScanState

Function: loadScanState()

loadScanState(storage, shieldedAddress): Promise<{ state: WalletScanState; syncedThrough: number; } | undefined>

Defined in: src/sync/scan-persistence.ts:38

Load a wallet's persisted scan state, or undefined on a first run OR when the stored record is unreadable. Scan state is a chain-derived cache: a corrupt blob (a bit-flip, an interrupted write, an undecryptable record after a key/format change) must degrade to a cache MISS so sync() rescans from creationBlock — not throw and brick every future sync (the "delete the DB by hand" pitfall §4.3 deletes). The next saveScanState overwrites the bad record.

Parameters

storage

StorageAdapter

shieldedAddress

string

Returns

Promise<{ state: WalletScanState; syncedThrough: number; } | undefined>