Quote a deposit's route
/ uda/ quoteA browser reads it with the environment's publishable key alone (the gateway, preview).
Quote moving amount of one chain's asset to another chain's asset, as a deposit address would settle it: what arrives, the fees the route takes, who carries it and how long it takes. It is indicative: nothing is reserved, and it holds until expires_at at most.
Like the network catalogue, it states no scope: a route belongs to the chains rather than to an environment. A chain is named by its numeric identifier or its EIP-155 chain id, and an asset by its contract, the zero address naming the chain's own coin.
What it refuses.
A missing parameter answers
422parameter_missingand a malformed one422parameter_invalid, each naming it. A chain or asset the catalogue does not carry, an address not valid on its chain, an amount that is not positive or does not cover the network's reserve, and an asset whose routing is off answer422parameter_invalidnaming the parameter. When no provider can quote the route right now, it answers503quote_unavailable.
Query parameters
- from_network_idintegerrequired
The source chain, by its numeric identifier or EIP-155 chain id.
- from_assetstringrequired
The source asset's contract; the zero address for the chain's own coin.
- to_network_idintegerrequired
The destination chain, by its numeric identifier or EIP-155 chain id.
- to_assetstringrequired
The destination asset's contract; the zero address for the chain's own coin.
- amountstringrequired
The source amount, in the source asset's base units. An amount of more than 78 digits is more than any asset can hold and answers
422parameter_invalidnamingamount. - from_addressstringoptional
The address the money would leave; some routes quote only with it.
- to_addressstringoptional
The address the money would reach;
from_addresswhen absent.
Responses
The quote.
One end of a quoted route.
- network_idinteger <int32>required
The chain, by its numeric identifier, as the request named it.
- asset_addressstringrequired
The asset's contract, as the request named it.
An amount of one asset, exact.
amountis the integer count of the asset's smallest unit, as a string because an 18-decimal base-unit count does not fit a JSON number;amount_decimalis the same amount for people,amount / 10^decimals, also a string.Show full descriptionShow less
They always agree exactly: compare them in decimal arithmetic, never through a float.
amountis at most a uint256, the widest on-chain amount. A request that sends aTokenAmountwhose members disagree, or whoseamounta uint256 cannot hold, answers422parameter_invalidnaming it.
- network_idinteger <int32>required
One end of a quoted route.
- network_idinteger <int32>required
The chain, by its numeric identifier, as the request named it.
- asset_addressstringrequired
The asset's contract, as the request named it.
An amount of one asset, exact.
amountis the integer count of the asset's smallest unit, as a string because an 18-decimal base-unit count does not fit a JSON number;amount_decimalis the same amount for people,amount / 10^decimals, also a string.Show full descriptionShow less
They always agree exactly: compare them in decimal arithmetic, never through a float.
amountis at most a uint256, the widest on-chain amount. A request that sends aTokenAmountwhose members disagree, or whoseamounta uint256 cannot hold, answers422parameter_invalidnaming it.
- network_idinteger <int32>required
Each fee the route takes, in the source asset.
- kindstringrequired
third_party(the bridge or swap provider),platformornetwork_reserve. An amount of one asset, exact.
amountis the integer count of the asset's smallest unit, as a string because an 18-decimal base-unit count does not fit a JSON number;amount_decimalis the same amount for people,amount / 10^decimals, also a string.Show full descriptionShow less
They always agree exactly: compare them in decimal arithmetic, never through a float.
amountis at most a uint256, the widest on-chain amount. A request that sends aTokenAmountwhose members disagree, or whoseamounta uint256 cannot hold, answers422parameter_invalidnaming it.- recipientstring | nullrequired
The address the fee is paid to, or
nullwhere the route names none.
- kindstringrequired
An amount of one asset, exact.
amountis the integer count of the asset's smallest unit, as a string because an 18-decimal base-unit count does not fit a JSON number;amount_decimalis the same amount for people,amount / 10^decimals, also a string.Show full descriptionShow less
They always agree exactly: compare them in decimal arithmetic, never through a float.
amountis at most a uint256, the widest on-chain amount. A request that sends aTokenAmountwhose members disagree, or whoseamounta uint256 cannot hold, answers422parameter_invalidnaming it.- amountstringrequired
The amount in the asset's base units: digits only, no sign, no exponent and no leading zero (
"0"for zero). At most a uint256, the widest on-chain amount. - amount_decimalstringrequired
The exact human amount,
amount / 10^decimals: no sign, no exponent, no leading zero before the point other than a lone0, and no trailing zero after it ("12.5","0.000001","3"). - decimalsinteger <int32>required
The asset's decimals on its network, which
amount_decimalis scaled by. - assetstringrequired
The symbol of the asset the amount is in (
USDC), so a fee or a total never mixes units.
- amountstringrequired
- providerstringrequired
Who would carry the route.
- scenariostringrequired
The kind of route, as the routing engine names it.
- estimated_time_secondsinteger <int32>required
How long the route is expected to take, in seconds;
0where the provider states none. - expires_atstring <date-time>required
When the quote stops holding.
Errors
The error.code values this operation can return. Each one links to its entry in the error catalogue, which explains the cause and the fix.
- 400header_invalidInvalid header
- 400422parameter_invalidInvalid parameter
- 400parameter_unknownUnknown parameter
- 401api_key_not_acceptedAPI key not accepted
- 401authentication_requiredAuthentication required
- 401publishable_key_not_acceptedPublishable key not accepted
- 401secret_key_in_browserSecret key exposed in a browser
- 401token_invalidInvalid or expired token
- 409environment_provisioningEnvironment provisioning
- 409environment_resettingEnvironment resetting
- 422parameter_missingMissing parameter
- 429rate_limitedToo many requests
- 503quote_unavailableQuote unavailable