routing

GO / NO-GO check before executing a transfer (free, read-only)

Call this before /api/route/execute. Returns decision (GO|NO_GO), typed blockers each carrying a fix, advisory warnings, and the expected delivery. It answers for free the questions that otherwise cost gas to discover: BELOW_FEE_THRESHOLD (a fixed corridor fee would consume the entire amount, so nothing arrives), BAD_RECIPIENT (address not valid for the destination chain family — unrecoverable once broadcast), QUOTE_ONLY_CORRIDOR (the rail prices but cannot settle), ABOVE_LANE_CAPACITY (the instant lane is full so a dearer bridge would serve you; the response names the exact ceiling to split at), HIGH_COST (>=20% of the amount withheld by vendor fees). Signs nothing, broadcasts nothing, moves nothing. Pass fromAddress so NFT membership — and therefore free micro-transfers — is recognised. A GO reflects conditions now; capacity and vendor fees move, so treat it as fresh for seconds. Also reports OUR OWN readiness — relayer native gas on both chains — because a preflight that says GO while the relayer cannot perform the transfer is worse than none.

post/api/route/preflight

Request

  • Base URL: https://api.anygas.xyz/svc
  • URL: https://api.anygas.xyz/svc/api/route/preflight
  • Auth: none declared

Query parameters

deep'1'

Set to 1 to additionally run the rail's real DRY build and inspect relayer-side readiness (token balance, allowance the bridge will pull against). This is the check that catches a missing ERC-20 allowance BEFORE it costs gas. Slower (seconds), so it is opt-in.

Headers

x-anygas-passstring

Anonymous quota raise: base64(JSON {preparedMsg, sig}) of a one-time Plus blind pass (RFC 9474). Exempts THIS request from the rate limit and, unlike x-anygas-key, is unlinkable to any identity or other request. Free passes: POST /api/plus/trial (20/day). Over the OHTTP relay put the pass in body.pass instead (headers do not cross the envelope).

Request body

amountstring required
fromTokenstring
toTokenstring
fromAddressstring

Determines membership and therefore fee tier

toAddressstring

Validated against the destination chain family

Example request

{
  "amount": "5000000",
  "fromToken": "USDC",
  "toToken": "USDC"
}

Response

Preflight verdict

decision'GO' | 'NO_GO'
okboolean
warningsobject[]
checksobject
expectedobject

Changes

No recorded changes to this operation across all 1 revision of this API.