Skip to main content
A minimal Node script that calls GET /v2/quote?mode=DELTA and prints the recommended route’s expected output and the spender from the returned delta block. No SDK, just fetch.

File tree

Install

src/quote.ts

Run it

You should see the recommended route’s expected output (USDC, 6 decimals) and the spender address. An ERC-20 source approves the spender before building the order; this example sells native ETH, which needs no approval — it’s funded by a deposit transaction after submit instead (see Native ETH (dETH)). The delta block carries a single recommended route. For crosschain swaps it also returns alternatives: other bridge routes you can offer the user. Pass whichever route you choose, unmodified, into the build step.

Next: build, sign, submit

Pass the unmodified delta.route into POST /v2/delta/orders/build (with owner set to the user address) to get EIP-712 typed data back as { toSign, orderHash }. For an ERC-20 source, sign toSign with an ERC-2098 compact signature, then POST /v2/delta/orders with order (the toSign.value), the signature, chainId, and your partner. For a native ETH source (like this example), submit with signature: "0x" and have the user send one depositNativeAndPreSign(orderHash) transaction instead — see Native ETH (dETH). Poll GET /v2/delta/orders/{orderId} for status. See Delta → How it works.
Pass delta.route verbatim to /v2/delta/orders/build. Reordering or re-encoding it will cause the build call to reject.
Last modified on August 14, 2026