# Indexer

### Key Components

* **External Transaction**: This endpoint handles cases where the XDR generated by any endpoint of our REST API is signed and sent directly by external applications.
* **Internal Queue**: Information initially generated by the application is stored in an internal queue, awaiting association with a specific transaction identified by its hash (`txHash`).
* **Firebase Storage**: Once retrieved from the internal queue, the information is permanently stored in Firebase.

### Roles Involved

* **External Application**: Signs and sends the XDR without using the standard endpoint (`helper/send-transaction`).
* **Indexer**: Responsible for retrieving information from the internal queue and storing it in Firebase upon receiving the transaction hash (`txHash`).

### Endpoint Workflow

1. The XDR is obtained from any transaction (not signed) generated with any of the endpoints of our REST API.
2. The generated XDR is signed and sent externally (without using `helper/send-transaction`).
3. The external application provides the corresponding `txHash`.
4. The `txHash` is sent to `indexer/update-from-txHash`.
5. The endpoint retrieves information stored in the internal queue and saves it in Firebase.

### Usage Example

* **Request**:

```json
{
  "txHash": "your-txHash-value"
}
```

* **Response**:

The information associated with the provided `txHash` is successfully stored in Firebase, ensuring the integrity of the generated escrow.

### Benefits of Usage

* Enables external integrations while maintaining information consistency.
* Prevents data loss when bypassing the standard workflow.
* Ensures secure and accurate storage in Firebase using the transaction hash.

This endpoint enhances the system's flexibility and robustness, ensuring all transactions, regardless of the method used, are adequately recorded in Firebase.

<figure><img src="/files/PCWmSJ2706TmuJRBxHG3" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.trustlesswork.com/trustless-work/v2-en/api-rest/indexer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
