> ## Documentation Index
> Fetch the complete documentation index at: https://anypay-docs-update-resources-2026-06-29.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# GetIntentHistory

## Overview

The `GetIntentHistory` 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): `DESC` or `ASC`
  * **pageSize** (number): Number of results per page (default: 20)
  * **more** (boolean): Indicates if more pages are available
* **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

Each `IntentHistory` 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)

```typescript theme={null}
const historyResponse = await fetch(
    'https://trails-api.sequence.app/rpc/Trails/GetIntentHistory',
    {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'X-Access-Key': 'YOUR_ACCESS_KEY'
        },
        body: JSON.stringify({
            page: {
                pageSize: 20,
                sort: [{
                    column: 'createdAt',
                    order: 'DESC'
                }]
            }
        })
    }
);

const { intents, nextPage } = await historyResponse.json();

console.log(`Loaded ${intents.length} intents with receipts`);
intents.forEach(intent => {
    console.log(`${intent.intentId}: ${intent.status}`);
    console.log(`  Receipt status: ${intent.receipt.status}`);
    console.log(`  Origin TX: ${intent.receipt.originTransaction?.txnHash}`);
    console.log(`  Destination TX: ${intent.receipt.destinationTransaction?.txnHash}`);
});

// Check if there are more pages
if (nextPage) {
    console.log('More pages available');
}
```

### Filter by Owner Address

```typescript theme={null}
const historyResponse = await fetch(
    'https://trails-api.sequence.app/rpc/Trails/GetIntentHistory',
    {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'X-Access-Key': 'YOUR_ACCESS_KEY'
        },
        body: JSON.stringify({
            byOwnerAddress: '0x0709CF2d5D4f3D38f5948d697fE64d7FB3639Eb1',
            page: {
                pageSize: 50,
                sort: [{ column: 'createdAt', order: 'DESC' }]
            }
        })
    }
);

const { intents } = await historyResponse.json();
console.log(`Found ${intents.length} intents for this address`);
```

### Paginated Loading with Full Receipts

```typescript theme={null}
import { SortOrder, type IntentHistory, type Page } from "@0xtrails/api";

async function loadAllHistoryWithReceipts(ownerAddress: string) {
    const allIntents: IntentHistory[] = [];
    let page: Page | undefined = {
        pageSize: 50,
        sort: [{ column: 'createdAt', order: SortOrder.DESC }]
    };

    while (page) {
        const { intents, nextPage }: { intents: IntentHistory[], nextPage: Page } = await fetch(
            'https://trails-api.sequence.app/rpc/Trails/GetIntentHistory',
            {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    'X-Access-Key': 'YOUR_ACCESS_KEY'
                },
                body: JSON.stringify({ 
                    byOwnerAddress: ownerAddress,
                    page 
                })
            }
        ).then(r => r.json());

        allIntents.push(...intents);
        page = nextPage;

        console.log(`Loaded ${allIntents.length} intents so far...`);
    }

    return allIntents;
}

const allHistory = await loadAllHistoryWithReceipts('0x0709CF2d5D4f3D38f5948d697fE64d7FB3639Eb1');
console.log(`Total intents: ${allHistory.length}`);
```

### Transaction History Component with Receipts

