Overview
The QuoteIntent 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_INPUT or EXACT_OUTPUT
- destinationTokenAmount (bigint): Amount of destination tokens (only for EXACT_OUTPUT)
- originTokenAmount (bigint): Amount of origin tokens (only for EXACT_INPUT)
- destinationCallData (string): Custom calldata for contract interactions on destination chain
- destinationCallValue (string): Value to send with the destination call
- options (QuoteIntentRequestOptions):
- bridgeProvider (RouteProvider): Preferred bridge provider (
NONE, RELAY, CCTP, LIFI, SUSHI, ZEROX)
- swapProvider (RouteProvider): Preferred swap provider, only for for same chain swaps (
NONE, RELAY, CCTP, LIFI, SUSHI, ZEROX)
- slippageTolerance (number): Maximum acceptable slippage percentage as a fraction of 1 (e.g. 0.005 for 0.5%)
- trailsAddressOverrides (TrailsAddressOverrides): Custom Sequence wallet addresses
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
const quoteRequest = {
ownerAddress: "0x0709CF2d5D4f3D38f5948d697fE64d7FB3639Eb1",
originChainId: 1, // Ethereum
originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
originTokenAmount: 100000000, // 100 USDC (6 decimals)
destinationChainId: 8453, // Base
destinationTokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC on Base
destinationToAddress: "0x0709CF2d5D4f3D38f5948d697fE64d7FB3639Eb1",
tradeType: "EXACT_INPUT",
options: {
slippageTolerance: 0.005, // 0.5%
bridgeProvider: "RELAY"
}
};
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/QuoteIntent', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY'
},
body: JSON.stringify(quoteRequest)
});
const quote = await response.json();
console.log('Quote:', quote);
Quote Expiration
Quotes expire 5 minutes after being issued. You must commit the intent using CommitIntent before the quote expires, or you’ll need to request a new quote.
Next Steps
After receiving a quote:
- Review the quote details, fees, and estimated amounts
- Use
CommitIntent to commit the intent before the quote expires (5-minute window)