curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/CommitIntent \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"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
],
"fromAmount": 123,
"fromAmountMin": 123,
"fromAmountUsd": 123,
"fromAmountMinUsd": 123,
"toAmount": 123,
"toAmountMin": 123,
"toAmountUsd": 123,
"toAmountMinUsd": 123,
"maxSlippage": 123,
"priceImpact": 123,
"priceImpactUsd": 123,
"priceImpactDetails": {
"executionPriceImpact": {
"priceImpact": 123,
"priceImpactUsd": 123
},
"marketPriceImpact": {
"priceImpact": 123,
"priceImpactUsd": 123
},
"providerFeesPriceImpact": {
"priceImpact": 123,
"priceImpactUsd": 123
},
"trailsFeesPriceImpact": {
"priceImpact": 123,
"priceImpactUsd": 123
},
"netPriceImpact": {
"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,
"quoteProviderWithTrailsFee": 123,
"providerWithTrailsFeeUsd": 123,
"totalFeeAmount": 123,
"totalFeeUsd": 123
},
"feeTokenAddress": "<string>",
"feeTokenAmount": 123,
"feeTokenUsd": 123,
"feeTokenTotal": 123,
"gasFeeTotal": 123,
"gasFeeUsd": 123,
"trailsFeeTotal": 123,
"trailsFeeUsd": 123,
"collectorFeeTotal": 123,
"collectorFeeUsd": 123,
"providerFeeTotal": 123,
"providerFeeUsd": 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>",
"trailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<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>"
},
"trailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<string>"
}
}
'{
"intentId": "<string>"
}Commit an intent to the Trails system
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/CommitIntent \
--header 'Content-Type: application/json' \
--header 'X-Access-Key: <api-key>' \
--data '
{
"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
],
"fromAmount": 123,
"fromAmountMin": 123,
"fromAmountUsd": 123,
"fromAmountMinUsd": 123,
"toAmount": 123,
"toAmountMin": 123,
"toAmountUsd": 123,
"toAmountMinUsd": 123,
"maxSlippage": 123,
"priceImpact": 123,
"priceImpactUsd": 123,
"priceImpactDetails": {
"executionPriceImpact": {
"priceImpact": 123,
"priceImpactUsd": 123
},
"marketPriceImpact": {
"priceImpact": 123,
"priceImpactUsd": 123
},
"providerFeesPriceImpact": {
"priceImpact": 123,
"priceImpactUsd": 123
},
"trailsFeesPriceImpact": {
"priceImpact": 123,
"priceImpactUsd": 123
},
"netPriceImpact": {
"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,
"quoteProviderWithTrailsFee": 123,
"providerWithTrailsFeeUsd": 123,
"totalFeeAmount": 123,
"totalFeeUsd": 123
},
"feeTokenAddress": "<string>",
"feeTokenAmount": 123,
"feeTokenUsd": 123,
"feeTokenTotal": 123,
"gasFeeTotal": 123,
"gasFeeUsd": 123,
"trailsFeeTotal": 123,
"trailsFeeUsd": 123,
"collectorFeeTotal": 123,
"collectorFeeUsd": 123,
"providerFeeTotal": 123,
"providerFeeUsd": 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>",
"trailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<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>"
},
"trailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<string>"
}
}
'{
"intentId": "<string>"
}CommitIntent endpoint commits an intent to the Trails system, reserving the quote and preparing it for execution. This is a required step between getting a quote and executing the transaction.
QuoteIntentQuoteIntent → CommitIntent → ExecuteIntent → Receipt
CommitIntent step is crucial because it:
// First, get a quote
const quoteResponse = 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 { intent, gasFeeOptions } = await quoteResponse.json();
// Then commit the intent
const commitResponse = await fetch('https://trails-api.sequence.app/rpc/Trails/CommitIntent', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY'
},
body: JSON.stringify({ intent })
});
const { intentId } = await commitResponse.json();
console.log('Intent committed:', intentId);
QuoteIntent should not be modified, otherwise the API will reject the commitment.ExecuteIntentWaitIntentReceiptAPI Key for authenticating requests, get an access key at https://trails.build and request early access
Successful response
Was this page helpful?