curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/QuoteIntent \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"ownerAddress": "<string>",
"originChainId": 123,
"originTokenAddress": "<string>",
"destinationChainId": 123,
"destinationTokenAddress": "<string>",
"destinationToAddress": "<string>",
"destinationCallData": "<string>",
"destinationCallValue": 123,
"originTokenAmount": 123,
"destinationTokenAmount": 123,
"tradeType": "EXACT_INPUT",
"onlyNativeGasFee": true,
"options": {
"swapProvider": "AUTO",
"bridgeProvider": "AUTO",
"slippageTolerance": 123,
"trailsAddressOverrides": {
"sequenceWalletFactoryAddress": "<string>",
"sequenceWalletMainModuleAddress": "<string>",
"sequenceWalletMainModuleUpgradableAddress": "<string>",
"sequenceWalletGuestModuleAddress": "<string>",
"sequenceWalletUtilsAddress": "<string>"
}
}
}
'{
"intent": {
"id": 123,
"projectId": 123,
"intentId": "<string>",
"status": "QUOTED",
"quoteRequest": {
"ownerAddress": "<string>",
"originChainId": 123,
"originTokenAddress": "<string>",
"destinationChainId": 123,
"destinationTokenAddress": "<string>",
"destinationToAddress": "<string>",
"destinationCallData": "<string>",
"destinationCallValue": 123,
"originTokenAmount": 123,
"destinationTokenAmount": 123,
"tradeType": "EXACT_INPUT",
"onlyNativeGasFee": true,
"options": {
"swapProvider": "AUTO",
"bridgeProvider": "AUTO",
"slippageTolerance": 123,
"trailsAddressOverrides": {
"sequenceWalletFactoryAddress": "<string>",
"sequenceWalletMainModuleAddress": "<string>",
"sequenceWalletMainModuleUpgradableAddress": "<string>",
"sequenceWalletGuestModuleAddress": "<string>",
"sequenceWalletUtilsAddress": "<string>"
}
}
},
"ownerAddress": "<string>",
"originChainId": 123,
"destinationChainId": 123,
"originIntentAddress": "<string>",
"salt": 123,
"depositTransaction": {
"toAddress": "<string>",
"tokenAddress": "<string>",
"amount": 123,
"decimals": 123
},
"originCalls": {
"chainId": 123,
"calls": [
{
"to": "<string>",
"value": 123,
"data": "<string>",
"gasLimit": 123,
"delegateCall": true,
"onlyFallback": true,
"behaviorOnError": 123
}
],
"space": 123,
"nonce": 123
},
"originPrecondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"originMetaTxn": {
"id": "<string>",
"chainId": 123,
"walletAddress": "<string>",
"contract": "<string>",
"input": "<string>"
},
"quote": {
"routeProviders": [
"AUTO"
],
"routeProvidersRequestIds": [
"<string>"
],
"routeProvidersFeeUsd": [
123
],
"quoteProvider": "<string>",
"quoteProviderRequestId": "<string>",
"quoteProviderFeeUsd": 123,
"fromAmount": 123,
"fromAmountMin": 123,
"toAmount": 123,
"toAmountMin": 123,
"maxSlippage": 123,
"priceImpact": 123,
"priceImpactUsd": 123
},
"fees": {
"originGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"chainGasUsageStatus": "NORMAL",
"totalFeeAmount": 123,
"totalFeeUsd": "<string>",
"metaTxnFeeDetails": {
"metaTxnId": "<string>",
"estimatedGasLimit": 123,
"feeNative": 123
},
"metaTxnGasQuote": "<string>",
"nativeTokenPriceUsd": 123
},
"provider": {
"quoteProvider": "<string>",
"quoteProviderFee": 123,
"quoteProviderFeeUsd": 123,
"trailsFee": 123,
"trailsFeeUsd": 123,
"totalFeeAmount": 123,
"totalFeeUsd": 123
},
"feeTokenAddress": "<string>",
"feeTokenTotal": 123,
"totalFeeAmount": 123,
"totalFeeUsd": 123,
"destinationGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"chainGasUsageStatus": "NORMAL",
"totalFeeAmount": 123,
"totalFeeUsd": "<string>",
"metaTxnFeeDetails": {
"metaTxnId": "<string>",
"estimatedGasLimit": 123,
"feeNative": 123
},
"metaTxnGasQuote": "<string>",
"nativeTokenPriceUsd": 123
}
},
"trailsVersion": "<string>",
"expiresAt": "<string>",
"destinationIntentAddress": "<string>",
"destinationCalls": {
"chainId": 123,
"calls": [
{
"to": "<string>",
"value": 123,
"data": "<string>",
"gasLimit": 123,
"delegateCall": true,
"onlyFallback": true,
"behaviorOnError": 123
}
],
"space": 123,
"nonce": 123
},
"destinationPrecondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"destinationMetaTxn": {
"id": "<string>",
"chainId": 123,
"walletAddress": "<string>",
"contract": "<string>",
"input": "<string>"
},
"updatedAt": "<string>",
"createdAt": "<string>"
},
"gasFeeOptions": {
"gasEstimate": {
"totalGas": 123,
"gasPrice": "<string>",
"nativeCost": "<string>",
"nativeCostUsd": 123
},
"feeOptions": [
{
"tokenAddress": "<string>",
"tokenSymbol": "<string>",
"tokenDecimals": 123,
"amount": 123,
"amountUsd": 123,
"feeCollectorAddress": "<string>",
"is2612": true
}
],
"expiresAt": "<string>",
"feeCollectorAddress": "<string>"
}
}Request a quote for a cross-chain intent transaction
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/QuoteIntent \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"ownerAddress": "<string>",
"originChainId": 123,
"originTokenAddress": "<string>",
"destinationChainId": 123,
"destinationTokenAddress": "<string>",
"destinationToAddress": "<string>",
"destinationCallData": "<string>",
"destinationCallValue": 123,
"originTokenAmount": 123,
"destinationTokenAmount": 123,
"tradeType": "EXACT_INPUT",
"onlyNativeGasFee": true,
"options": {
"swapProvider": "AUTO",
"bridgeProvider": "AUTO",
"slippageTolerance": 123,
"trailsAddressOverrides": {
"sequenceWalletFactoryAddress": "<string>",
"sequenceWalletMainModuleAddress": "<string>",
"sequenceWalletMainModuleUpgradableAddress": "<string>",
"sequenceWalletGuestModuleAddress": "<string>",
"sequenceWalletUtilsAddress": "<string>"
}
}
}
'{
"intent": {
"id": 123,
"projectId": 123,
"intentId": "<string>",
"status": "QUOTED",
"quoteRequest": {
"ownerAddress": "<string>",
"originChainId": 123,
"originTokenAddress": "<string>",
"destinationChainId": 123,
"destinationTokenAddress": "<string>",
"destinationToAddress": "<string>",
"destinationCallData": "<string>",
"destinationCallValue": 123,
"originTokenAmount": 123,
"destinationTokenAmount": 123,
"tradeType": "EXACT_INPUT",
"onlyNativeGasFee": true,
"options": {
"swapProvider": "AUTO",
"bridgeProvider": "AUTO",
"slippageTolerance": 123,
"trailsAddressOverrides": {
"sequenceWalletFactoryAddress": "<string>",
"sequenceWalletMainModuleAddress": "<string>",
"sequenceWalletMainModuleUpgradableAddress": "<string>",
"sequenceWalletGuestModuleAddress": "<string>",
"sequenceWalletUtilsAddress": "<string>"
}
}
},
"ownerAddress": "<string>",
"originChainId": 123,
"destinationChainId": 123,
"originIntentAddress": "<string>",
"salt": 123,
"depositTransaction": {
"toAddress": "<string>",
"tokenAddress": "<string>",
"amount": 123,
"decimals": 123
},
"originCalls": {
"chainId": 123,
"calls": [
{
"to": "<string>",
"value": 123,
"data": "<string>",
"gasLimit": 123,
"delegateCall": true,
"onlyFallback": true,
"behaviorOnError": 123
}
],
"space": 123,
"nonce": 123
},
"originPrecondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"originMetaTxn": {
"id": "<string>",
"chainId": 123,
"walletAddress": "<string>",
"contract": "<string>",
"input": "<string>"
},
"quote": {
"routeProviders": [
"AUTO"
],
"routeProvidersRequestIds": [
"<string>"
],
"routeProvidersFeeUsd": [
123
],
"quoteProvider": "<string>",
"quoteProviderRequestId": "<string>",
"quoteProviderFeeUsd": 123,
"fromAmount": 123,
"fromAmountMin": 123,
"toAmount": 123,
"toAmountMin": 123,
"maxSlippage": 123,
"priceImpact": 123,
"priceImpactUsd": 123
},
"fees": {
"originGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"chainGasUsageStatus": "NORMAL",
"totalFeeAmount": 123,
"totalFeeUsd": "<string>",
"metaTxnFeeDetails": {
"metaTxnId": "<string>",
"estimatedGasLimit": 123,
"feeNative": 123
},
"metaTxnGasQuote": "<string>",
"nativeTokenPriceUsd": 123
},
"provider": {
"quoteProvider": "<string>",
"quoteProviderFee": 123,
"quoteProviderFeeUsd": 123,
"trailsFee": 123,
"trailsFeeUsd": 123,
"totalFeeAmount": 123,
"totalFeeUsd": 123
},
"feeTokenAddress": "<string>",
"feeTokenTotal": 123,
"totalFeeAmount": 123,
"totalFeeUsd": 123,
"destinationGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"chainGasUsageStatus": "NORMAL",
"totalFeeAmount": 123,
"totalFeeUsd": "<string>",
"metaTxnFeeDetails": {
"metaTxnId": "<string>",
"estimatedGasLimit": 123,
"feeNative": 123
},
"metaTxnGasQuote": "<string>",
"nativeTokenPriceUsd": 123
}
},
"trailsVersion": "<string>",
"expiresAt": "<string>",
"destinationIntentAddress": "<string>",
"destinationCalls": {
"chainId": 123,
"calls": [
{
"to": "<string>",
"value": 123,
"data": "<string>",
"gasLimit": 123,
"delegateCall": true,
"onlyFallback": true,
"behaviorOnError": 123
}
],
"space": 123,
"nonce": 123
},
"destinationPrecondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"destinationMetaTxn": {
"id": "<string>",
"chainId": 123,
"walletAddress": "<string>",
"contract": "<string>",
"input": "<string>"
},
"updatedAt": "<string>",
"createdAt": "<string>"
},
"gasFeeOptions": {
"gasEstimate": {
"totalGas": 123,
"gasPrice": "<string>",
"nativeCost": "<string>",
"nativeCostUsd": 123
},
"feeOptions": [
{
"tokenAddress": "<string>",
"tokenSymbol": "<string>",
"tokenDecimals": 123,
"amount": 123,
"amountUsd": 123,
"feeCollectorAddress": "<string>",
"is2612": true
}
],
"expiresAt": "<string>",
"feeCollectorAddress": "<string>"
}
}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.
EXACT_INPUT or EXACT_OUTPUTNONE, RELAY, CCTP, LIFI, SUSHI, ZEROX)NONE, RELAY, CCTP, LIFI, SUSHI, ZEROX)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);
CommitIntent to commit the intent if the quote is acceptableAPI Key for authenticating requests, get an access key at https://trails.build and request early access
Represented as string on the server side
EXACT_INPUT, EXACT_OUTPUT Show child attributes
Represented as string on the server side
AUTO, CCTP, LIFI, RELAY, SUSHI, ZEROX Represented as string on the server side
AUTO, CCTP, LIFI, RELAY, SUSHI, ZEROX Show child attributes
Successful response
Show child attributes
Represented as uint8 on the server side
QUOTED, COMMITTED, EXECUTING, FAILED, SUCCEEDED Show child attributes
Represented as string on the server side
EXACT_INPUT, EXACT_OUTPUT Show child attributes
Represented as string on the server side
AUTO, CCTP, LIFI, RELAY, SUSHI, ZEROX Represented as string on the server side
AUTO, CCTP, LIFI, RELAY, SUSHI, ZEROX Show child attributes
Show child attributes
[]TransactionCall
Show child attributes
Show child attributes
[]RouteProvider
Represented as string on the server side
AUTO, CCTP, LIFI, RELAY, SUSHI, ZEROX []string
[]float64
Show child attributes
Show child attributes
Represented as string on the server side
NORMAL, BUSY, VERY_BUSY Show child attributes
Show child attributes
Represented as string on the server side
NORMAL, BUSY, VERY_BUSY Show child attributes
[]TransactionCall
Show child attributes
Show child attributes
[]FeeOption
Show child attributes
Was this page helpful?