```tsx theme={null}
import { SortOrder, type IntentHistory, type Page } from '@0xtrails/api';
import { useState, useEffect } from 'react';

function getExplorerUrl(chainId: number, txHash: string) {
    const explorers: Record<number, string> = {
        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;
}

export const IntentHistoryWithReceipts = ({ ownerAddress }: { ownerAddress: string }) => {
    const [intents, setIntents] = useState<IntentHistory[]>([]);
    const [loading, setLoading] = useState(true);

    useEffect(() => {
        async function loadHistory() {
            try {
                const response = await fetch(
                    'https://trails-api.sequence.app/rpc/Trails/GetIntentHistory',
                    {
                        method: 'POST',
                        headers: {
                            'Content-Type': 'application/json',
                            'X-Access-Key': 'YOUR_ACCESS_KEY'
                        },
                        body: JSON.stringify({
                            byOwnerAddress: ownerAddress,
                            page: {
                                pageSize: 20,
                                sort: [{ column: 'createdAt', order: SortOrder.DESC }]
                            }
                        })
                    }
                );

                const data = await response.json();
                setIntents(data.intents);
            } catch (error) {
                console.error('Failed to load intent history:', error);
            } finally {
                setLoading(false);
            }
        }

        loadHistory();
    }, [ownerAddress]);

    if (loading) return <div>Loading...</div>;

    return (
        <div className="intent-history">
            <h2>Transaction History</h2>

            {intents.length === 0 ? (
                <p>No transactions found</p>
            ) : (
                <ul>
                    {intents.map(intent => (
                        <li key={intent.intentId}>
                            <div>
                                <strong>{intent.intentId.slice(0, 12)}...</strong>
                                <span className={`status-${intent.status.toLowerCase()}`}>
                                    {intent.status}
                                </span>
                            </div>
                            <div>
                                Chain {intent.receipt.originChainId} → Chain {intent.receipt.destinationChainId}
                            </div>
                            {intent.receipt.summary && (
                                <div>
                                    {intent.receipt.summary.originTokenMetadata?.symbol} →{' '}
                                    {intent.receipt.summary.destinationTokenMetadata?.symbol}
                                </div>
                            )}
                            <div>
                                {new Date(intent.createdAt || '').toLocaleString()}
                            </div>
                            <div className="transaction-links">
                                {intent.receipt.originTransaction?.txnHash && (
                                    <a 
                                        href={getExplorerUrl(intent.receipt.originChainId, intent.receipt.originTransaction.txnHash)}
                                        target="_blank" 
                                        rel="noopener noreferrer"
                                    >
                                        View Origin TX
                                    </a>
                                )}
                                {intent.receipt.destinationTransaction?.txnHash && (
                                    <a 
                                        href={getExplorerUrl(intent.receipt.destinationChainId, intent.receipt.destinationTransaction.txnHash)}
                                        target="_blank" 
                                        rel="noopener noreferrer"
                                    >
                                        View Destination TX
                                    </a>
                                )}
                            </div>
                        </li>
                    ))}
                </ul>
            )}
        </div>
    );
}
```

### Analyze Intent History

```typescript theme={null}
import { TrailsApi, type IntentHistory } from '@0xtrails/api'

const trailsApi = new TrailsApi('YOUR_API_KEY')

async function analyzeIntentHistory(ownerAddress: string) {
    const { intents } = await trailsApi.getIntentHistory({ 
        byOwnerAddress: ownerAddress,
        page: { pageSize: 100 }
    });

    const stats = {
        total: intents.length,
        succeeded: intents.filter((i: IntentHistory) => i.status === 'SUCCEEDED').length,
        failed: intents.filter((i: IntentHistory) => i.status === 'FAILED').length,
        aborted: intents.filter((i: IntentHistory) => i.status === 'ABORTED').length,
        refunded: intents.filter((i: IntentHistory) => i.status === 'REFUNDED').length,
        pending: intents.filter((i: IntentHistory) =>
            ['QUOTED', 'COMMITTED', 'EXECUTING'].includes(i.status)
        ).length,
        chains: [...new Set(intents.flatMap((i: IntentHistory) =>
            [i.receipt.originChainId, i.receipt.destinationChainId]
        ))],
        routeProviders: [...new Set(intents.flatMap((i: IntentHistory) => 
            i.receipt.summary?.routeProviders || []
        ))]
    };

    return stats;
}

const stats = await analyzeIntentHistory('0x0709CF2d5D4f3D38f5948d697fE64d7FB3639Eb1');
console.log('Intent History Analysis:', stats);
```

