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
],
"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>"
},
"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
],
"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>"
},
"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
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
Successful response
Was this page helpful?