> For the complete documentation index, see [llms.txt](https://docs.trustlesswork.com/trustless-work/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.trustlesswork.com/trustless-work/api-rest/indexer.md).

# Indexer

This endpoint facilitates the recovery and proper storage in Firebase of escrow-related information submitted to the Stellar Blockchain via external applications, bypassing the standard application.

### 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="https://2074000817-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDg2e2YCRmNlhCnxxmEb6%2Fuploads%2Fl4jP9FGBblnmG7lkCnrB%2FIndex%20Diagram.png?alt=media&amp;token=37387e9a-2784-4445-bbbb-3da5071fa13c" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
