cURL
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/QuoteIntent \
--header 'Content-Type: application/json' \
--data '
{
"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>"
}
}
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/QuoteIntent"
payload = {
"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>"
}
}
}
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({
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>'
}
}
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/QuoteIntent', 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/QuoteIntent",
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([
'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>'
]
]
]),
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/QuoteIntent"
payload := strings.NewReader("{\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}")
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/QuoteIntent")
.header("Content-Type", "application/json")
.body("{\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/QuoteIntent")
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 \"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}"
response = http.request(request)
puts response.read_body{
"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,
"destinationGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"totalFeeAmount": 123,
"totalFeeUsd": 123,
"metaTxnFeeDetails": {
"metaTxnId": "<string>",
"estimatedGasLimit": 123,
"feeNative": 123
},
"metaTxnGasQuote": "<string>",
"nativeTokenPriceUsd": 123
}
},
"trailsVersion": "<string>",
"trailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<string>",
"trailsUtilsAddress": "<string>"
},
"expiresAt": "<string>",
"isTestnet": true,
"destinationIntentAddress": "<string>",
"edge": {
"edgeId": "<string>",
"originChainId": 123,
"relayRequestId": "<string>",
"edgeTokenAmount": 123,
"edgeTokenAddress": "<string>",
"edgeUserAddress": "<string>",
"initTransactionHash": "<string>",
"fillTransactionHash": "<string>",
"refundTransactionHash": "<string>",
"edgeTokenMetadata": {
"chainId": 123,
"tokenAddress": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"createdAt": "<string>"
},
"passthrough": true,
"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>",
"bridgeGas": 123
},
"gasFeeOptions": {
"gasEstimate": {
"totalGas": 123,
"gasPrice": "<string>",
"nativeCost": "<string>",
"nativeCostUsd": 123
},
"feeOptions": [
{
"tokenAddress": "<string>",
"tokenSymbol": "<string>",
"tokenDecimals": 123,
"amount": 123,
"amountUsd": 123,
"feeCollectorAddress": "<string>",
"is2612": true,
"isPassthroughEligible": true
}
],
"expiresAt": "<string>",
"feeCollectorAddress": "<string>"
},
"timedRefundUnlockTimestamp": 123,
"updatedAt": "<string>",
"createdAt": "<string>"
},
"gasFeeOptions": {
"gasEstimate": {
"totalGas": 123,
"gasPrice": "<string>",
"nativeCost": "<string>",
"nativeCostUsd": 123
},
"feeOptions": [
{
"tokenAddress": "<string>",
"tokenSymbol": "<string>",
"tokenDecimals": 123,
"amount": 123,
"amountUsd": 123,
"feeCollectorAddress": "<string>",
"is2612": true,
"isPassthroughEligible": true
}
],
"expiresAt": "<string>",
"feeCollectorAddress": "<string>"
},
"originConfiguration": {},
"destinationConfiguration": {},
"transactionStates": [
{
"id": "<string>",
"label": "<string>",
"chainId": 123,
"transactionHash": "<string>"
}
],
"passthrough": {
"eligible": true,
"passthroughTransaction": {
"toAddress": "<string>",
"tokenAddress": "<string>",
"amount": 123,
"chainId": 123,
"to": "<string>",
"data": "<string>",
"value": 123,
"decimals": 123
},
"transactionStates": [
{
"id": "<string>",
"label": "<string>",
"chainId": 123,
"transactionHash": "<string>"
}
],
"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,
"destinationGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"totalFeeAmount": 123,
"totalFeeUsd": 123,
"metaTxnFeeDetails": {
"metaTxnId": "<string>",
"estimatedGasLimit": 123,
"feeNative": 123
},
"metaTxnGasQuote": "<string>",
"nativeTokenPriceUsd": 123
}
}
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Intents
QuoteIntent
POST
/
rpc
/
Trails
/
QuoteIntent
cURL
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/QuoteIntent \
--header 'Content-Type: application/json' \
--data '
{
"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>"
}
}
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/QuoteIntent"
payload = {
"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>"
}
}
}
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({
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>'
}
}
})
};
fetch('https://trails-api.sequence.app/rpc/Trails/QuoteIntent', 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/QuoteIntent",
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([
'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>'
]
]
]),
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/QuoteIntent"
payload := strings.NewReader("{\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}")
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/QuoteIntent")
.header("Content-Type", "application/json")
.body("{\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}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/QuoteIntent")
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 \"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}"
response = http.request(request)
puts response.read_body{
"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,
"destinationGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"totalFeeAmount": 123,
"totalFeeUsd": 123,
"metaTxnFeeDetails": {
"metaTxnId": "<string>",
"estimatedGasLimit": 123,
"feeNative": 123
},
"metaTxnGasQuote": "<string>",
"nativeTokenPriceUsd": 123
}
},
"trailsVersion": "<string>",
"trailsContracts": {
"trailsIntentEntrypointAddress": "<string>",
"trailsRouterAddress": "<string>",
"trailsRouterShimAddress": "<string>",
"trailsUtilsAddress": "<string>"
},
"expiresAt": "<string>",
"isTestnet": true,
"destinationIntentAddress": "<string>",
"edge": {
"edgeId": "<string>",
"originChainId": 123,
"relayRequestId": "<string>",
"edgeTokenAmount": 123,
"edgeTokenAddress": "<string>",
"edgeUserAddress": "<string>",
"initTransactionHash": "<string>",
"fillTransactionHash": "<string>",
"refundTransactionHash": "<string>",
"edgeTokenMetadata": {
"chainId": 123,
"tokenAddress": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"createdAt": "<string>"
},
"passthrough": true,
"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>",
"bridgeGas": 123
},
"gasFeeOptions": {
"gasEstimate": {
"totalGas": 123,
"gasPrice": "<string>",
"nativeCost": "<string>",
"nativeCostUsd": 123
},
"feeOptions": [
{
"tokenAddress": "<string>",
"tokenSymbol": "<string>",
"tokenDecimals": 123,
"amount": 123,
"amountUsd": 123,
"feeCollectorAddress": "<string>",
"is2612": true,
"isPassthroughEligible": true
}
],
"expiresAt": "<string>",
"feeCollectorAddress": "<string>"
},
"timedRefundUnlockTimestamp": 123,
"updatedAt": "<string>",
"createdAt": "<string>"
},
"gasFeeOptions": {
"gasEstimate": {
"totalGas": 123,
"gasPrice": "<string>",
"nativeCost": "<string>",
"nativeCostUsd": 123
},
"feeOptions": [
{
"tokenAddress": "<string>",
"tokenSymbol": "<string>",
"tokenDecimals": 123,
"amount": 123,
"amountUsd": 123,
"feeCollectorAddress": "<string>",
"is2612": true,
"isPassthroughEligible": true
}
],
"expiresAt": "<string>",
"feeCollectorAddress": "<string>"
},
"originConfiguration": {},
"destinationConfiguration": {},
"transactionStates": [
{
"id": "<string>",
"label": "<string>",
"chainId": 123,
"transactionHash": "<string>"
}
],
"passthrough": {
"eligible": true,
"passthroughTransaction": {
"toAddress": "<string>",
"tokenAddress": "<string>",
"amount": 123,
"chainId": 123,
"to": "<string>",
"data": "<string>",
"value": 123,
"decimals": 123
},
"transactionStates": [
{
"id": "<string>",
"label": "<string>",
"chainId": 123,
"transactionHash": "<string>"
}
],
"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,
"destinationGas": {
"chainId": 123,
"totalGasLimit": 123,
"gasPrice": 123,
"nativeTokenSymbol": "<string>",
"totalFeeAmount": 123,
"totalFeeUsd": 123,
"metaTxnFeeDetails": {
"metaTxnId": "<string>",
"estimatedGasLimit": 123,
"feeNative": 123
},
"metaTxnGasQuote": "<string>",
"nativeTokenPriceUsd": 123
}
}
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
TheQuoteIntent endpoint allows you to request a quote for a cross-chain intent transaction. It provides comprehensive information about the transaction including gas fees, optimal routing, and price impact.
Use Cases
- Get a quote for swapping tokens across different chains
- Estimate fees before executing a cross-chain transaction
- Compare different routing options
- Calculate price impact and slippage
Request Parameters
Required Fields
- ownerAddress (string): The wallet address initiating the transaction
- originChainId (number): Source chain ID where the transaction originates
- originTokenAddress (string): Contract address of the source token
- destinationChainId (number): Target chain ID for the transaction
- destinationTokenAddress (string): Contract address of the destination token
- destinationToAddress (string): Recipient address on the destination chain
Optional Fields
- tradeType (TradeType): Either
EXACT_INPUTorEXACT_OUTPUT - destinationTokenAmount (bigint): Amount of destination tokens (only for EXACT_OUTPUT)
- originTokenAmount (bigint): Amount of origin tokens (only for EXACT_INPUT)
- destinationToAddress (string): Recipient address on the destination chain (defaults to
ownerAddress) - destinationApproveAddress (string): Contract address to pre-approve on the destination chain before executing
destinationCallData - destinationCallData (string): Custom calldata for contract interactions on destination chain
- destinationCallValue (number): Value (in wei) to send with the destination call
- fundMethod (FundMethod): Hint for the funding method —
WALLET,DIRECT_TRANSFER,ONRAMP_MESH, orONRAMP_MELD - onlyNativeGasFee (boolean): When
true, restricts gas fee options to the origin chain’s native token only - options (QuoteIntentRequestOptions):
- bridgeProvider (RouteProvider): Preferred bridge provider —
AUTO(default),RELAY,CCTP,LZ_OFT,SUSHI,ZEROX,LIFI,WETH - bridgeProviderFallback (boolean): If
true, fall back to another provider if the preferred bridge provider is unavailable - swapProvider (RouteProvider): Preferred same-chain swap provider —
AUTO(default),RELAY,SUSHI,ZEROX - swapProviderFallback (boolean): If
true, fall back to another provider if the preferred swap provider is unavailable - preference (RoutePreference): Route optimisation target —
RECOMMENDED(default),FASTEST,CHEAPEST,TRUSTLESS - intentProtocol (IntentProtocolVersion): Force a specific intent protocol version —
v1orv1_5 - slippageTolerance (number): Maximum acceptable slippage as a fraction of 1 (e.g.
0.005for 0.5%) - trailsAddressOverrides (TrailsAddressOverrides): Custom Sequence wallet addresses for the intent
- bridgeProvider (RouteProvider): Preferred bridge provider —
Response
The response includes:- intent (Intent): Complete intent object with transaction details
- gasFeeOptions (GasFeeOptions): Available gas fee payment options
Intent Object Details
The intent object contains:- Unique intent ID
- Transaction status
- Deposit transaction details
- Cross-chain calls to execute
- Quote information (rates, slippage, price impact)
- Fee breakdown (gas fees, provider fees)
- Expiration timestamp
Example
const quoteRequest = {
ownerAddress: "0x0709CF2d5D4f3D38f5948d697fE64d7FB3639Eb1",
originChainId: 1, // Ethereum
originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
originTokenAmount: 100000000, // 100 USDC (6 decimals)
destinationChainId: 8453, // Base
destinationTokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC on Base
destinationToAddress: "0x0709CF2d5D4f3D38f5948d697fE64d7FB3639Eb1",
tradeType: "EXACT_INPUT",
options: {
slippageTolerance: 0.005, // 0.5%
bridgeProvider: "RELAY"
}
};
const response = await fetch('https://trails-api.sequence.app/rpc/Trails/QuoteIntent', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-Access-Key': 'YOUR_ACCESS_KEY'
},
body: JSON.stringify(quoteRequest)
});
const quote = await response.json();
console.log('Quote:', quote);
Quote Expiration
Quotes expire 5 minutes after being issued. You must commit the intent using
CommitIntent before the quote expires, or you’ll need to request a new quote.Next Steps
After receiving a quote:- Review the quote details, fees, and estimated amounts
- Use
CommitIntentto commit the intent before the quote expires (5-minute window)
Body
application/json
Represented as string on the server side
Available options:
EXACT_INPUT, EXACT_OUTPUT Represented as string on the server side
Available options:
WALLET, DIRECT_TRANSFER, ONRAMP_MESH, ONRAMP_MELD, ONRAMP_BLUVO Represented as string on the server side
Available options:
SWAP, FUND, EARN, PAY, WITHDRAW Show child attributes
Show child attributes
Was this page helpful?
⌘I