> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Block data for Tron

> Block data interfaces for Tron — the batch handler context and the Block item iterables.

In Tron Squid SDK, the data is processed by repeatedly calling the user-defined batch handler function supplied to `processor.run(database, handler)` on batches of on-chain data. The sole argument of the batch handler is its context:

```ts theme={"system"}
export interface DataHandlerContext<Store, Fields extends FieldSelection> {
  log: Logger
  store: Store
  blocks: Block<Fields>[]
  // signals that the processor has reached the chain head;
  // the head block is always included in .blocks
  isHead: boolean
}
```

`ctx.blocks` is an array of `Block` objects containing the data to be processed, aligned at the block level. For `TronBatchProcessor` the `Block` interface is defined as follows:

```ts theme={"system"}
export interface Block<F extends FieldSelection = {}> {
  header: BlockHeader<F>
  transactions: Transaction<F>[]
  logs: Log<F>[]
  internalTransactions: InternalTransaction<F>[]
}
```

`F` here is the type of the argument of the [`setFields()`](./field-selection) processor method. Use `TronBatchProcessorFields<typeof processor>` to derive it from a configured processor.

`Block.header` contains the block header data. The rest of the fields are iterables containing the three kinds of blockchain data. The items within each iterable are ordered in the same way as they are within the block.

When the corresponding related data was requested, log and internal transaction items expose an optional `.transaction` reference field plus a `getTransaction()` helper, and transaction items expose the related `.logs` and `.internalTransactions` collections.

The exact fields available in each data item type are inferred from the `setFields()` call argument. The method is documented on the [field selection](./field-selection) page:

* [`Transaction` section](./field-selection#transaction);
* [`Log` section](./field-selection#log);
* [`InternalTransaction` section](./field-selection#internal-transaction);
* [`BlockHeader` section](./field-selection#block-header).
