resetStorage
Clear chain-derived cache and rebuild it from the live account registry:
- stop the price-refresh timer,
- atomically clear balances, notes-tree state, and the hot projection,
- restart the price-refresh timer (running once immediately),
- ensure each known account remains persisted, then
- refresh balances for each unlocked account and return their outcomes. Locked accounts retain their metadata and rescan after unlocking.
Finalized transaction history and locally-authored transfer workflow records are preserved. Account discovery cursors are reset so the next sync backfills every committed note instead of skipping leaves from the cleared tree.
Import
ts
import { resetStorage } from "@0xcurvy/curvy-sdk/actions";Usage
ts
await resetStorage();Signature
ts
function resetStorage(parameters?: ResetStorageParameters): Promise<RefreshBalancesResult[]>Returns
Promise<RefreshBalancesResult[]>
The action resolves or returns the value shown in the signature.
Parameters
signal
- Type:
AbortSignal - Required: no
Aborts the rebuild after the cache has been cleared.
ts
const result = await resetStorage({
signal,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
ts
const result = await resetStorage({
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.
Related
- Config guide
refreshBalances— Re-sync and persist an account's shielded balances.