Skip to content
docs

checkRoute

checkRoute(chainId, deployment, table, args, tokenIn, tokenOut): string | null

Defined in: protocol-swap2-curve/src/routes.ts:232

Whether router arguments are a route this module would build on chainId: from tokenIn to tokenOut, every pool hop through an allowlisted (and not denied) pool whose pinned coins at i/j are the hop’s tokens, with the pool’s own pool type, an allowed swap type (1, or 2 for a metapool listing it whose base pool is allowlisted too) and its coin count; every token between two hops a catalog token, the native coin or the pinned wrapped native; swap_type 8 only through the pinned wrapped native between it and the native sentinel; swap_type 9 only on a v1.2 router through its pinned ERC-4626 vault; no other swap type; at most MAX_ROUTE_POOLS pools, MAX_ROUTE_STEPS steps, no pool twice, and nothing after the route’s end. The reason it is not, or null.

number

CurveDeployment

CurveChainPools | undefined

RouterArgs

string

string

string | null