cURL
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/CommitIntent \
--header 'Content-Type: application/json' \
--data '
{
"intent": {
"id": 123,
"projectId": 123,
"intentId": "<string>",
"quoteRequest": {
"ownerAddress": "<string>",
"originChainId": 123,
"originTokenAddress": "<string>",
"destinationChainId": 123,
"destinationTokenAddress": "<string>",
"destinationToAddress": "<string>",
"destinationApproveAddress": "<string>",
"destinationCallData": "<string>",
"destinationCallValue": 123,
"originTokenAmount": 123,
"destinationTokenAmount": 123,
"onlyNativeGasFee": true,
"options": {
"swapProviderFallback": true,
"bridgeProviderFallback": true,
"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,
"chainId": 123,
"to": "<string>",
"data": "<string>",
"value": 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>",
"bridgeGas": 123
},
"quote": {
"routeProviders": [],
"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
}
},
"estimatedDuration": 123
},
"fees": {
"originGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"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
},
"trailsVersion": "<string>",
"trailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<string>"
},
"expiresAt": "<string>",
"destinationIntentAddress": "<string>",
"passthrough": true,
"updatedAt": "<string>",
"createdAt": "<string>"
}
}
'{
"intentId": "<string>"
}Intents
CommitIntent
POST
/
rpc
/
Trails
/
CommitIntent
cURL
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/CommitIntent \
--header 'Content-Type: application/json' \
--data '
{
"intent": {
"id": 123,
"projectId": 123,
"intentId": "<string>",
"quoteRequest": {
"ownerAddress": "<string>",
"originChainId": 123,
"originTokenAddress": "<string>",
"destinationChainId": 123,
"destinationTokenAddress": "<string>",
"destinationToAddress": "<string>",
"destinationApproveAddress": "<string>",
"destinationCallData": "<string>",
"destinationCallValue": 123,
"originTokenAmount": 123,
"destinationTokenAmount": 123,
"onlyNativeGasFee": true,
"options": {
"swapProviderFallback": true,
"bridgeProviderFallback": true,
"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,
"chainId": 123,
"to": "<string>",
"data": "<string>",
"value": 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>",
"bridgeGas": 123
},
"quote": {
"routeProviders": [],
"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
}
},
"estimatedDuration": 123
},
"fees": {
"originGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"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
},
"trailsVersion": "<string>",
"trailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<string>"
},
"expiresAt": "<string>",
"destinationIntentAddress": "<string>",
"passthrough": true,
"updatedAt": "<string>",
"createdAt": "<string>"
}
}
'{
"intentId": "<string>"
}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
TheCommitIntent 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.
Use Cases
- Lock in a quote before execution
- Prepare the intent for signing and execution
- Transition from quoted to committed state and preparing a deposit intent address
Request Parameters
Required Fields
- intent (Intent): The complete intent object returned from
QuoteIntent
Response
The response includes:- intentId (string): Unique identifier for the committed intent
Intent Lifecycle
QuoteIntent → CommitIntent → ExecuteIntent → Receipt
CommitIntent step is crucial because it:
- Reserves the quoted rates
- Locks in the gas fee estimates
- Validates the intent parameters
Example
// 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);
Important Notes
Committed intents must be executed within 10 minutes. Make sure to call
ExecuteIntent before this window expires, or you’ll need to get a new quote and commit again.The intent object from
QuoteIntent should not be modified, otherwise the API will reject the commitment.Next Steps
After committing an intent:- Prepare the transaction signature using the provided intent details for the user to deposit into the intent address
- Execute the transaction with
ExecuteIntent - Monitor the transaction status with
WaitIntentReceipt
Was this page helpful?
⌘I