Skip to main content
POST
/
rpc
/
Trails
/
QuoteIntent
{
  "intent": {
    "id": 123,
    "projectId": 123,
    "intentId": "<string>",
    "status": "QUOTED",
    "quoteRequest": {
      "ownerAddress": "<string>",
      "originChainId": 123,
      "originTokenAddress": "<string>",
      "destinationChainId": 123,
      "destinationTokenAddress": "<string>",
      "destinationToAddress": "<string>",
      "destinationCallData": "<string>",
      "destinationCallValue": "<string>",
      "originTokenAmount": 123,
      "destinationTokenAmount": 123,
      "tradeType": "EXACT_INPUT",
      "options": {
        "quoteProvider": "RELAY",
        "slippageTolerance": 123,
        "trailsAddressOverrides": {
          "sequenceWalletFactoryAddress": "<string>",
          "sequenceWalletMainModuleAddress": "<string>",
          "sequenceWalletMainModuleUpgradableAddress": "<string>",
          "sequenceWalletGuestModuleAddress": "<string>",
          "sequenceWalletUtilsAddress": "<string>"
        }
      }
    },
    "ownerAddress": "<string>",
    "originIntentAddress": "<string>",
    "destinationIntentAddress": "<string>",
    "destinationSalt": 123,
    "depositTransaction": {
      "toAddress": "<string>",
      "tokenAddress": "<string>",
      "decimals": 123,
      "amount": 123
    },
    "calls": [
      {
        "chainId": 123,
        "space": 123,
        "nonce": 123,
        "calls": [
          {
            "to": "<string>",
            "value": 123,
            "data": "<string>",
            "gasLimit": 123,
            "delegateCall": true,
            "onlyFallback": true,
            "behaviorOnError": 123
          }
        ]
      }
    ],
    "preconditions": [
      {
        "type": "<string>",
        "chainId": 123,
        "ownerAddress": "<string>",
        "tokenAddress": "<string>",
        "minAmount": 123
      }
    ],
    "metaTxns": [
      {
        "id": "<string>",
        "chainId": 123,
        "walletAddress": "<string>",
        "contract": "<string>",
        "input": "<string>"
      }
    ],
    "quote": {
      "quoteProvider": "<string>",
      "quoteProviderRequestId": "<string>",
      "quoteProviderFeeUsd": 123,
      "fromAmount": 123,
      "fromAmountMin": 123,
      "toAmount": 123,
      "toAmountMin": 123,
      "maxSlippage": 123,
      "priceImpact": 123,
      "priceImpactUsd": 123
    },
    "fees": {
      "originGas": {
        "chainId": 123,
        "totalGasLimit": 123,
        "gasPrice": 123,
        "nativeTokenSymbol": "<string>",
        "nativeTokenPriceUsd": 123,
        "chainGasUsageStatus": "NORMAL",
        "totalFeeAmount": 123,
        "totalFeeUsd": "<string>",
        "metaTxnFeeDetails": {
          "metaTxnId": "<string>",
          "estimatedGasLimit": 123,
          "feeNative": 123
        },
        "metaTxnGasQuote": "<string>"
      },
      "destinationGas": {
        "chainId": 123,
        "totalGasLimit": 123,
        "gasPrice": 123,
        "nativeTokenSymbol": "<string>",
        "nativeTokenPriceUsd": 123,
        "chainGasUsageStatus": "NORMAL",
        "totalFeeAmount": 123,
        "totalFeeUsd": "<string>",
        "metaTxnFeeDetails": {
          "metaTxnId": "<string>",
          "estimatedGasLimit": 123,
          "feeNative": 123
        },
        "metaTxnGasQuote": "<string>"
      },
      "provider": {
        "quoteProvider": "<string>",
        "quoteProviderFee": 123,
        "quoteProviderFeeUsd": 123,
        "trailsFee": 123,
        "trailsFeeUsd": 123,
        "totalFeeAmount": 123,
        "totalFeeUsd": 123
      },
      "feeTokenAddress": "<string>",
      "feeTokenTotal": 123,
      "totalFeeAmount": 123,
      "totalFeeUsd": 123
    },
    "trailsVersion": "<string>",
    "expiresAt": "<string>",
    "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>"
      }
    ],
    "expiresAt": "<string>",
    "feeCollectorAddress": "<string>"
  }
}

Overview

The QuoteIntent 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_INPUT or EXACT_OUTPUT
  • destinationTokenAmount (number): Amount of destination tokens (only for EXACT_OUTPUT)
  • originTokenAmount (number): Amount of origin tokens (only for EXACT_INPUT)
  • destinationCallData (string): Custom calldata for contract interactions on destination chain
  • destinationCallValue (string): Value to send with the destination call
  • options (QuoteIntentRequestOptions):
    • quoteProvider (QuoteProviderType): Preferred quote provider (RELAY, CCTPV2, or LIFI)
    • slippageTolerance (number): Maximum acceptable slippage percentage
    • trailsAddressOverrides (TrailsAddressOverrides): Custom Sequence wallet addresses

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: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  originChainId: 1, // Ethereum
  originTokenAddress: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48", // USDC
  originTokenAmount: 100000000, // 100 USDC (6 decimals)
  destinationChainId: 8453, // Base
  destinationTokenAddress: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913", // USDC on Base
  destinationToAddress: "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  tradeType: "EXACT_INPUT",
  options: {
    slippageTolerance: 0.5, // 0.5%
    quoteProvider: "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);

Next Steps

After receiving a quote:
  1. Review the quote details, fees, and estimated amounts
  2. Use CommitIntent to commit the intent if the quote is acceptable

Authorizations

X-Access-Key
string
header
required

API Key for authenticating requests, get an access key at https://trails.build and request early access

Body

application/json
ownerAddress
string
required
originChainId
number
required
originTokenAddress
string
required
destinationChainId
number
required
destinationTokenAddress
string
required
destinationToAddress
string
required
destinationCallData
string
destinationCallValue
string
originTokenAmount
number
destinationTokenAmount
number
tradeType
enum<string>

Represented as string on the server side

Available options:
EXACT_INPUT,
EXACT_OUTPUT
options
object

Response

Successful response

intent
object
required
gasFeeOptions
object
required