Skip to content

submitToChain

Submit a built aggregator proof on-chain with the caller's wallet client. The wallet account is the transaction sender and pays the native network gas.

Import

ts
import { submitToChain } from "@0xcurvy/curvy-sdk/actions";

Usage

ts
const result = await submitToChain({ request, walletClient, config });

Signature

ts
function submitToChain(parameters: SubmitToChainParameters): Promise<ChainSubmitResult>

Returns

Promise<ChainSubmitResult>

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

Parameters

request

  • Type: AggregatorSubmission
  • Required: yes

A built submission from one of the build*Request actions.

ts
const result = await submitToChain({
  request, 
  walletClient,
});

walletClient

  • Type: WalletClient
  • Required: yes

The user's viem wallet client — its account is the tx sender and pays gas.

ts
const result = await submitToChain({
  request,
  walletClient, 
});

contractAddress

  • Type: HexString
  • Required: no

Override the target aggregator contract; defaults to the Network record's address.

ts
const result = await submitToChain({
  request,
  walletClient,
  contractAddress, 
});

config

  • Type: CurvyConfig
  • Required: no

Curvy config to use. Defaults to the ambient config.

ts
const result = await submitToChain({
  request,
  walletClient,
  config, 
});

Errors

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

  • Interacting with assets guide
  • buildAggregateRequest — Build a submit-ready aggregation proof from committed notes.
  • proveAggregation — Prove an aggregation: resolve the network's aggregation circuit artifacts (from its CircuitConfig), flatten the supplied witness, and run it through the config's prover (default Rust/arkworks).
  • relaySubmission — Relay a built proof via the SDK's relay service — no EVM wallet, no gas.
  • waitForRelay — Poll a relayed submission to the requested lifecycle milestone.
  • buildWithdrawRequest — Build a submit-ready withdrawal proof from committed notes.

Source

packages/@0xcurvy/sdk/src/actions/aggregator/submitToChain.ts