Skip to main content
POST
/
rpc
/
Trails
/
GetIntentReceipt
{
  "intentReceipt": {
    "id": 123,
    "projectId": 123,
    "intentId": "<string>",
    "status": "QUOTED",
    "ownerAddress": "<string>",
    "originChainId": 123,
    "destinationChainId": 123,
    "depositTransactionId": 123,
    "depositTransaction": {
      "id": 123,
      "intentId": "<string>",
      "chainId": 123,
      "fromAddress": "<string>",
      "toAddress": "<string>",
      "tokenAddress": "<string>",
      "tokenAmount": 123,
      "calldata": "<string>",
      "metaTxnId": "<string>",
      "metaTxnFeeQuote": "<string>",
      "precondition": {
        "type": "<string>",
        "chainId": 123,
        "ownerAddress": "<string>",
        "tokenAddress": "<string>",
        "minAmount": 123
      },
      "depositIntentEntry": {
        "intentSignature": "<string>",
        "permitSignature": "<string>",
        "permitDeadline": 123,
        "permitAmount": 123,
        "feeAmount": "<string>",
        "feeToken": "<string>",
        "feeCollector": "<string>",
        "userNonce": 123,
        "deadline": 123
      },
      "txnHash": "<string>",
      "txnMinedAt": "<string>",
      "status": "UNKNOWN",
      "statusReason": "<string>",
      "updatedAt": "<string>",
      "createdAt": "<string>"
    },
    "originTransactionId": 123,
    "originTransaction": {
      "id": 123,
      "intentId": "<string>",
      "chainId": 123,
      "fromAddress": "<string>",
      "toAddress": "<string>",
      "tokenAddress": "<string>",
      "tokenAmount": 123,
      "calldata": "<string>",
      "metaTxnId": "<string>",
      "metaTxnFeeQuote": "<string>",
      "precondition": {
        "type": "<string>",
        "chainId": 123,
        "ownerAddress": "<string>",
        "tokenAddress": "<string>",
        "minAmount": 123
      },
      "depositIntentEntry": {
        "intentSignature": "<string>",
        "permitSignature": "<string>",
        "permitDeadline": 123,
        "permitAmount": 123,
        "feeAmount": "<string>",
        "feeToken": "<string>",
        "feeCollector": "<string>",
        "userNonce": 123,
        "deadline": 123
      },
      "txnHash": "<string>",
      "txnMinedAt": "<string>",
      "status": "UNKNOWN",
      "statusReason": "<string>",
      "updatedAt": "<string>",
      "createdAt": "<string>"
    },
    "destinationTransactionId": 123,
    "destinationTransaction": {
      "id": 123,
      "intentId": "<string>",
      "chainId": 123,
      "fromAddress": "<string>",
      "toAddress": "<string>",
      "tokenAddress": "<string>",
      "tokenAmount": 123,
      "calldata": "<string>",
      "metaTxnId": "<string>",
      "metaTxnFeeQuote": "<string>",
      "precondition": {
        "type": "<string>",
        "chainId": 123,
        "ownerAddress": "<string>",
        "tokenAddress": "<string>",
        "minAmount": 123
      },
      "depositIntentEntry": {
        "intentSignature": "<string>",
        "permitSignature": "<string>",
        "permitDeadline": 123,
        "permitAmount": 123,
        "feeAmount": "<string>",
        "feeToken": "<string>",
        "feeCollector": "<string>",
        "userNonce": 123,
        "deadline": 123
      },
      "txnHash": "<string>",
      "txnMinedAt": "<string>",
      "status": "UNKNOWN",
      "statusReason": "<string>",
      "updatedAt": "<string>",
      "createdAt": "<string>"
    },
    "updatedAt": "<string>",
    "createdAt": "<string>"
  }
}

Overview

The GetIntentReceipt endpoint retrieves the receipt for a specific intent, providing detailed information about all transactions involved in the cross-chain execution.

Use Cases

  • Check the status of an executing intent
  • Retrieve transaction hashes for block explorer links
  • Monitor cross-chain transaction progress
  • Get detailed transaction information for analytics
  • Verify successful completion

Request Parameters

Required Fields

  • intentId (string): The unique identifier of the intent

Response

