Omit dstChain, or set it equal to srcChain, for a same-chain swap. See the
swap orchestration guide for the whole flow.
The result forces the branch
execute is a discriminated union, deliberately. Some routes are signed
transactions and some are deposits to an address, and the two are not
interchangeable — treating a deposit route as a transaction produces a
transaction that does nothing. Making it a union means the compiler forces the
branch rather than trusting you to remember:
On memo chains a transfer sent without the memo may be unrecoverable. Render it
as prominently as the address.
Expiry
expiresAt is Unix seconds, not milliseconds and not a date string:
A stale route reverts on slippage rather than filling at a bad price. That is
the safe failure, but it is still a failed transaction for your user — so
re-quote before submitting if any time has passed.
Choosing the flow
When a route offers both, prefer picks. "transaction" (the default) suits a
connected wallet; "deposit" suits a payer who has not connected one, or who
is funding from an exchange.
Refunds on intent routes
Intent routes need refundRecipient at quote time. An intent is a solver’s
promise to deliver, and a failed promise has to unwind somewhere — collect the
address while the user is still there, not at failure time when they are gone.
Aggregator routes do not need it: funds stay in the user’s custody until the
swap executes.
via is for display only
Never branch on it. Routing is chosen per quote and the provider set changes;
code that switches on a provider name breaks silently the first time a better
route wins.