syncNotes
Run one notes-tree sync pass per network: pull the indexer delta, discover owned notes, reconcile spends, verify the assembled root against a DIRECT chain read, persist, and apply the account-facing effects (balance entries + tx history). The synced tree is kept on config._internal.notesTrees for getSpendWitnesses.
engine selects either the bounded sharded profile (the default) or a full in-memory tree. Both verify against direct chain RPC and produce the same spend-witness contract.
Import
import { syncNotes } from "@0xcurvy/curvy-sdk/actions";Usage
const results = await syncNotes({ accountId, config });Signature
function syncNotes(parameters?: SyncNotesParameters): Promise<SyncNotesResult[]>Returns
Promise<SyncNotesResult[]>
The action resolves or returns the value shown in the signature.
Parameters
networkSlug
- Type:
string - Required: no
Network to sync; omit to sync every active network with an aggregator.
const result = await syncNotes({
networkSlug,
});accountId
- Type:
string - Required: no
Account whose ownership/spends are reconciled; defaults to the active account.
const result = await syncNotes({
accountId,
});engine
- Type:
NotesSyncEngine - Required: no
Override the config-level notesSyncEngine for this call (default: config's choice).
const result = await syncNotes({
engine,
});shardHeight
- Type:
number - Required: no
Override the sharded notes-tree height for this synchronization pass.
const result = await syncNotes({
shardHeight,
});pageSize
- Type:
number - Required: no
Override the number of indexed leaves requested per page.
const result = await syncNotes({
pageSize,
});source
- Type:
LeafSource - Required: no
Seam overrides (tests / alternative transports). Defaults: indexer API, direct RPC, balance-derived.
const result = await syncNotes({
source,
});verifier
- Type:
RootVerifier - Required: no
Override the component that verifies the assembled notes root against the chain.
const result = await syncNotes({
verifier,
});resolveOwnership
- Type:
OwnershipResolver - Required: no
Override the local note-ownership resolver.
const result = await syncNotes({
resolveOwnership,
});signal
- Type:
AbortSignal - Required: no
Abort the sync — checked between networks and inside the indexer paged loops.
const result = await syncNotes({
signal,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
const result = await syncNotes({
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.
Related
- Querying balances guide
getSpendWitnesses— Produce inclusion proofs for a spend from the synced notes tree.resolveNoteWitness— Resolve a note by scanning forward from a public lower-bound hint.refreshBalances— Re-sync and persist an account's shielded balances.