cURL
Intents
QuoteIntent
POST
cURL
Documentation Index
Fetch the complete documentation index at: https://docs.trails.build/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheQuoteIntent endpoint allows you to request a quote for a cross-chain intent transaction. It provides comprehensive information about the transaction including gas fees, optimal routing, and price impact.
Use Cases
- Get a quote for swapping tokens across different chains
- Estimate fees before executing a cross-chain transaction
- Compare different routing options
- Calculate price impact and slippage
Request Parameters
Required Fields
- ownerAddress (string): The wallet address initiating the transaction
- originChainId (number): Source chain ID where the transaction originates
- originTokenAddress (string): Contract address of the source token
- destinationChainId (number): Target chain ID for the transaction
- destinationTokenAddress (string): Contract address of the destination token
- destinationToAddress (string): Recipient address on the destination chain
Optional Fields
- tradeType (TradeType): Either
EXACT_INPUTorEXACT_OUTPUT - destinationTokenAmount (bigint): Amount of destination tokens (only for EXACT_OUTPUT)
- originTokenAmount (bigint): Amount of origin tokens (only for EXACT_INPUT)
- destinationToAddress (string): Recipient address on the destination chain (defaults to
ownerAddress) - destinationApproveAddress (string): Contract address to pre-approve on the destination chain before executing
destinationCallData - destinationCallData (string): Custom calldata for contract interactions on destination chain
- destinationCallValue (number): Value (in wei) to send with the destination call
- fundMethod (FundMethod): Hint for the funding method —
WALLET,DIRECT_TRANSFER,ONRAMP_MESH, orONRAMP_MELD - onlyNativeGasFee (boolean): When
true, restricts gas fee options to the origin chain’s native token only - options (QuoteIntentRequestOptions):
- bridgeProvider (RouteProvider): Preferred bridge provider —
AUTO(default),RELAY,CCTP,LZ_OFT,SUSHI,ZEROX,LIFI,WETH - bridgeProviderFallback (boolean): If
true, fall back to another provider if the preferred bridge provider is unavailable - swapProvider (RouteProvider): Preferred same-chain swap provider —
AUTO(default),RELAY,SUSHI,ZEROX - swapProviderFallback (boolean): If
true, fall back to another provider if the preferred swap provider is unavailable - preference (RoutePreference): Route optimisation target —
RECOMMENDED(default),FASTEST,CHEAPEST,TRUSTLESS - intentProtocol (IntentProtocolVersion): Force a specific intent protocol version —
v1orv1_5 - slippageTolerance (number): Maximum acceptable slippage as a fraction of 1 (e.g.
0.005for 0.5%) - trailsAddressOverrides (TrailsAddressOverrides): Custom Sequence wallet addresses for the intent
- bridgeProvider (RouteProvider): Preferred bridge provider —
Response
The response includes:- intent (Intent): Complete intent object with transaction details
- gasFeeOptions (GasFeeOptions): Available gas fee payment options
Intent Object Details
The intent object contains:- Unique intent ID
- Transaction status
- Deposit transaction details
- Cross-chain calls to execute
- Quote information (rates, slippage, price impact)
- Fee breakdown (gas fees, provider fees)
- Expiration timestamp
Example
Quote Expiration
Next Steps
After receiving a quote:- Review the quote details, fees, and estimated amounts
- Use
CommitIntentto commit the intent before the quote expires (5-minute window)
Body
application/json
Represented as string on the server side
Available options:
EXACT_INPUT, EXACT_OUTPUT Represented as string on the server side
Available options:
WALLET, DIRECT_TRANSFER, ONRAMP_MESH, ONRAMP_MELD