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,
"originTokenAddress": "<string>",
"destinationTokenAddress": "<string>",
"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": 123,
"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>",
"trailsUtilsAddress": "<string>"
},
"expiresAt": "<string>",
"isTestnet": true,
"destinationIntentAddress": "<string>",
"passthrough": true,
"timedRefundUnlockTimestamp": 123,
"updatedAt": "<string>",
"createdAt": "<string>"
}
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/CommitIntent"
payload = { "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,
"originTokenAddress": "<string>",
"destinationTokenAddress": "<string>",
"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": 123,
"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>",
"trailsUtilsAddress": "<string>"
},
"expiresAt": "<string>",
"isTestnet": True,
"destinationIntentAddress": "<string>",
"passthrough": True,
"timedRefundUnlockTimestamp": 123,
"updatedAt": "<string>",
"createdAt": "<string>"
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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,
originTokenAddress: '<string>',
destinationTokenAddress: '<string>',
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: 123,
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>',
trailsUtilsAddress: '<string>'
},
expiresAt: '<string>',
isTestnet: true,
destinationIntentAddress: '<string>',
passthrough: true,
timedRefundUnlockTimestamp: 123,
updatedAt: '<string>',
createdAt: '<string>'
}
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/CommitIntent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://trails-api.sequence.app/rpc/Trails/CommitIntent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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,
'originTokenAddress' => '<string>',
'destinationTokenAddress' => '<string>',
'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' => 123,
'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>',
'trailsUtilsAddress' => '<string>'
],
'expiresAt' => '<string>',
'isTestnet' => true,
'destinationIntentAddress' => '<string>',
'passthrough' => true,
'timedRefundUnlockTimestamp' => 123,
'updatedAt' => '<string>',
'createdAt' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://trails-api.sequence.app/rpc/Trails/CommitIntent"
payload := strings.NewReader("{\n \"intent\": {\n \"id\": 123,\n \"projectId\": 123,\n \"intentId\": \"<string>\",\n \"quoteRequest\": {\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationChainId\": 123,\n \"destinationTokenAddress\": \"<string>\",\n \"destinationToAddress\": \"<string>\",\n \"destinationApproveAddress\": \"<string>\",\n \"destinationCallData\": \"<string>\",\n \"destinationCallValue\": 123,\n \"originTokenAmount\": 123,\n \"destinationTokenAmount\": 123,\n \"onlyNativeGasFee\": true,\n \"options\": {\n \"swapProviderFallback\": true,\n \"bridgeProviderFallback\": true,\n \"slippageTolerance\": 123,\n \"trailsAddressOverrides\": {\n \"sequenceWalletFactoryAddress\": \"<string>\",\n \"sequenceWalletMainModuleAddress\": \"<string>\",\n \"sequenceWalletMainModuleUpgradableAddress\": \"<string>\",\n \"sequenceWalletGuestModuleAddress\": \"<string>\",\n \"sequenceWalletUtilsAddress\": \"<string>\"\n }\n }\n },\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"destinationChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationTokenAddress\": \"<string>\",\n \"originIntentAddress\": \"<string>\",\n \"salt\": 123,\n \"depositTransaction\": {\n \"toAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"amount\": 123,\n \"chainId\": 123,\n \"to\": \"<string>\",\n \"data\": \"<string>\",\n \"value\": 123,\n \"decimals\": 123\n },\n \"originCalls\": {\n \"chainId\": 123,\n \"calls\": [\n {\n \"to\": \"<string>\",\n \"value\": 123,\n \"data\": \"<string>\",\n \"gasLimit\": 123,\n \"delegateCall\": true,\n \"onlyFallback\": true,\n \"behaviorOnError\": 123\n }\n ],\n \"space\": 123,\n \"nonce\": 123\n },\n \"originPrecondition\": {\n \"type\": \"<string>\",\n \"chainId\": 123,\n \"ownerAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"minAmount\": 123\n },\n \"originMetaTxn\": {\n \"id\": \"<string>\",\n \"chainId\": 123,\n \"walletAddress\": \"<string>\",\n \"contract\": \"<string>\",\n \"input\": \"<string>\",\n \"bridgeGas\": 123\n },\n \"quote\": {\n \"routeProviders\": [],\n \"routeProvidersRequestIds\": [\n \"<string>\"\n ],\n \"routeProvidersFeeUsd\": [\n 123\n ],\n \"fromAmount\": 123,\n \"fromAmountMin\": 123,\n \"fromAmountUsd\": 123,\n \"fromAmountMinUsd\": 123,\n \"toAmount\": 123,\n \"toAmountMin\": 123,\n \"toAmountUsd\": 123,\n \"toAmountMinUsd\": 123,\n \"maxSlippage\": 123,\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123,\n \"priceImpactDetails\": {\n \"executionPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"marketPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"providerFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"trailsFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"netPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n }\n },\n \"estimatedDuration\": 123\n },\n \"fees\": {\n \"originGas\": {\n \"chainId\": 123,\n \"totalGasLimit\": 123,\n \"gasPrice\": 123,\n \"nativeTokenSymbol\": \"<string>\",\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123,\n \"metaTxnFeeDetails\": {\n \"metaTxnId\": \"<string>\",\n \"estimatedGasLimit\": 123,\n \"feeNative\": 123\n },\n \"metaTxnGasQuote\": \"<string>\",\n \"nativeTokenPriceUsd\": 123\n },\n \"provider\": {\n \"quoteProvider\": \"<string>\",\n \"quoteProviderFee\": 123,\n \"quoteProviderFeeUsd\": 123,\n \"trailsFee\": 123,\n \"trailsFeeUsd\": 123,\n \"quoteProviderWithTrailsFee\": 123,\n \"providerWithTrailsFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"feeTokenAddress\": \"<string>\",\n \"feeTokenAmount\": 123,\n \"feeTokenUsd\": 123,\n \"feeTokenTotal\": 123,\n \"gasFeeTotal\": 123,\n \"gasFeeUsd\": 123,\n \"trailsFeeTotal\": 123,\n \"trailsFeeUsd\": 123,\n \"collectorFeeTotal\": 123,\n \"collectorFeeUsd\": 123,\n \"providerFeeTotal\": 123,\n \"providerFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"trailsVersion\": \"<string>\",\n \"trailsContracts\": {\n \"trailsIntentEntrypointAddress\": \"<string>\",\n \"trailsRouterAddress\": \"<string>\",\n \"trailsRouterShimAddress\": \"<string>\",\n \"trailsUtilsAddress\": \"<string>\"\n },\n \"expiresAt\": \"<string>\",\n \"isTestnet\": true,\n \"destinationIntentAddress\": \"<string>\",\n \"passthrough\": true,\n \"timedRefundUnlockTimestamp\": 123,\n \"updatedAt\": \"<string>\",\n \"createdAt\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://trails-api.sequence.app/rpc/Trails/CommitIntent")
.header("Content-Type", "application/json")
.body("{\n \"intent\": {\n \"id\": 123,\n \"projectId\": 123,\n \"intentId\": \"<string>\",\n \"quoteRequest\": {\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationChainId\": 123,\n \"destinationTokenAddress\": \"<string>\",\n \"destinationToAddress\": \"<string>\",\n \"destinationApproveAddress\": \"<string>\",\n \"destinationCallData\": \"<string>\",\n \"destinationCallValue\": 123,\n \"originTokenAmount\": 123,\n \"destinationTokenAmount\": 123,\n \"onlyNativeGasFee\": true,\n \"options\": {\n \"swapProviderFallback\": true,\n \"bridgeProviderFallback\": true,\n \"slippageTolerance\": 123,\n \"trailsAddressOverrides\": {\n \"sequenceWalletFactoryAddress\": \"<string>\",\n \"sequenceWalletMainModuleAddress\": \"<string>\",\n \"sequenceWalletMainModuleUpgradableAddress\": \"<string>\",\n \"sequenceWalletGuestModuleAddress\": \"<string>\",\n \"sequenceWalletUtilsAddress\": \"<string>\"\n }\n }\n },\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"destinationChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationTokenAddress\": \"<string>\",\n \"originIntentAddress\": \"<string>\",\n \"salt\": 123,\n \"depositTransaction\": {\n \"toAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"amount\": 123,\n \"chainId\": 123,\n \"to\": \"<string>\",\n \"data\": \"<string>\",\n \"value\": 123,\n \"decimals\": 123\n },\n \"originCalls\": {\n \"chainId\": 123,\n \"calls\": [\n {\n \"to\": \"<string>\",\n \"value\": 123,\n \"data\": \"<string>\",\n \"gasLimit\": 123,\n \"delegateCall\": true,\n \"onlyFallback\": true,\n \"behaviorOnError\": 123\n }\n ],\n \"space\": 123,\n \"nonce\": 123\n },\n \"originPrecondition\": {\n \"type\": \"<string>\",\n \"chainId\": 123,\n \"ownerAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"minAmount\": 123\n },\n \"originMetaTxn\": {\n \"id\": \"<string>\",\n \"chainId\": 123,\n \"walletAddress\": \"<string>\",\n \"contract\": \"<string>\",\n \"input\": \"<string>\",\n \"bridgeGas\": 123\n },\n \"quote\": {\n \"routeProviders\": [],\n \"routeProvidersRequestIds\": [\n \"<string>\"\n ],\n \"routeProvidersFeeUsd\": [\n 123\n ],\n \"fromAmount\": 123,\n \"fromAmountMin\": 123,\n \"fromAmountUsd\": 123,\n \"fromAmountMinUsd\": 123,\n \"toAmount\": 123,\n \"toAmountMin\": 123,\n \"toAmountUsd\": 123,\n \"toAmountMinUsd\": 123,\n \"maxSlippage\": 123,\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123,\n \"priceImpactDetails\": {\n \"executionPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"marketPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"providerFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"trailsFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"netPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n }\n },\n \"estimatedDuration\": 123\n },\n \"fees\": {\n \"originGas\": {\n \"chainId\": 123,\n \"totalGasLimit\": 123,\n \"gasPrice\": 123,\n \"nativeTokenSymbol\": \"<string>\",\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123,\n \"metaTxnFeeDetails\": {\n \"metaTxnId\": \"<string>\",\n \"estimatedGasLimit\": 123,\n \"feeNative\": 123\n },\n \"metaTxnGasQuote\": \"<string>\",\n \"nativeTokenPriceUsd\": 123\n },\n \"provider\": {\n \"quoteProvider\": \"<string>\",\n \"quoteProviderFee\": 123,\n \"quoteProviderFeeUsd\": 123,\n \"trailsFee\": 123,\n \"trailsFeeUsd\": 123,\n \"quoteProviderWithTrailsFee\": 123,\n \"providerWithTrailsFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"feeTokenAddress\": \"<string>\",\n \"feeTokenAmount\": 123,\n \"feeTokenUsd\": 123,\n \"feeTokenTotal\": 123,\n \"gasFeeTotal\": 123,\n \"gasFeeUsd\": 123,\n \"trailsFeeTotal\": 123,\n \"trailsFeeUsd\": 123,\n \"collectorFeeTotal\": 123,\n \"collectorFeeUsd\": 123,\n \"providerFeeTotal\": 123,\n \"providerFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"trailsVersion\": \"<string>\",\n \"trailsContracts\": {\n \"trailsIntentEntrypointAddress\": \"<string>\",\n \"trailsRouterAddress\": \"<string>\",\n \"trailsRouterShimAddress\": \"<string>\",\n \"trailsUtilsAddress\": \"<string>\"\n },\n \"expiresAt\": \"<string>\",\n \"isTestnet\": true,\n \"destinationIntentAddress\": \"<string>\",\n \"passthrough\": true,\n \"timedRefundUnlockTimestamp\": 123,\n \"updatedAt\": \"<string>\",\n \"createdAt\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/CommitIntent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"intent\": {\n \"id\": 123,\n \"projectId\": 123,\n \"intentId\": \"<string>\",\n \"quoteRequest\": {\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationChainId\": 123,\n \"destinationTokenAddress\": \"<string>\",\n \"destinationToAddress\": \"<string>\",\n \"destinationApproveAddress\": \"<string>\",\n \"destinationCallData\": \"<string>\",\n \"destinationCallValue\": 123,\n \"originTokenAmount\": 123,\n \"destinationTokenAmount\": 123,\n \"onlyNativeGasFee\": true,\n \"options\": {\n \"swapProviderFallback\": true,\n \"bridgeProviderFallback\": true,\n \"slippageTolerance\": 123,\n \"trailsAddressOverrides\": {\n \"sequenceWalletFactoryAddress\": \"<string>\",\n \"sequenceWalletMainModuleAddress\": \"<string>\",\n \"sequenceWalletMainModuleUpgradableAddress\": \"<string>\",\n \"sequenceWalletGuestModuleAddress\": \"<string>\",\n \"sequenceWalletUtilsAddress\": \"<string>\"\n }\n }\n },\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"destinationChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationTokenAddress\": \"<string>\",\n \"originIntentAddress\": \"<string>\",\n \"salt\": 123,\n \"depositTransaction\": {\n \"toAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"amount\": 123,\n \"chainId\": 123,\n \"to\": \"<string>\",\n \"data\": \"<string>\",\n \"value\": 123,\n \"decimals\": 123\n },\n \"originCalls\": {\n \"chainId\": 123,\n \"calls\": [\n {\n \"to\": \"<string>\",\n \"value\": 123,\n \"data\": \"<string>\",\n \"gasLimit\": 123,\n \"delegateCall\": true,\n \"onlyFallback\": true,\n \"behaviorOnError\": 123\n }\n ],\n \"space\": 123,\n \"nonce\": 123\n },\n \"originPrecondition\": {\n \"type\": \"<string>\",\n \"chainId\": 123,\n \"ownerAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"minAmount\": 123\n },\n \"originMetaTxn\": {\n \"id\": \"<string>\",\n \"chainId\": 123,\n \"walletAddress\": \"<string>\",\n \"contract\": \"<string>\",\n \"input\": \"<string>\",\n \"bridgeGas\": 123\n },\n \"quote\": {\n \"routeProviders\": [],\n \"routeProvidersRequestIds\": [\n \"<string>\"\n ],\n \"routeProvidersFeeUsd\": [\n 123\n ],\n \"fromAmount\": 123,\n \"fromAmountMin\": 123,\n \"fromAmountUsd\": 123,\n \"fromAmountMinUsd\": 123,\n \"toAmount\": 123,\n \"toAmountMin\": 123,\n \"toAmountUsd\": 123,\n \"toAmountMinUsd\": 123,\n \"maxSlippage\": 123,\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123,\n \"priceImpactDetails\": {\n \"executionPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"marketPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"providerFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"trailsFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"netPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n }\n },\n \"estimatedDuration\": 123\n },\n \"fees\": {\n \"originGas\": {\n \"chainId\": 123,\n \"totalGasLimit\": 123,\n \"gasPrice\": 123,\n \"nativeTokenSymbol\": \"<string>\",\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123,\n \"metaTxnFeeDetails\": {\n \"metaTxnId\": \"<string>\",\n \"estimatedGasLimit\": 123,\n \"feeNative\": 123\n },\n \"metaTxnGasQuote\": \"<string>\",\n \"nativeTokenPriceUsd\": 123\n },\n \"provider\": {\n \"quoteProvider\": \"<string>\",\n \"quoteProviderFee\": 123,\n \"quoteProviderFeeUsd\": 123,\n \"trailsFee\": 123,\n \"trailsFeeUsd\": 123,\n \"quoteProviderWithTrailsFee\": 123,\n \"providerWithTrailsFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"feeTokenAddress\": \"<string>\",\n \"feeTokenAmount\": 123,\n \"feeTokenUsd\": 123,\n \"feeTokenTotal\": 123,\n \"gasFeeTotal\": 123,\n \"gasFeeUsd\": 123,\n \"trailsFeeTotal\": 123,\n \"trailsFeeUsd\": 123,\n \"collectorFeeTotal\": 123,\n \"collectorFeeUsd\": 123,\n \"providerFeeTotal\": 123,\n \"providerFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"trailsVersion\": \"<string>\",\n \"trailsContracts\": {\n \"trailsIntentEntrypointAddress\": \"<string>\",\n \"trailsRouterAddress\": \"<string>\",\n \"trailsRouterShimAddress\": \"<string>\",\n \"trailsUtilsAddress\": \"<string>\"\n },\n \"expiresAt\": \"<string>\",\n \"isTestnet\": true,\n \"destinationIntentAddress\": \"<string>\",\n \"passthrough\": true,\n \"timedRefundUnlockTimestamp\": 123,\n \"updatedAt\": \"<string>\",\n \"createdAt\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"intentId": "<string>"
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<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,
"originTokenAddress": "<string>",
"destinationTokenAddress": "<string>",
"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": 123,
"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>",
"trailsUtilsAddress": "<string>"
},
"expiresAt": "<string>",
"isTestnet": true,
"destinationIntentAddress": "<string>",
"passthrough": true,
"timedRefundUnlockTimestamp": 123,
"updatedAt": "<string>",
"createdAt": "<string>"
}
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/CommitIntent"
payload = { "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,
"originTokenAddress": "<string>",
"destinationTokenAddress": "<string>",
"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": 123,
"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>",
"trailsUtilsAddress": "<string>"
},
"expiresAt": "<string>",
"isTestnet": True,
"destinationIntentAddress": "<string>",
"passthrough": True,
"timedRefundUnlockTimestamp": 123,
"updatedAt": "<string>",
"createdAt": "<string>"
} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
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,
originTokenAddress: '<string>',
destinationTokenAddress: '<string>',
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: 123,
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>',
trailsUtilsAddress: '<string>'
},
expiresAt: '<string>',
isTestnet: true,
destinationIntentAddress: '<string>',
passthrough: true,
timedRefundUnlockTimestamp: 123,
updatedAt: '<string>',
createdAt: '<string>'
}
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/CommitIntent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://trails-api.sequence.app/rpc/Trails/CommitIntent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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,
'originTokenAddress' => '<string>',
'destinationTokenAddress' => '<string>',
'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' => 123,
'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>',
'trailsUtilsAddress' => '<string>'
],
'expiresAt' => '<string>',
'isTestnet' => true,
'destinationIntentAddress' => '<string>',
'passthrough' => true,
'timedRefundUnlockTimestamp' => 123,
'updatedAt' => '<string>',
'createdAt' => '<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://trails-api.sequence.app/rpc/Trails/CommitIntent"
payload := strings.NewReader("{\n \"intent\": {\n \"id\": 123,\n \"projectId\": 123,\n \"intentId\": \"<string>\",\n \"quoteRequest\": {\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationChainId\": 123,\n \"destinationTokenAddress\": \"<string>\",\n \"destinationToAddress\": \"<string>\",\n \"destinationApproveAddress\": \"<string>\",\n \"destinationCallData\": \"<string>\",\n \"destinationCallValue\": 123,\n \"originTokenAmount\": 123,\n \"destinationTokenAmount\": 123,\n \"onlyNativeGasFee\": true,\n \"options\": {\n \"swapProviderFallback\": true,\n \"bridgeProviderFallback\": true,\n \"slippageTolerance\": 123,\n \"trailsAddressOverrides\": {\n \"sequenceWalletFactoryAddress\": \"<string>\",\n \"sequenceWalletMainModuleAddress\": \"<string>\",\n \"sequenceWalletMainModuleUpgradableAddress\": \"<string>\",\n \"sequenceWalletGuestModuleAddress\": \"<string>\",\n \"sequenceWalletUtilsAddress\": \"<string>\"\n }\n }\n },\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"destinationChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationTokenAddress\": \"<string>\",\n \"originIntentAddress\": \"<string>\",\n \"salt\": 123,\n \"depositTransaction\": {\n \"toAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"amount\": 123,\n \"chainId\": 123,\n \"to\": \"<string>\",\n \"data\": \"<string>\",\n \"value\": 123,\n \"decimals\": 123\n },\n \"originCalls\": {\n \"chainId\": 123,\n \"calls\": [\n {\n \"to\": \"<string>\",\n \"value\": 123,\n \"data\": \"<string>\",\n \"gasLimit\": 123,\n \"delegateCall\": true,\n \"onlyFallback\": true,\n \"behaviorOnError\": 123\n }\n ],\n \"space\": 123,\n \"nonce\": 123\n },\n \"originPrecondition\": {\n \"type\": \"<string>\",\n \"chainId\": 123,\n \"ownerAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"minAmount\": 123\n },\n \"originMetaTxn\": {\n \"id\": \"<string>\",\n \"chainId\": 123,\n \"walletAddress\": \"<string>\",\n \"contract\": \"<string>\",\n \"input\": \"<string>\",\n \"bridgeGas\": 123\n },\n \"quote\": {\n \"routeProviders\": [],\n \"routeProvidersRequestIds\": [\n \"<string>\"\n ],\n \"routeProvidersFeeUsd\": [\n 123\n ],\n \"fromAmount\": 123,\n \"fromAmountMin\": 123,\n \"fromAmountUsd\": 123,\n \"fromAmountMinUsd\": 123,\n \"toAmount\": 123,\n \"toAmountMin\": 123,\n \"toAmountUsd\": 123,\n \"toAmountMinUsd\": 123,\n \"maxSlippage\": 123,\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123,\n \"priceImpactDetails\": {\n \"executionPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"marketPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"providerFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"trailsFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"netPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n }\n },\n \"estimatedDuration\": 123\n },\n \"fees\": {\n \"originGas\": {\n \"chainId\": 123,\n \"totalGasLimit\": 123,\n \"gasPrice\": 123,\n \"nativeTokenSymbol\": \"<string>\",\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123,\n \"metaTxnFeeDetails\": {\n \"metaTxnId\": \"<string>\",\n \"estimatedGasLimit\": 123,\n \"feeNative\": 123\n },\n \"metaTxnGasQuote\": \"<string>\",\n \"nativeTokenPriceUsd\": 123\n },\n \"provider\": {\n \"quoteProvider\": \"<string>\",\n \"quoteProviderFee\": 123,\n \"quoteProviderFeeUsd\": 123,\n \"trailsFee\": 123,\n \"trailsFeeUsd\": 123,\n \"quoteProviderWithTrailsFee\": 123,\n \"providerWithTrailsFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"feeTokenAddress\": \"<string>\",\n \"feeTokenAmount\": 123,\n \"feeTokenUsd\": 123,\n \"feeTokenTotal\": 123,\n \"gasFeeTotal\": 123,\n \"gasFeeUsd\": 123,\n \"trailsFeeTotal\": 123,\n \"trailsFeeUsd\": 123,\n \"collectorFeeTotal\": 123,\n \"collectorFeeUsd\": 123,\n \"providerFeeTotal\": 123,\n \"providerFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"trailsVersion\": \"<string>\",\n \"trailsContracts\": {\n \"trailsIntentEntrypointAddress\": \"<string>\",\n \"trailsRouterAddress\": \"<string>\",\n \"trailsRouterShimAddress\": \"<string>\",\n \"trailsUtilsAddress\": \"<string>\"\n },\n \"expiresAt\": \"<string>\",\n \"isTestnet\": true,\n \"destinationIntentAddress\": \"<string>\",\n \"passthrough\": true,\n \"timedRefundUnlockTimestamp\": 123,\n \"updatedAt\": \"<string>\",\n \"createdAt\": \"<string>\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://trails-api.sequence.app/rpc/Trails/CommitIntent")
.header("Content-Type", "application/json")
.body("{\n \"intent\": {\n \"id\": 123,\n \"projectId\": 123,\n \"intentId\": \"<string>\",\n \"quoteRequest\": {\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationChainId\": 123,\n \"destinationTokenAddress\": \"<string>\",\n \"destinationToAddress\": \"<string>\",\n \"destinationApproveAddress\": \"<string>\",\n \"destinationCallData\": \"<string>\",\n \"destinationCallValue\": 123,\n \"originTokenAmount\": 123,\n \"destinationTokenAmount\": 123,\n \"onlyNativeGasFee\": true,\n \"options\": {\n \"swapProviderFallback\": true,\n \"bridgeProviderFallback\": true,\n \"slippageTolerance\": 123,\n \"trailsAddressOverrides\": {\n \"sequenceWalletFactoryAddress\": \"<string>\",\n \"sequenceWalletMainModuleAddress\": \"<string>\",\n \"sequenceWalletMainModuleUpgradableAddress\": \"<string>\",\n \"sequenceWalletGuestModuleAddress\": \"<string>\",\n \"sequenceWalletUtilsAddress\": \"<string>\"\n }\n }\n },\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"destinationChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationTokenAddress\": \"<string>\",\n \"originIntentAddress\": \"<string>\",\n \"salt\": 123,\n \"depositTransaction\": {\n \"toAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"amount\": 123,\n \"chainId\": 123,\n \"to\": \"<string>\",\n \"data\": \"<string>\",\n \"value\": 123,\n \"decimals\": 123\n },\n \"originCalls\": {\n \"chainId\": 123,\n \"calls\": [\n {\n \"to\": \"<string>\",\n \"value\": 123,\n \"data\": \"<string>\",\n \"gasLimit\": 123,\n \"delegateCall\": true,\n \"onlyFallback\": true,\n \"behaviorOnError\": 123\n }\n ],\n \"space\": 123,\n \"nonce\": 123\n },\n \"originPrecondition\": {\n \"type\": \"<string>\",\n \"chainId\": 123,\n \"ownerAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"minAmount\": 123\n },\n \"originMetaTxn\": {\n \"id\": \"<string>\",\n \"chainId\": 123,\n \"walletAddress\": \"<string>\",\n \"contract\": \"<string>\",\n \"input\": \"<string>\",\n \"bridgeGas\": 123\n },\n \"quote\": {\n \"routeProviders\": [],\n \"routeProvidersRequestIds\": [\n \"<string>\"\n ],\n \"routeProvidersFeeUsd\": [\n 123\n ],\n \"fromAmount\": 123,\n \"fromAmountMin\": 123,\n \"fromAmountUsd\": 123,\n \"fromAmountMinUsd\": 123,\n \"toAmount\": 123,\n \"toAmountMin\": 123,\n \"toAmountUsd\": 123,\n \"toAmountMinUsd\": 123,\n \"maxSlippage\": 123,\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123,\n \"priceImpactDetails\": {\n \"executionPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"marketPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"providerFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"trailsFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"netPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n }\n },\n \"estimatedDuration\": 123\n },\n \"fees\": {\n \"originGas\": {\n \"chainId\": 123,\n \"totalGasLimit\": 123,\n \"gasPrice\": 123,\n \"nativeTokenSymbol\": \"<string>\",\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123,\n \"metaTxnFeeDetails\": {\n \"metaTxnId\": \"<string>\",\n \"estimatedGasLimit\": 123,\n \"feeNative\": 123\n },\n \"metaTxnGasQuote\": \"<string>\",\n \"nativeTokenPriceUsd\": 123\n },\n \"provider\": {\n \"quoteProvider\": \"<string>\",\n \"quoteProviderFee\": 123,\n \"quoteProviderFeeUsd\": 123,\n \"trailsFee\": 123,\n \"trailsFeeUsd\": 123,\n \"quoteProviderWithTrailsFee\": 123,\n \"providerWithTrailsFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"feeTokenAddress\": \"<string>\",\n \"feeTokenAmount\": 123,\n \"feeTokenUsd\": 123,\n \"feeTokenTotal\": 123,\n \"gasFeeTotal\": 123,\n \"gasFeeUsd\": 123,\n \"trailsFeeTotal\": 123,\n \"trailsFeeUsd\": 123,\n \"collectorFeeTotal\": 123,\n \"collectorFeeUsd\": 123,\n \"providerFeeTotal\": 123,\n \"providerFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"trailsVersion\": \"<string>\",\n \"trailsContracts\": {\n \"trailsIntentEntrypointAddress\": \"<string>\",\n \"trailsRouterAddress\": \"<string>\",\n \"trailsRouterShimAddress\": \"<string>\",\n \"trailsUtilsAddress\": \"<string>\"\n },\n \"expiresAt\": \"<string>\",\n \"isTestnet\": true,\n \"destinationIntentAddress\": \"<string>\",\n \"passthrough\": true,\n \"timedRefundUnlockTimestamp\": 123,\n \"updatedAt\": \"<string>\",\n \"createdAt\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/CommitIntent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"intent\": {\n \"id\": 123,\n \"projectId\": 123,\n \"intentId\": \"<string>\",\n \"quoteRequest\": {\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationChainId\": 123,\n \"destinationTokenAddress\": \"<string>\",\n \"destinationToAddress\": \"<string>\",\n \"destinationApproveAddress\": \"<string>\",\n \"destinationCallData\": \"<string>\",\n \"destinationCallValue\": 123,\n \"originTokenAmount\": 123,\n \"destinationTokenAmount\": 123,\n \"onlyNativeGasFee\": true,\n \"options\": {\n \"swapProviderFallback\": true,\n \"bridgeProviderFallback\": true,\n \"slippageTolerance\": 123,\n \"trailsAddressOverrides\": {\n \"sequenceWalletFactoryAddress\": \"<string>\",\n \"sequenceWalletMainModuleAddress\": \"<string>\",\n \"sequenceWalletMainModuleUpgradableAddress\": \"<string>\",\n \"sequenceWalletGuestModuleAddress\": \"<string>\",\n \"sequenceWalletUtilsAddress\": \"<string>\"\n }\n }\n },\n \"ownerAddress\": \"<string>\",\n \"originChainId\": 123,\n \"destinationChainId\": 123,\n \"originTokenAddress\": \"<string>\",\n \"destinationTokenAddress\": \"<string>\",\n \"originIntentAddress\": \"<string>\",\n \"salt\": 123,\n \"depositTransaction\": {\n \"toAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"amount\": 123,\n \"chainId\": 123,\n \"to\": \"<string>\",\n \"data\": \"<string>\",\n \"value\": 123,\n \"decimals\": 123\n },\n \"originCalls\": {\n \"chainId\": 123,\n \"calls\": [\n {\n \"to\": \"<string>\",\n \"value\": 123,\n \"data\": \"<string>\",\n \"gasLimit\": 123,\n \"delegateCall\": true,\n \"onlyFallback\": true,\n \"behaviorOnError\": 123\n }\n ],\n \"space\": 123,\n \"nonce\": 123\n },\n \"originPrecondition\": {\n \"type\": \"<string>\",\n \"chainId\": 123,\n \"ownerAddress\": \"<string>\",\n \"tokenAddress\": \"<string>\",\n \"minAmount\": 123\n },\n \"originMetaTxn\": {\n \"id\": \"<string>\",\n \"chainId\": 123,\n \"walletAddress\": \"<string>\",\n \"contract\": \"<string>\",\n \"input\": \"<string>\",\n \"bridgeGas\": 123\n },\n \"quote\": {\n \"routeProviders\": [],\n \"routeProvidersRequestIds\": [\n \"<string>\"\n ],\n \"routeProvidersFeeUsd\": [\n 123\n ],\n \"fromAmount\": 123,\n \"fromAmountMin\": 123,\n \"fromAmountUsd\": 123,\n \"fromAmountMinUsd\": 123,\n \"toAmount\": 123,\n \"toAmountMin\": 123,\n \"toAmountUsd\": 123,\n \"toAmountMinUsd\": 123,\n \"maxSlippage\": 123,\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123,\n \"priceImpactDetails\": {\n \"executionPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"marketPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"providerFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"trailsFeesPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n },\n \"netPriceImpact\": {\n \"priceImpact\": 123,\n \"priceImpactUsd\": 123\n }\n },\n \"estimatedDuration\": 123\n },\n \"fees\": {\n \"originGas\": {\n \"chainId\": 123,\n \"totalGasLimit\": 123,\n \"gasPrice\": 123,\n \"nativeTokenSymbol\": \"<string>\",\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123,\n \"metaTxnFeeDetails\": {\n \"metaTxnId\": \"<string>\",\n \"estimatedGasLimit\": 123,\n \"feeNative\": 123\n },\n \"metaTxnGasQuote\": \"<string>\",\n \"nativeTokenPriceUsd\": 123\n },\n \"provider\": {\n \"quoteProvider\": \"<string>\",\n \"quoteProviderFee\": 123,\n \"quoteProviderFeeUsd\": 123,\n \"trailsFee\": 123,\n \"trailsFeeUsd\": 123,\n \"quoteProviderWithTrailsFee\": 123,\n \"providerWithTrailsFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"feeTokenAddress\": \"<string>\",\n \"feeTokenAmount\": 123,\n \"feeTokenUsd\": 123,\n \"feeTokenTotal\": 123,\n \"gasFeeTotal\": 123,\n \"gasFeeUsd\": 123,\n \"trailsFeeTotal\": 123,\n \"trailsFeeUsd\": 123,\n \"collectorFeeTotal\": 123,\n \"collectorFeeUsd\": 123,\n \"providerFeeTotal\": 123,\n \"providerFeeUsd\": 123,\n \"totalFeeAmount\": 123,\n \"totalFeeUsd\": 123\n },\n \"trailsVersion\": \"<string>\",\n \"trailsContracts\": {\n \"trailsIntentEntrypointAddress\": \"<string>\",\n \"trailsRouterAddress\": \"<string>\",\n \"trailsRouterShimAddress\": \"<string>\",\n \"trailsUtilsAddress\": \"<string>\"\n },\n \"expiresAt\": \"<string>\",\n \"isTestnet\": true,\n \"destinationIntentAddress\": \"<string>\",\n \"passthrough\": true,\n \"timedRefundUnlockTimestamp\": 123,\n \"updatedAt\": \"<string>\",\n \"createdAt\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"intentId": "<string>"
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}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