Skip to content

@lelantos-org/sdk / index / WalletState

Interface: WalletState ​

Defined in: @lelantos-org/sdk/dist/wallet/types/sync.d.ts:104

A snapshot of what the wallet knows, for rendering without polling.

Immutable. state() returns the same object until something changes, so it can back React's useSyncExternalStore(wallet.subscribe, wallet.state) directly.

Properties ​

balances ​

ts
readonly balances: ReadonlyMap<AssetId, CircuitAmount>;

Defined in: @lelantos-org/sdk/dist/wallet/types/sync.d.ts:123

Unspent total per asset held: Balance.total, without the async split.


disposed ​

ts
readonly disposed: boolean;

Defined in: @lelantos-org/sdk/dist/wallet/types/sync.d.ts:126


notes ​

ts
readonly notes: object;

Defined in: @lelantos-org/sdk/dist/wallet/types/sync.d.ts:115

count ​

ts
readonly count: number;

Notes in the store, spent included.

pendingSpend ​

ts
readonly pendingSpend: number;

Reserved after a submit with an unknown outcome.

unspent ​

ts
readonly unspent: number;

ops ​

ts
readonly ops: readonly OpActivity[];

Defined in: @lelantos-org/sdk/dist/wallet/types/sync.d.ts:125

Operations in flight, oldest first.


sync ​

ts
readonly sync: object;

Defined in: @lelantos-org/sdk/dist/wallet/types/sync.d.ts:107

lastError ​

ts
readonly lastError: 
  | WalletError<
  | "INTERNAL"
  | "WALLET_CONFIG"
  | "NETWORK_NOT_DEPLOYED"
  | "ENVIRONMENT"
  | "INVALID_ARGUMENT"
  | "NO_EVM_ACCOUNT"
  | "UNSUPPORTED_OPERATION"
  | "INSUFFICIENT_BALANCE"
  | "NOTES_HELD"
  | "INSUFFICIENT_COVER"
  | "FEE_ASSET_NOT_QUOTED"
  | "FEE_ABOVE_LIMIT"
  | "DEADLINE_PASSED"
  | "QUOTE_STALE"
  | "USER_REJECTED"
  | "RELAYER_REJECTED"
  | "SPEND_OUTCOME_UNKNOWN"
  | "RELAYER_TIMEOUT"
  | "RELAYER_FAILED"
  | "FMD_TIMEOUT"
  | "FMD_FAILED"
  | "QUOTER_TIMEOUT"
  | "QUOTER_FAILED"
  | "WIRE_FORMAT"
  | "RPC_FAILED"
  | "TX_REVERTED"
  | "TX_MINING"
  | "TREE_OUT_OF_SYNC"
  | "PROVER_FAILED"
  | "PROVER_UNAVAILABLE"
  | "PROVER_ARTIFACTS_MISSING"
  | "PROVER_ARTIFACTS_FAILED"
  | "WORKER_TIMEOUT"
  | "WORKER_CRASHED"
  | "WORKER_FAILED"
  | "X402_PAYMENT">
  | undefined;

The last sync's failure, cleared by the next success.

lastReport ​

ts
readonly lastReport: SyncReport | undefined;

status ​

ts
readonly status: "idle" | "syncing";

syncedAt ​

ts
readonly syncedAt: Date | undefined;

Last successful sync.


version ​

ts
readonly version: number;

Defined in: @lelantos-org/sdk/dist/wallet/types/sync.d.ts:106

Increments on every emitted change.