Skip to content

Introduction to actions

Actions are standalone functions that read or change Curvy state. They are imported from @0xcurvy/curvy-sdk/actions and operate through a CurvyConfig.

ts
import { getBalances, refreshBalances } from "@0xcurvy/curvy-sdk/actions";

await refreshBalances({ config });
const balances = await getBalances({ config });

Parameters

Most actions use parameter objects so optional values remain explicit and signatures can evolve without positional arguments. Event subscription actions retain a natural listener signature.

ts
const balances = await getBalances({ 
  accountId,
  cached: false,
  config,
});

The config property is optional when an ambient browser config exists. Pass it explicitly in shared libraries, tests, and server applications.

Action groups

GroupPurpose
AccountManage accounts, active-account state, keys, and subscriptions.
AuthenticationRegister, log in, restore sessions, and log out.
BalancesRead balances and control note synchronization.
NetworksRead networks, switch environments, and resolve Curvy IDs.
EventsSubscribe and unsubscribe from typed SDK events.
HistoryRead user-facing transaction and intent history.
PlannerEstimate intents, present sanitized steps, and execute prepared intents.
AggregatorBuild, submit, relay, and price private transactions.
BridgeEstimate cross-chain bridge routes.
PortalsGenerate and inspect entry and exit Portals.
RecoveryFind owned Portals and recover assets.
NotesSynchronize notes and resolve spend witnesses.
ProvingGenerate aggregation and withdrawal proofs.
StorageReset and reconstruct SDK-derived storage.

Every public action is available in the Actions navigation. Each reference page contains its import, usage, signature, return type, parameters, errors, and source.

High-level and low-level actions

Prefer high-level actions such as aggregate, withdraw, and executeIntent for ordinary application flows. Builder, proving, and submission actions are available when an integration needs control over an intermediate step.

Errors

Actions propagate typed SDK errors and errors from their underlying runtime or transport. Handle errors at the boundary where the application can offer a meaningful retry or recovery path.