The response includes:
  • intentReceipt (IntentReceipt): Complete receipt with transaction details

IntentReceipt Structure

  • id (number): Internal database ID
  • intentId (string): Unique intent identifier
  • status (IntentStatus): Current status (QUOTED, COMMITTED, EXECUTING, FAILED, SUCCEEDED)
  • ownerAddress (string): Wallet address that initiated the intent
  • originChainId (number): Source chain ID
  • destinationChainId (number): Destination chain ID
  • depositTransactionId (number): ID of deposit transaction
  • depositTransaction (IntentTransaction): Deposit transaction details
  • originTransactionId (number): ID of origin transaction
  • originTransaction (IntentTransaction): Origin chain transaction details
  • destinationTransactionId (number): ID of destination transaction
  • destinationTransaction (IntentTransaction): Destination chain transaction details
  • updatedAt (string): Last update timestamp
  • createdAt (string): Creation timestamp

IntentTransaction Details

Each transaction object includes:
  • id (number): Transaction database ID
  • intentId (string): Associated intent ID
  • chainId (number): Chain where transaction occurred
  • fromAddress (string): Sender address
  • toAddress (string): Recipient address
  • tokenAddress (string): Token contract address
  • tokenAmount (number): Amount transferred
  • txnHash (string): Transaction hash for block explorer
  • status (TransactionStatus): Transaction status
    • UNKNOWN: Initial state
    • PENDING: Waiting to be mined
    • RELAYING: Being relayed
    • RELAYED: Relayed successfully
    • MINING: Being mined
    • SUCCEEDED: Confirmed on-chain
    • FAILED: Transaction failed
  • statusReason (string): Reason for failure (if failed)
  • calldata (string): Transaction calldata
  • metaTxnId (string): Meta-transaction ID (if gasless)
  • precondition (TransactionPrecondition): Pre-execution conditions
  • depositIntentEntry (DepositIntentEntry): Deposit signature details

Example

const receiptResponse = await fetch('https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Access-Key': 'YOUR_ACCESS_KEY'
  },
  body: JSON.stringify({
    intentId: 'intent_123abc'
  })
});

const { intentReceipt } = await receiptResponse.json();

console.log('Status:', intentReceipt.status);
console.log('Deposit TX:', intentReceipt.depositTransaction.txnHash);
console.log('Origin TX:', intentReceipt.originTransaction.txnHash);
console.log('Destination TX:', intentReceipt.destinationTransaction.txnHash);

Polling Pattern

For real-time updates, poll this endpoint:
async function pollReceipt(intentId: string, maxAttempts = 60) {
  for (let i = 0; i < maxAttempts; i++) {
    const { intentReceipt } = await getIntentReceipt(intentId);
    
    console.log(`Attempt ${i + 1}: ${intentReceipt.status}`);
    
    if (intentReceipt.status === 'SUCCEEDED') {
      return intentReceipt;
    }
    
    if (intentReceipt.status === 'FAILED') {
      throw new Error(intentReceipt.originTransaction.statusReason);
    }
    
    // Wait 2 seconds before next poll
    await new Promise(resolve => setTimeout(resolve, 2000));
  }
  
  throw new Error('Timeout waiting for intent completion');
}

const receipt = await pollReceipt('intent_123abc');
console.log('Completed!', receipt);
Use transaction hashes to create explorer links:
function getExplorerUrl(chainId: number, txHash: string) {
  const explorers = {
    1: 'https://etherscan.io/tx/',
    137: 'https://polygonscan.com/tx/',
    8453: 'https://basescan.org/tx/',
    42161: 'https://arbiscan.io/tx/',
    10: 'https://optimistic.etherscan.io/tx/'
  };
  
  return explorers[chainId] + txHash;
}

const { intentReceipt } = await getIntentReceipt(intentId);
console.log('Origin TX:', getExplorerUrl(
  intentReceipt.originChainId,
  intentReceipt.originTransaction.txnHash
));
For streaming updates without polling, consider using WaitIntentReceipt instead.

Next Steps

  • Use transaction hashes to verify on block explorers
  • Check destination wallet balance to confirm receipt
  • Use GetIntent to retrieve the original intent details
  • Use SearchIntents to find related transactions

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
intentId
string
required

Response

Successful response

intentReceipt
object
required