<Info>
  `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.
</Info>

## Best Practices

1. **Use appropriate page sizes**: Since responses include full receipts, use smaller page sizes (10-30) to reduce payload size
2. **Cache results**: Store intent history locally to avoid refetching
3. **Filter by owner address**: Always filter by owner address when possible to reduce result set
4. **Handle all status types**: Account for `ABORTED` and `REFUNDED` statuses in addition to `SUCCEEDED` and `FAILED`

<Warning>
  Always handle the case where `nextPage` is `null`, indicating no more results are available.
</Warning>

## Next Steps

* Use `GetIntent` to fetch the full intent object (not just receipt) when needed
* Use `GetIntentReceipt` for single intent receipt lookups
* Use `SearchIntents` to find intents by various criteria


## OpenAPI

````yaml trails-api.gen.json post /rpc/Trails/GetIntentHistory
openapi: 3.0.0
info:
  title: Trails API
  version: 0.0.1
servers:
  - url: https://trails-api.sequence.app
    description: Trails API
security: []
paths:
  /rpc/Trails/GetIntentHistory:
    post:
      tags:
        - Trails
      operationId: Trails-GetIntentHistory
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetIntentHistoryRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetIntentHistoryResponse'
        4XX:
          description: Client error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorWebrpcEndpoint'
                  - $ref: '#/components/schemas/ErrorWebrpcRequestFailed'
                  - $ref: '#/components/schemas/ErrorWebrpcBadRoute'
                  - $ref: '#/components/schemas/ErrorWebrpcBadMethod'
                  - $ref: '#/components/schemas/ErrorWebrpcBadRequest'
                  - $ref: '#/components/schemas/ErrorWebrpcClientAborted'
                  - $ref: '#/components/schemas/ErrorWebrpcStreamLost'
                  - $ref: '#/components/schemas/ErrorUnauthorized'
                  - $ref: '#/components/schemas/ErrorPermissionDenied'
                  - $ref: '#/components/schemas/ErrorSessionExpired'
                  - $ref: '#/components/schemas/ErrorMethodNotFound'
                  - $ref: '#/components/schemas/ErrorRequestConflict'
                  - $ref: '#/components/schemas/ErrorAborted'
                  - $ref: '#/components/schemas/ErrorGeoblocked'
                  - $ref: '#/components/schemas/ErrorRateLimited'
                  - $ref: '#/components/schemas/ErrorProjectNotFound'
                  - $ref: '#/components/schemas/ErrorAccessKeyNotFound'
                  - $ref: '#/components/schemas/ErrorAccessKeyMismatch'
                  - $ref: '#/components/schemas/ErrorInvalidOrigin'
                  - $ref: '#/components/schemas/ErrorInvalidService'
                  - $ref: '#/components/schemas/ErrorUnauthorizedUser'
                  - $ref: '#/components/schemas/ErrorQuotaExceeded'
                  - $ref: '#/components/schemas/ErrorQuotaRateLimit'
                  - $ref: '#/components/schemas/ErrorNoDefaultKey'
                  - $ref: '#/components/schemas/ErrorMaxAccessKeys'
                  - $ref: '#/components/schemas/ErrorAtLeastOneKey'
                  - $ref: '#/components/schemas/ErrorTimeout'
                  - $ref: '#/components/schemas/ErrorInvalidArgument'
                  - $ref: '#/components/schemas/ErrorUnavailable'
                  - $ref: '#/components/schemas/ErrorQueryFailed'
                  - $ref: '#/components/schemas/ErrorIntentStatus'
                  - $ref: '#/components/schemas/ErrorNotFound'
                  - $ref: '#/components/schemas/ErrorUnsupportedNetwork'
                  - $ref: '#/components/schemas/ErrorClientOutdated'
                  - $ref: '#/components/schemas/ErrorIntentsSkipped'
                  - $ref: '#/components/schemas/ErrorQuoteExpired'
                  - $ref: '#/components/schemas/ErrorHighPriceImpact'
                  - $ref: '#/components/schemas/ErrorIntentsDisabled'
        5XX:
          description: Server error
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorWebrpcBadResponse'
                  - $ref: '#/components/schemas/ErrorWebrpcServerPanic'
                  - $ref: '#/components/schemas/ErrorWebrpcInternalError'
                  - $ref: '#/components/schemas/ErrorUnexpected'
                  - $ref: '#/components/schemas/ErrorChainNodeHealth'
components:
  schemas:
    GetIntentHistoryRequest:
      type: object
      properties:
        page:
          $ref: '#/components/schemas/Page'
        byProjectId:
          type: number
        byOwnerAddress:
          type: string
        originChainId:
          type: number
        destinationChainId:
          type: number
        fromTime:
          type: number
        toTime:
          type: number
        includeBalances:
          type: boolean
        onlyRecoverable:
          type: boolean
        byStatus:
          $ref: '#/components/schemas/IntentStatus'
        byStatuses:
          type: array
          description: '[]IntentStatus'
          items:
            $ref: '#/components/schemas/IntentStatus'
    GetIntentHistoryResponse:
      type: object
      required:
        - intents
      properties:
        intents:
          type: array
          description: '[]IntentHistory'
          items:
            $ref: '#/components/schemas/IntentHistory'
        nextPage:
          $ref: '#/components/schemas/Page'
    ErrorWebrpcEndpoint:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcEndpoint
        code:
          type: number
          example: 0
        msg:
          type: string
          example: endpoint error
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcRequestFailed:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcRequestFailed
        code:
          type: number
          example: -1
        msg:
          type: string
          example: request failed
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcBadRoute:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadRoute
        code:
          type: number
          example: -2
        msg:
          type: string
          example: bad route
        cause:
          type: string
        status:
          type: number
          example: 404
    ErrorWebrpcBadMethod:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadMethod
        code:
          type: number
          example: -3
        msg:
          type: string
          example: bad method
        cause:
          type: string
        status:
          type: number
          example: 405
    ErrorWebrpcBadRequest:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadRequest
        code:
          type: number
          example: -4
        msg:
          type: string
          example: bad request
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcClientAborted:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcClientAborted
        code:
          type: number
          example: -8
        msg:
          type: string
          example: request aborted by client
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcStreamLost:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcStreamLost
        code:
          type: number
          example: -9
        msg:
          type: string
          example: stream lost
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorUnauthorized:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Unauthorized
        code:
          type: number
          example: 1000
        msg:
          type: string
          example: Unauthorized access
        cause:
          type: string
        status:
          type: number
          example: 401
    ErrorPermissionDenied:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: PermissionDenied
        code:
          type: number
          example: 1001
        msg:
          type: string
          example: Permission denied
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorSessionExpired:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: SessionExpired
        code:
          type: number
          example: 1002
        msg:
          type: string
          example: Session expired
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorMethodNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: MethodNotFound
        code:
          type: number
          example: 1003
        msg:
          type: string
          example: Method not found
        cause:
          type: string
        status:
          type: number
          example: 404
    ErrorRequestConflict:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: RequestConflict
        code:
          type: number
          example: 1004
        msg:
          type: string
          example: Conflict with target resource
        cause:
          type: string
        status:
          type: number
          example: 409
    ErrorAborted:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Aborted
        code:
          type: number
          example: 1005
        msg:
          type: string
          example: Request aborted
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorGeoblocked:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Geoblocked
        code:
          type: number
          example: 1006
        msg:
          type: string
          example: Geoblocked region
        cause:
          type: string
        status:
          type: number
          example: 451
    ErrorRateLimited:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: RateLimited
        code:
          type: number
          example: 1007
        msg:
          type: string
          example: Rate-limited. Please slow down.
        cause:
          type: string
        status:
          type: number
          example: 429
    ErrorProjectNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: ProjectNotFound
        code:
          type: number
          example: 1008
        msg:
          type: string
          example: Project not found
        cause:
          type: string
        status:
          type: number
          example: 401
    ErrorAccessKeyNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: AccessKeyNotFound
        code:
          type: number
          example: 1101
        msg:
          type: string
          example: Access key not found
        cause:
          type: string
        status:
          type: number
          example: 401
    ErrorAccessKeyMismatch:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: AccessKeyMismatch
        code:
          type: number
          example: 1102
        msg:
          type: string
          example: Access key mismatch
        cause:
          type: string
        status:
          type: number
          example: 409
    ErrorInvalidOrigin:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: InvalidOrigin
        code:
          type: number
          example: 1103
        msg:
          type: string
          example: Invalid origin for Access Key
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorInvalidService:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: InvalidService
        code:
          type: number
          example: 1104
        msg:
          type: string
          example: Service not enabled for Access key
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorUnauthorizedUser:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: UnauthorizedUser
        code:
          type: number
          example: 1105
        msg:
          type: string
          example: Unauthorized user
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorQuotaExceeded:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: QuotaExceeded
        code:
          type: number
          example: 1200
        msg:
          type: string
          example: Quota request exceeded
        cause:
          type: string
        status:
          type: number
          example: 429
    ErrorQuotaRateLimit:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: QuotaRateLimit
        code:
          type: number
          example: 1201
        msg:
          type: string
          example: Quota rate limit exceeded
        cause:
          type: string
        status:
          type: number
          example: 429
    ErrorNoDefaultKey:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: NoDefaultKey
        code:
          type: number
          example: 1300
        msg:
          type: string
          example: No default access key found
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorMaxAccessKeys:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: MaxAccessKeys
        code:
          type: number
          example: 1301
        msg:
          type: string
          example: Access keys limit reached
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorAtLeastOneKey:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: AtLeastOneKey
        code:
          type: number
          example: 1302
        msg:
          type: string
          example: You need at least one Access Key
        cause:
          type: string
        status:
          type: number
          example: 403
    ErrorTimeout:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Timeout
        code:
          type: number
          example: 1900
        msg:
          type: string
          example: Request timed out
        cause:
          type: string
        status:
          type: number
          example: 408
    ErrorInvalidArgument:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: InvalidArgument
        code:
          type: number
          example: 2000
        msg:
          type: string
          example: Invalid argument
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorUnavailable:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Unavailable
        code:
          type: number
          example: 2002
        msg:
          type: string
          example: Unavailable resource
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorQueryFailed:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: QueryFailed
        code:
          type: number
          example: 2003
        msg:
          type: string
          example: Query failed
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorIntentStatus:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: IntentStatus
        code:
          type: number
          example: 2004
        msg:
          type: string
          example: Invalid intent status
        cause:
          type: string
        status:
          type: number
          example: 422
    ErrorNotFound:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: NotFound
        code:
          type: number
          example: 8000
        msg:
          type: string
          example: Resource not found
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorUnsupportedNetwork:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: UnsupportedNetwork
        code:
          type: number
          example: 8008
        msg:
          type: string
          example: Unsupported network
        cause:
          type: string
        status:
          type: number
          example: 422
    ErrorClientOutdated:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: ClientOutdated
        code:
          type: number
          example: 8009
        msg:
          type: string
          example: Client is outdated
        cause:
          type: string
        status:
          type: number
          example: 422
    ErrorIntentsSkipped:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: IntentsSkipped
        code:
          type: number
          example: 7000
        msg:
          type: string
          example: >-
            Intents skipped as client is attempting a transaction that does not
            require intents
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorQuoteExpired:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: QuoteExpired
        code:
          type: number
          example: 7001
        msg:
          type: string
          example: Intent quote has expired. Please try again.
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorHighPriceImpact:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: HighPriceImpact
        code:
          type: number
          example: 7002
        msg:
          type: string
          example: Quote unavailable due to high price impact
        cause:
          type: string
        status:
          type: number
          example: 422
    ErrorIntentsDisabled:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: IntentsDisabled
        code:
          type: number
          example: 9000
        msg:
          type: string
          example: Intents service is currently unavailable
        cause:
          type: string
        status:
          type: number
          example: 400
    ErrorWebrpcBadResponse:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcBadResponse
        code:
          type: number
          example: -5
        msg:
          type: string
          example: bad response
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorWebrpcServerPanic:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcServerPanic
        code:
          type: number
          example: -6
        msg:
          type: string
          example: server panic
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorWebrpcInternalError:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: WebrpcInternalError
        code:
          type: number
          example: -7
        msg:
          type: string
          example: internal error
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorUnexpected:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: Unexpected
        code:
          type: number
          example: 2001
        msg:
          type: string
          example: Unexpected server error
        cause:
          type: string
        status:
          type: number
          example: 500
    ErrorChainNodeHealth:
      type: object
      required:
        - error
        - code
        - msg
        - status
      properties:
        error:
          type: string
          example: ChainNodeHealth
        code:
          type: number
          example: 9001
        msg:
          type: string
          example: Intent quote is unavailable due to interrupted chain node access
        cause:
          type: string
        status:
          type: number
          example: 503
    Page:
      type: object
      properties:
        column:
          type: string
        before:
          type: number
        after:
          type: number
        sort:
          type: array
          description: '[]SortBy'
          items:
            $ref: '#/components/schemas/SortBy'
        pageSize:
          type: number
        more:
          type: boolean
    IntentStatus:
      type: string
      description: Represented as uint8 on the server side
      enum:
        - QUOTED
        - COMMITTED
        - EXECUTING
        - FAILED
        - SUCCEEDED
        - ABORTED
        - REFUNDED
        - INVALID
    IntentHistory:
      type: object
      required:
        - intentId
        - status
        - expiresAt
        - receipt
      properties:
        intentId:
          type: string
        status:
          $ref: '#/components/schemas/IntentStatus'
        expiresAt:
          type: string
        updatedAt:
          type: string
        createdAt:
          type: string
        receipt:
          $ref: '#/components/schemas/IntentReceipt'
        hasBalance:
          type: boolean
        balances:
          type: array
          description: '[]IntentAddressBalance'
          items:
            $ref: '#/components/schemas/IntentAddressBalance'
    SortBy:
      type: object
      required:
        - column
        - order
      properties:
        column:
          type: string
        order:
          $ref: '#/components/schemas/SortOrder'
    IntentReceipt:
      type: object
      required:
        - id
        - projectId
        - intentId
        - status
        - ownerAddress
        - originChainId
        - destinationChainId
        - depositTransactionId
        - depositTransaction
        - originTransactionId
        - originTransaction
        - summary
      properties:
        id:
          type: number
        projectId:
          type: number
        intentId:
          type: string
        status:
          $ref: '#/components/schemas/IntentStatus'
        ownerAddress:
          type: string
        originChainId:
          type: number
        destinationChainId:
          type: number
        depositTransactionId:
          type: number
        depositTransaction:
          $ref: '#/components/schemas/IntentTransaction'
        originTransactionId:
          type: number
        originTransaction:
          $ref: '#/components/schemas/IntentTransaction'
        destinationTransactionId:
          type: number
        destinationTransaction:
          $ref: '#/components/schemas/IntentTransaction'
        refundTransactionId:
          type: number
        refundTransaction:
          $ref: '#/components/schemas/IntentTransaction'
        summary:
          $ref: '#/components/schemas/IntentReceiptSummary'
        updatedAt:
          type: string
        createdAt:
          type: string
    IntentAddressBalance:
      type: object
      required:
        - intentAddress
        - chainId
        - tokens
      properties:
        intentAddress:
          type: string
        chainId:
          type: number
        tokens:
          type: array
          description: '[]IntentTokenBalance'
          items:
            $ref: '#/components/schemas/IntentTokenBalance'
    SortOrder:
      type: string
      description: Represented as uint32 on the server side
      enum:
        - DESC
        - ASC
    IntentTransaction:
      type: object
      required:
        - id
        - intentId
        - status
        - chainId
        - type
        - context
        - fromAddress
        - toAddress
        - tokenAddress
        - tokenAmount
      properties:
        id:
          type: number
        intentId:
          type: string
        status:
          $ref: '#/components/schemas/TransactionStatus'
        statusReason:
          type: string
        chainId:
          type: number
        type:
          $ref: '#/components/schemas/TransactionType'
        context:
          $ref: '#/components/schemas/TransactionContext'
        fromAddress:
          type: string
        toAddress:
          type: string
        tokenAddress:
          type: string
        tokenAmount:
          type: number
        bridgeGas:
          type: number
        calldata:
          type: string
        metaTxnId:
          type: string
        metaTxnFeeQuote:
          type: string
        precondition:
          $ref: '#/components/schemas/TransactionPrecondition'
        depositIntentEntry:
          $ref: '#/components/schemas/DepositIntentEntry'
        txnHash:
          type: string
        txnMinedAt:
          type: string
        updatedAt:
          type: string
        createdAt:
          type: string
    IntentReceiptSummary:
      type: object
      required:
        - intentId
        - status
        - ownerAddress
        - originChainId
        - destinationChainId
        - tradeType
        - routeProviders
        - originIntentAddress
        - originTokenAddress
        - originTokenAmount
        - originTokenMetadata
        - destinationIntentAddress
        - destinationTokenMetadata
        - destinationHasCallData
        - destinationHasCallValue
        - createdAt
        - expiresAt
      properties:
        intentId:
          type: string
        status:
          $ref: '#/components/schemas/IntentStatus'
        ownerAddress:
          type: string
        originChainId:
          type: number
        destinationChainId:
          type: number
        tradeType:
          $ref: '#/components/schemas/TradeType'
        routeProviders:
          type: array
          description: '[]RouteProvider'
          items:
            $ref: '#/components/schemas/RouteProvider'
        originIntentAddress:
          type: string
        originTokenAddress:
          type: string
        originTokenAmount:
          type: number
        originTokenMetadata:
          $ref: '#/components/schemas/TokenMetadata'
        destinationIntentAddress:
          type: string
        destinationTokenAddress:
          type: string
        destinationTokenAmount:
          type: number
        destinationToAddress:
          type: string
        destinationTokenMetadata:
          $ref: '#/components/schemas/TokenMetadata'
        destinationHasCallData:
          type: boolean
        destinationHasCallValue:
          type: boolean
        memo:
          type: string
        createdAt:
          type: string
        expiresAt:
          type: string
        startedAt:
          type: string
        finishedAt:
          type: string
    IntentTokenBalance:
      type: object
      required:
        - contractAddress
        - balance
        - balanceUsd
        - priceUsd
        - decimals
        - chainId
        - symbol
      properties:
        contractAddress:
          type: string
        balance:
          type: string
        balanceUsd:
          type: string
        priceUsd:
          type: string
        decimals:
          type: number
        chainId:
          type: number
        symbol:
          type: string
    TransactionStatus:
      type: string
      description: Represented as uint8 on the server side
      enum:
        - UNKNOWN
        - ON_HOLD
        - PENDING
        - RELAYING
        - SENT
        - ERRORED
        - MINING
        - SUCCEEDED
        - FAILED
        - ABORTED
        - REVERTED
    TransactionType:
      type: string
      description: Represented as uint8 on the server side
      enum:
        - UNKNOWN
        - DEPOSIT
        - ORIGIN
        - DESTINATION
        - ROUTE
        - REFUND
    TransactionContext:
      type: string
      description: Represented as uint8 on the server side
      enum:
        - NONE
        - CCTPV2_MESSAGE
        - LZ_COMPOSE
        - LZ_RECEIVE
    TransactionPrecondition:
      type: object
      required:
        - type
        - chainId
        - ownerAddress
        - tokenAddress
        - minAmount
      properties:
        type:
          type: string
        chainId:
          type: number
        ownerAddress:
          type: string
        tokenAddress:
          type: string
        minAmount:
          type: number
    DepositIntentEntry:
      type: object
      required:
        - intentSignature
        - feeAmount
        - feeToken
        - feeCollector
        - userNonce
        - deadline
      properties:
        intentSignature:
          type: string
        permitSignature:
          type: string
        permitDeadline:
          type: number
        permitAmount:
          type: number
        feeAmount:
          type: string
        feeToken:
          type: string
        feeCollector:
          type: string
        userNonce:
          type: number
        deadline:
          type: number
    TradeType:
      type: string
      description: Represented as string on the server side
      enum:
        - EXACT_INPUT
        - EXACT_OUTPUT
    RouteProvider:
      type: string
      description: Represented as string on the server side
      enum:
        - AUTO
        - CCTP
        - GASZIP
        - LIFI
        - LZ_OFT
        - RELAY
        - SUSHI
        - WETH
        - ZEROX
    TokenMetadata:
      type: object
      required:
        - chainId
        - tokenAddress
        - name
        - symbol
      properties:
        chainId:
          type: number
        tokenAddress:
          type: string
        name:
          type: string
        symbol:
          type: string
        decimals:
          type: number
        logoUri:
          type: string

````