cURL
Intents
GetIntentHistory
POST
cURL
Documentation Index
Fetch the complete documentation index at: https://docs.trails.build/llms.txt
Use this file to discover all available pages before exploring further.
Overview
TheGetIntentHistory endpoint provides a paginated view of intent history with detailed receipt information. This endpoint returns full IntentHistory objects that include the complete IntentReceipt for each intent, giving you comprehensive transaction data including status, timestamps, and transaction hashes.
Use Cases
- Build comprehensive transaction history pages with full receipt details
- Display user transaction history with complete status information
- Create audit logs with detailed transaction information
- Export complete transaction data for analytics
- Build dashboards with full intent lifecycle visibility
Request Parameters
All parameters are optional:- page (Page): Pagination configuration
- column (string): Column to paginate by (typically
"id"or"createdAt") - before (number): Cursor for previous page
- after (number): Cursor for next page
- sort (SortBy[]): Sorting configuration
- column (string): Column to sort by
- order (SortOrder):
DESCorASC
- pageSize (number): Number of results per page (default: 20)
- more (boolean): Indicates if more pages are available
- column (string): Column to paginate by (typically
- byProjectId (number): Filter by project ID
- byOwnerAddress (string): Filter by wallet address
- byStatus (IntentStatus): Filter to a single status
- byStatuses (IntentStatus[]): Filter to multiple statuses (takes precedence over
byStatus) - originChainId (number): Filter by origin (source) chain ID
- destinationChainId (number): Filter by destination chain ID
- fromTime (number): Unix timestamp — return only intents created at or after this time
- toTime (number): Unix timestamp — return only intents created at or before this time
- includeBalances (boolean): When
true, augment each history entry with on-chain balance data for the intent-relevant tokens - onlyRecoverable (boolean): When
true, return only intents that have recoverable (stuck) balances
Response
The response includes:- intents (IntentHistory[]): Array of intent history objects with receipts
- nextPage (Page): Pagination cursor for the next page
IntentHistory Structure
EachIntentHistory object contains:
- intentId (string): Unique intent identifier
- status (IntentStatus): Current status (
QUOTED,COMMITTED,EXECUTING,FAILED,SUCCEEDED,ABORTED,REFUNDED,INVALID) - expiresAt (string): Intent expiration timestamp
- updatedAt (string): Last update timestamp
- createdAt (string): Creation timestamp
- receipt (IntentReceipt): Complete receipt with transaction details
IntentReceipt Details
The receipt object includes comprehensive transaction information:- id (number): Internal database ID
- intentId (string): Unique intent identifier
- status (IntentStatus): Current status
- ownerAddress (string): Wallet address that initiated the intent
- originChainId (number): Source chain ID
- destinationChainId (number): Destination chain ID
- depositTransaction (IntentTransaction): Deposit transaction details
- originTransaction (IntentTransaction): Origin chain transaction details
- destinationTransaction (IntentTransaction): Destination chain transaction details
- summary (IntentReceiptSummary): Summary with token metadata and route providers
Examples
Basic Request (First Page)
Filter by Owner Address
Paginated Loading with Full Receipts
Transaction History Component with Receipts
Analyze Intent History
GetIntentHistory provides comprehensive transaction data including full receipt details, transaction hashes, and token metadata. It’s ideal for building detailed transaction history views, audit logs, and analytics dashboards.Best Practices
- Use appropriate page sizes: Since responses include full receipts, use smaller page sizes (10-30) to reduce payload size
- Cache results: Store intent history locally to avoid refetching
- Filter by owner address: Always filter by owner address when possible to reduce result set
- Handle all status types: Account for
ABORTEDandREFUNDEDstatuses in addition toSUCCEEDEDandFAILED
Next Steps
- Use
GetIntentto fetch the full intent object (not just receipt) when needed - Use
GetIntentReceiptfor single intent receipt lookups - Use
SearchIntentsto find intents by various criteria
Body
application/json
Represented as uint8 on the server side
Available options:
QUOTED, COMMITTED, EXECUTING, FAILED, SUCCEEDED, ABORTED, REFUNDED, INVALID []IntentStatus
Represented as uint8 on the server side
Available options:
QUOTED, COMMITTED, EXECUTING, FAILED, SUCCEEDED, ABORTED, REFUNDED, INVALID