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
import { submitToChain } from "@0xcurvy/curvy-sdk/actions";Usage
const result = await submitToChain({ request, walletClient, config });Signature
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.
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.
const result = await submitToChain({
request,
walletClient,
});contractAddress
- Type:
HexString - Required: no
Override the target aggregator contract; defaults to the Network record's address.
const result = await submitToChain({
request,
walletClient,
contractAddress,
});onSubmitted
- Type:
(transactionHash: HexString) => void | Promise<void> - Required: no
Awaited immediately after broadcast, before waiting for inclusion. Persist the hash here.
const result = await submitToChain({
request,
walletClient,
onSubmitted,
});assertScope
- Type:
() => void - Required: no
Revalidate execution scope immediately before broadcasting.
const result = await submitToChain({
request,
walletClient,
assertScope,
});signal
- Type:
AbortSignal - Required: no
Stop receipt observation without changing the submitted transaction.
const result = await submitToChain({
request,
walletClient,
signal,
});config
- Type:
CurvyConfig - Required: no
Curvy config to use. Defaults to the ambient config.
const result = await submitToChain({
request,
walletClient,
config,
});Errors
Errors from config resolution and the underlying SDK operation are propagated to the caller.
Related
- 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