Skip to main content

Overview

Relay provides two key APIs for transaction indexing:

API 1: transactions/single

When to Use

Use this API for same-chain actions including:
  • Token transfers
  • Token wraps (e.g., ETH to WETH)
  • Token unwraps (e.g., WETH to ETH)
Note: This is not required for same-chain swaps.

Purpose

  • Ensures same-chain actions are properly indexed
  • Relay’s indexer doesn’t actively monitor same-chain actions by default
  • Critical for applications supporting same-chain token operations

API Reference

Documentation Implementation Reference

Request Example

API 2: transactions/index

When to Use

Use this API for transactions that contain internal deposits that need to be detected through trace analysis. This is particularly important for teams using their own proxy contracts.

Purpose

  • Accelerates the indexing process by triggering indexing before transaction validation completes
  • Ensures Relay fetches transaction traces to detect internal deposits
  • Recommended for custom proxy contract implementations

API Reference

Documentation Implementation Reference

Request Example

cURL

Integration

Call this API immediately after submitting a transaction, before waiting for confirmation.
If you receive a 404 for a freshly broadcast Bitcoin transaction, wait for at least one block confirmation and retry.

Decision Matrix

Key Takeaways

  1. transactions/single is essential for same-chain operations that aren’t automatically monitored
  2. transactions/index is for accelerating indexing of transactions with internal deposits
  3. Call these APIs immediately after transaction submission for optimal indexing performance
  4. Choose the appropriate API based on your transaction type using the decision matrix above
For detailed implementation examples, refer to the Relay SDK source code links provided above.