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 to approve before building the order.
Recommended route vs alternatives
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 }. Sign toSign with an ERC-2098 compact signature, then POST /v2/delta/orders with order (the toSign.value), the signature, chainId, and your partner. 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.
Related pages