Skip to content
docs

curveOnChain

curveOnChain(opts): object

Defined in: protocol-swap2-curve/src/verify.ts:117

On-chain checks shared by the provider and curveRemotePins: the pinned router’s code hash and version (once per chain; the AddressProvider’s id 2 only compared), and a sealed quote re-checked right before broadcast.

CurveOnChainOptions

checkPools: (chainId, list) => Promise<string | null>

Allowlisted pools as a sealed quote’s preflight reads them, without a route: each still has its pinned code and coins. The reason the first one fails, or null (a failed read throws). For live checks over a whole allowlist.

number

readonly CurvePool[]

Promise<string | null>

checkSealed: (quote, tx) => Promise<string | null>

A sealed quote right before broadcast (or a remote build on the client): the transaction is byte for byte the quote’s router call, the route passes checkRoute, the router was verified as the pinned code and version (once per chain per process — it is immutable), every hop pool still has its pinned code and coins (re-read each time), and a fresh get_dy of that exact route still pays at least the minimum. The reason it fails, or null.

Quote

UnsignedTx

Promise<string | null>

inspectSealed: (quote, tx, probe) => Promise<string | { amount: bigint; minDy: bigint; out: bigint; probeOut: bigint | null; }>

checkSealed, and what it read when it passes: the fresh get_dy of the exact route at the sealed amount, the call’s minimum and, with probe, the same route at 1/1000 of the amount (null when it reverts).

Quote

UnsignedTx

boolean

Promise<string | { amount: bigint; minDy: bigint; out: bigint; probeOut: bigint | null; }>

rpc: (chainId, calls, signal?, options?) => Promise<unknown[]>

number

RpcCall[]

AbortSignal

RpcOptions

Promise<unknown[]>

verifyDeployment: (chainId) => Promise<void>

The pinned router is still the code we pinned, at the version we pinned.

number

Promise<void>