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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”checkPools
Section titled “checkPools”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.
Parameters
Section titled “Parameters”chainId
Section titled “chainId”number
readonly CurvePool[]
Returns
Section titled “Returns”Promise<string | null>
checkSealed
Section titled “checkSealed”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.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<string | null>
inspectSealed
Section titled “inspectSealed”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).
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”Promise<string | { amount: bigint; minDy: bigint; out: bigint; probeOut: bigint | null; }>
rpc: (
chainId,calls,signal?,options?) =>Promise<unknown[]>
Parameters
Section titled “Parameters”chainId
Section titled “chainId”number
RpcCall[]
signal?
Section titled “signal?”AbortSignal
options?
Section titled “options?”RpcOptions
Returns
Section titled “Returns”Promise<unknown[]>
verifyDeployment
Section titled “verifyDeployment”verifyDeployment: (
chainId) =>Promise<void>
The pinned router is still the code we pinned, at the version we pinned.
Parameters
Section titled “Parameters”chainId
Section titled “chainId”number
Returns
Section titled “Returns”Promise<void>