cURL
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt \
--header 'Content-Type: application/json' \
--data '
{
"intentId": "<string>"
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt"
payload = { "intentId": "<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({intentId: '<string>'})
};
fetch('https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt', 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/GetIntentReceipt",
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([
'intentId' => '<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/GetIntentReceipt"
payload := strings.NewReader("{\n \"intentId\": \"<string>\"\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/GetIntentReceipt")
.header("Content-Type", "application/json")
.body("{\n \"intentId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt")
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 \"intentId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"intentReceipt": {
"id": 123,
"projectId": 123,
"intentId": "<string>",
"ownerAddress": "<string>",
"originChainId": 123,
"destinationChainId": 123,
"depositTransactionId": 123,
"depositTransaction": {
"id": 123,
"intentId": "<string>",
"chainId": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"tokenAddress": "<string>",
"tokenAmount": 123,
"statusReason": "<string>",
"bridgeGas": 123,
"calldata": "<string>",
"metaTxnId": "<string>",
"metaTxnFeeQuote": "<string>",
"precondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"depositIntentEntry": {
"feeAmount": "<string>",
"feeToken": "<string>",
"feeCollector": "<string>",
"deadline": 123,
"intentSignature": "<string>",
"permitSignature": "<string>",
"permitDeadline": 123,
"permitAmount": 123,
"userNonce": 123
},
"txnHash": "<string>",
"txnMinedAt": "<string>",
"updatedAt": "<string>",
"createdAt": "<string>",
"statusUpdatedAt": "<string>",
"eligibleAt": "<string>"
},
"originTransactionId": 123,
"originTransaction": {
"id": 123,
"intentId": "<string>",
"chainId": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"tokenAddress": "<string>",
"tokenAmount": 123,
"statusReason": "<string>",
"bridgeGas": 123,
"calldata": "<string>",
"metaTxnId": "<string>",
"metaTxnFeeQuote": "<string>",
"precondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"depositIntentEntry": {
"feeAmount": "<string>",
"feeToken": "<string>",
"feeCollector": "<string>",
"deadline": 123,
"intentSignature": "<string>",
"permitSignature": "<string>",
"permitDeadline": 123,
"permitAmount": 123,
"userNonce": 123
},
"txnHash": "<string>",
"txnMinedAt": "<string>",
"updatedAt": "<string>",
"createdAt": "<string>",
"statusUpdatedAt": "<string>",
"eligibleAt": "<string>"
},
"summary": {
"intentId": "<string>",
"ownerAddress": "<string>",
"originChainId": 123,
"destinationChainId": 123,
"routeProviders": [],
"originIntentAddress": "<string>",
"originTokenAddress": "<string>",
"originTokenAmount": 123,
"quotedOriginTokenAmount": 123,
"originTokenMetadata": {
"chainId": 123,
"tokenAddress": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"destinationIntentAddress": "<string>",
"destinationTokenMetadata": {
"chainId": 123,
"tokenAddress": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"destinationHasCallData": true,
"destinationHasCallValue": true,
"createdAt": "<string>",
"expiresAt": "<string>",
"destinationTokenAddress": "<string>",
"destinationTokenAmount": 123,
"quotedDestinationTokenAmount": 123,
"destinationToAddress": "<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>"
},
"memo": "<string>",
"startedAt": "<string>",
"finishedAt": "<string>"
},
"destinationTransactionId": 123,
"destinationTransaction": {
"id": 123,
"intentId": "<string>",
"chainId": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"tokenAddress": "<string>",
"tokenAmount": 123,
"statusReason": "<string>",
"bridgeGas": 123,
"calldata": "<string>",
"metaTxnId": "<string>",
"metaTxnFeeQuote": "<string>",
"precondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"depositIntentEntry": {
"feeAmount": "<string>",
"feeToken": "<string>",
"feeCollector": "<string>",
"deadline": 123,
"intentSignature": "<string>",
"permitSignature": "<string>",
"permitDeadline": 123,
"permitAmount": 123,
"userNonce": 123
},
"txnHash": "<string>",
"txnMinedAt": "<string>",
"updatedAt": "<string>",
"createdAt": "<string>",
"statusUpdatedAt": "<string>",
"eligibleAt": "<string>"
},
"refundTransactionId": 123,
"refundTransaction": {
"id": 123,
"intentId": "<string>",
"chainId": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"tokenAddress": "<string>",
"tokenAmount": 123,
"statusReason": "<string>",
"bridgeGas": 123,
"calldata": "<string>",
"metaTxnId": "<string>",
"metaTxnFeeQuote": "<string>",
"precondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"depositIntentEntry": {
"feeAmount": "<string>",
"feeToken": "<string>",
"feeCollector": "<string>",
"deadline": 123,
"intentSignature": "<string>",
"permitSignature": "<string>",
"permitDeadline": 123,
"permitAmount": 123,
"userNonce": 123
},
"txnHash": "<string>",
"txnMinedAt": "<string>",
"updatedAt": "<string>",
"createdAt": "<string>",
"statusUpdatedAt": "<string>",
"eligibleAt": "<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>"
},
"updatedAt": "<string>",
"createdAt": "<string>"
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Intents
GetIntentReceipt
POST
/
rpc
/
Trails
/
GetIntentReceipt
cURL
curl --request POST \
--url https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt \
--header 'Content-Type: application/json' \
--data '
{
"intentId": "<string>"
}
'import requests
url = "https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt"
payload = { "intentId": "<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({intentId: '<string>'})
};
fetch('https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt', 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/GetIntentReceipt",
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([
'intentId' => '<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/GetIntentReceipt"
payload := strings.NewReader("{\n \"intentId\": \"<string>\"\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/GetIntentReceipt")
.header("Content-Type", "application/json")
.body("{\n \"intentId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trails-api.sequence.app/rpc/Trails/GetIntentReceipt")
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 \"intentId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"intentReceipt": {
"id": 123,
"projectId": 123,
"intentId": "<string>",
"ownerAddress": "<string>",
"originChainId": 123,
"destinationChainId": 123,
"depositTransactionId": 123,
"depositTransaction": {
"id": 123,
"intentId": "<string>",
"chainId": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"tokenAddress": "<string>",
"tokenAmount": 123,
"statusReason": "<string>",
"bridgeGas": 123,
"calldata": "<string>",
"metaTxnId": "<string>",
"metaTxnFeeQuote": "<string>",
"precondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"depositIntentEntry": {
"feeAmount": "<string>",
"feeToken": "<string>",
"feeCollector": "<string>",
"deadline": 123,
"intentSignature": "<string>",
"permitSignature": "<string>",
"permitDeadline": 123,
"permitAmount": 123,
"userNonce": 123
},
"txnHash": "<string>",
"txnMinedAt": "<string>",
"updatedAt": "<string>",
"createdAt": "<string>",
"statusUpdatedAt": "<string>",
"eligibleAt": "<string>"
},
"originTransactionId": 123,
"originTransaction": {
"id": 123,
"intentId": "<string>",
"chainId": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"tokenAddress": "<string>",
"tokenAmount": 123,
"statusReason": "<string>",
"bridgeGas": 123,
"calldata": "<string>",
"metaTxnId": "<string>",
"metaTxnFeeQuote": "<string>",
"precondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"depositIntentEntry": {
"feeAmount": "<string>",
"feeToken": "<string>",
"feeCollector": "<string>",
"deadline": 123,
"intentSignature": "<string>",
"permitSignature": "<string>",
"permitDeadline": 123,
"permitAmount": 123,
"userNonce": 123
},
"txnHash": "<string>",
"txnMinedAt": "<string>",
"updatedAt": "<string>",
"createdAt": "<string>",
"statusUpdatedAt": "<string>",
"eligibleAt": "<string>"
},
"summary": {
"intentId": "<string>",
"ownerAddress": "<string>",
"originChainId": 123,
"destinationChainId": 123,
"routeProviders": [],
"originIntentAddress": "<string>",
"originTokenAddress": "<string>",
"originTokenAmount": 123,
"quotedOriginTokenAmount": 123,
"originTokenMetadata": {
"chainId": 123,
"tokenAddress": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"destinationIntentAddress": "<string>",
"destinationTokenMetadata": {
"chainId": 123,
"tokenAddress": "<string>",
"name": "<string>",
"symbol": "<string>",
"decimals": 123,
"logoUri": "<string>"
},
"destinationHasCallData": true,
"destinationHasCallValue": true,
"createdAt": "<string>",
"expiresAt": "<string>",
"destinationTokenAddress": "<string>",
"destinationTokenAmount": 123,
"quotedDestinationTokenAmount": 123,
"destinationToAddress": "<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>"
},
"memo": "<string>",
"startedAt": "<string>",
"finishedAt": "<string>"
},
"destinationTransactionId": 123,
"destinationTransaction": {
"id": 123,
"intentId": "<string>",
"chainId": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"tokenAddress": "<string>",
"tokenAmount": 123,
"statusReason": "<string>",
"bridgeGas": 123,
"calldata": "<string>",
"metaTxnId": "<string>",
"metaTxnFeeQuote": "<string>",
"precondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"depositIntentEntry": {
"feeAmount": "<string>",
"feeToken": "<string>",
"feeCollector": "<string>",
"deadline": 123,
"intentSignature": "<string>",
"permitSignature": "<string>",
"permitDeadline": 123,
"permitAmount": 123,
"userNonce": 123
},
"txnHash": "<string>",
"txnMinedAt": "<string>",
"updatedAt": "<string>",
"createdAt": "<string>",
"statusUpdatedAt": "<string>",
"eligibleAt": "<string>"
},
"refundTransactionId": 123,
"refundTransaction": {
"id": 123,
"intentId": "<string>",
"chainId": 123,
"fromAddress": "<string>",
"toAddress": "<string>",
"tokenAddress": "<string>",
"tokenAmount": 123,
"statusReason": "<string>",
"bridgeGas": 123,
"calldata": "<string>",
"metaTxnId": "<string>",
"metaTxnFeeQuote": "<string>",
"precondition": {
"type": "<string>",
"chainId": 123,
"ownerAddress": "<string>",
"tokenAddress": "<string>",
"minAmount": 123
},
"depositIntentEntry": {
"feeAmount": "<string>",
"feeToken": "<string>",
"feeCollector": "<string>",
"deadline": 123,
"intentSignature": "<string>",
"permitSignature": "<string>",
"permitDeadline": 123,
"permitAmount": 123,
"userNonce": 123
},
"txnHash": "<string>",
"txnMinedAt": "<string>",
"updatedAt": "<string>",
"createdAt": "<string>",
"statusUpdatedAt": "<string>",
"eligibleAt": "<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>"
},
"updatedAt": "<string>",
"createdAt": "<string>"
}
}{
"error": "WebrpcEndpoint",
"code": 0,
"msg": "endpoint error",
"status": 400,
"cause": "<string>"
}{
"error": "WebrpcBadResponse",
"code": -5,
"msg": "bad response",
"status": 500,
"cause": "<string>"
}Overview
TheGetIntentReceipt 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 statePENDING: Waiting to be minedRELAYING: Being relayedRELAYED: Relayed successfullyMINING: Being minedSUCCEEDED: Confirmed on-chainFAILED: 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:import { TrailsApi } from '@0xtrails/api'
const trailsApi = new TrailsApi('YOUR_API_KEY')
async function pollReceipt(intentId: string, maxAttempts = 60) {
for (let i = 0; i < maxAttempts; i++) {
const { intentReceipt } = await trailsApi.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);
Block Explorer Links
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 trailsApi.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
GetIntentto retrieve the original intent details - Use
SearchIntentsto find related transactions
Was this page helpful?
⌘I