A minimal Rust program that calls GET /v2/quote?mode=DELTA and prints the recommended route’s expected output and the spender from the returned delta block. Uses reqwest with tokio.
File tree
Install
src/main.rs
Run it
You should see the recommended route’s expected output (USDC, 6 decimals) and the spender address to approve before building the order.
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