> For the complete documentation index, see [llms.txt](https://docs.thehemera.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thehemera.com/hemera-indexer/use-cases/ens/data-class.md).

# Data Class

To cover ENS actions and features, we created the following data classes.

* `af_ens_event`: Records all events (actions) related to ENS. One event per row, one transaction can have multiple events.
* `af_ens_node_current`: Records an ENS node's (name) related information. One node per row, only keep current state.
* `af_ens_address_current`: Records an address's current ENS related data (primary name). One address per row, only keep current state.

Besides, since each ENS name is either an ERC721 or an ERC1155 token. The ENS job will also require data from generic data class `address_token_balance.`

#### `af_ens_event`

| Column Name          | Data Type    | Note                                                                 |
| -------------------- | ------------ | -------------------------------------------------------------------- |
| transaction\_hash    | bytea        | Hash of the transaction                                              |
| log\_index           | integer      | Index of the log in the transaction                                  |
| transaction\_index   | integer      | Index of the transaction within the block                            |
| block\_number        | bigint       | Number of the block containing the transaction                       |
| block\_hash          | bytea        | Hash of the block containing the transaction                         |
| block\_timestamp     | timestamp    | Timestamp of when the block was mined                                |
| method               | varchar      | Method name associated with the event                                |
| event\_name          | varchar      | Name of the event                                                    |
| from\_address        | bytea        | Address that initiated the transaction                               |
| to\_address          | bytea        | Address that received the transaction                                |
| base\_node           | bytea        | Base node of the ENS name                                            |
| node                 | bytea        | Node hash of the ENS name                                            |
| label                | bytea        | Label hash of the ENS name                                           |
| name                 | varchar      | Human-readable ENS name                                              |
| expires              | timestamp    | Expiry time of the ENS registration                                  |
| owner                | bytea        | Owner address of the ENS name                                        |
| resolver             | bytea        | Resolver address associated with the ENS name                        |
| registrant           | bytea        | Address of the registrant of the ENS name                            |
| address              | bytea        | Address associated with the ENS name (forward resolution)            |
| reverse\_base\_node  | bytea        | Base node for reverse resolution                                     |
| reverse\_node        | bytea        | Node for reverse resolution                                          |
| reverse\_label       | bytea        | Label hash for reverse resolution                                    |
| reverse\_name        | varchar      | Human-readable name for reverse resolution                           |
| token\_id            | numeric(100) | Token ID representing the ENS name in numeric format                 |
| w\_token\_id         | numeric(100) | Wrapped token ID, if applicable                                      |
| create\_time         | timestamp    | Time when the record was created, defaults to current timestamp      |
| update\_time         | timestamp    | Time when the record was last updated, defaults to current timestamp |
| reorg                | boolean      | Flag indicating if the record was affected by a chain reorganization |
| ens\_tnx\_log\_index | constraint   | Primary key on (transaction\_hash, log\_index)                       |

#### `af_ens_address_current`:

| Column Name   | Data Type | Note                                                                     |
| ------------- | --------- | ------------------------------------------------------------------------ |
| address       | bytea     | ENS address; primary key                                                 |
| name          | varchar   | Human-readable ENS name associated with the address                      |
| reverse\_node | bytea     | Node for reverse resolution                                              |
| create\_time  | timestamp | Time when the record was created, defaults to the current timestamp      |
| update\_time  | timestamp | Time when the record was last updated, defaults to the current timestamp |
| block\_number | bigint    | Block number when the address was last updated or registered             |

#### `af_ens_node_current`

| Column Name      | Data Type    | Note                                                                     |
| ---------------- | ------------ | ------------------------------------------------------------------------ |
| node             | bytea        | Node hash of the ENS name; primary key                                   |
| token\_id        | numeric(100) | ERC721 Token ID representing the ENS name in numeric format              |
| w\_token\_id     | numeric(100) | ERC1155 Wrapped token ID, if applicable                                  |
| first\_owned\_by | bytea        | Address of the first owner of the ENS name                               |
| name             | varchar      | Human-readable ENS name                                                  |
| registration     | timestamp    | Timestamp of when the ENS name was registered                            |
| expires          | timestamp    | Expiry time of the ENS registration                                      |
| address          | bytea        | Address associated with the ENS name                                     |
| create\_time     | timestamp    | Time when the record was created, defaults to the current timestamp      |
| update\_time     | timestamp    | Time when the record was last updated, defaults to the current timestamp |

##


---

# 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 dynamically by asking a question.

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

```
GET https://docs.thehemera.com/hemera-indexer/use-cases/ens/data-class.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
