Skip to content

resetStorage

Clear chain-derived cache and rebuild it from the live account registry:

  1. stop the price-refresh timer,
  2. atomically clear balances, notes-tree state, and the hot projection,
  3. restart the price-refresh timer (running once immediately),
  4. ensure each known account remains persisted, then
  5. refresh balances for each.

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<void>

Returns

Promise<void>

The action resolves or returns the value shown in the signature.

Parameters

config

  • Type: CurvyConfig
  • Required: no

Curvy config to use. Defaults to the ambient config.

ts
await resetStorage({
  config, 
});

Errors

Errors from config resolution and the underlying SDK operation are propagated to the caller.

Source

packages/@0xcurvy/sdk/src/actions/storage/resetStorage.ts