The executable transaction
The payload to send onchain lives in the quote’s tx object:| Field | Description |
|---|---|
| tx.to | RialtoRouter contract address; the to of your transaction. |
| tx.data | ABI-encoded calldata for the swap. |
| tx.value | Native value to send. 0 for ERC20 sells; the sell amount for native ETH sells. |
| tx.estimated_gas | Backend gas estimate. Still run wallet or RPC gas estimation before sending. |
| tx.signature_offset | Byte offset in tx.data where the taker’s 65-byte Permit2 signature is inserted. Present only for Permit2 settlement. |
| permit2 | EIP-712 typed-data message the taker signs. Present only for Permit2 settlement. |
Permit2 settlement
Permit2 is the default for ERC20 sells. The taker authorizes a single exact transfer by signing an EIP-712 message bound to the precise swap, including recipient, buy token, minimum output, deadline, quote id, and the hash of the route actions. Steps:- If issues.allowance is non-null, ask the taker to approve issues.allowance.spender for at least sell_amount. For Permit2 quotes this spender is the Permit2 contract.
- Have the taker wallet sign the permit2 object as EIP-712 typed data.
- Splice the returned 65-byte signature into tx.data at tx.signature_offset.
- Send the transaction from the taker wallet using to, the patched data, and value.
Allowance settlement
A quote returns settlement: “allowance” with no permit2 object and no signature_offset when Permit2 is not the right path, for example native ETH sells, or a flow where the taker already wants to use ERC20 allowance.- ERC20 sells. If issues.allowance is non-null, the taker approves issues.allowance.spender for at least the raw sell_amount, then sends the transaction. Do not modify tx.data.
- Native ETH sells. Send the transaction with tx.value; no ERC20 approval and no signature are needed.
