Skip to content

waitForRelay

Poll a relayed submission to the requested lifecycle milestone. A receipt is not finality; the default returns once the exact inclusion block is canonical.

Import

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

Usage

ts
const result = await waitForRelay({
  requestId,
  waitFor: "finalized",
  config,
});

Signature

ts
function waitForRelay(parameters: WaitForRelayParameters): Promise<RelaySubmitReturnType>

Returns

Promise<RelaySubmitReturnType>

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

Parameters

requestId

  • Type: string
  • Required: yes

The requestId returned by relaySubmission.

ts
const result = await waitForRelay({
  requestId, 
});

intervalMs

  • Type: number
  • Required: no

Poll interval in milliseconds (default 3000).

ts
const result = await waitForRelay({
  requestId,
  intervalMs, 
});

attempts

  • Type: number
  • Required: no

Maximum poll attempts before giving up (default 120).

ts
const result = await waitForRelay({
  requestId,
  attempts, 
});

waitFor

  • Type: "submitted" | "included" | "finalized"
  • Required: no

Milestone to wait for; defaults to canonical inclusion.

ts
const result = await waitForRelay({
  requestId,
  waitFor: "finalized", 
});

config

  • Type: CurvyConfig
  • Required: no

Curvy config to use. Defaults to the ambient config.

ts
const result = await waitForRelay({
  requestId,
  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).
  • submitToChain — Submit a built aggregator proof on-chain with the caller's wallet client.
  • relaySubmission — Relay a built proof via the SDK's relay service — no EVM wallet, no gas.
  • buildWithdrawRequest — Build a submit-ready withdrawal proof from committed notes.

Source

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