Prerequisites
- A Rhinestone API key (request one here)
- An EOA with USDC on Base (or another supported chain and token)
- A viem
WalletClientconfigured for signing
Setup
Steps
Get a quote
Request a quote for swapping USDC on Base into ETH on Arbitrum. Specify the destination chain, the token you want, and the amount:Because the source token (USDC on Base) differs from the destination token (ETH on Arbitrum),
accountAccessList constrains which tokens on which chains the router can spend.
Without it, the API may route through multiple chains and tokens (including wrapped ETH),
which can lead to unexpected gas requirements. Specify the exact source token(s) you want to use.intentCost.tokensSpent and intentCost.tokensReceived will show different tokens. This is how you know Warp is routing through a swap.Approve token spending
Check
tokenRequirements for any approvals needed. For a USDC source, you will typically need a Permit2 approval:This approves to the Permit2 contract. Once approved, future intents spending the same token on the same chain will not need another approval.
Sign the intent
Refresh the quote to ensure fresh pricing, then sign each element using EIP-712. One signature per origin chain — the last signature doubles as the destination signature.
Signing guide
Full
getTypedData implementation and type definitions.