Skip to content

v3.7.0

Choose a tag to compare

@DZakh DZakh released this 18 Aug 10:27
· 16 commits to main since this release
ea88a40

What's Changed

Per-handler field selection (recommended)

A new way to define transaction and block fields your handler logic can access. List them under fields option. Type-safe, more flexible and right at the place where you use consume the fields.

We use the definition to optimize data your indexer needs to fetch and decode, resulting in a much better performance.

The field_selection in config is still supported without breaking changes, but we recommend using the fields in handlers instead.

indexer.onEvent(
  {
    contract: "MyContract",
    event: "Transfer",
    fields: { transaction: ["hash", "from"], block: ["timestamp"] },
  },
  async ({ event, context }) => {
    event.transaction.hash; // string
    event.block.timestamp; // number
    event.transaction.gasUsed; // Type error: not listed in fields
  },
);

By @DZakh in #1539

More fields with RPC source

An indexer with RPC source now allows to select more fields:

Transaction (20) — gas, nonce, v, r, s, yParity, type, maxFeePerBlobGas, blobVersionedHashes, cumulativeGasUsed, effectiveGasPrice, gasUsed, logsBloom, root, status, l1Fee, l1GasPrice, l1GasUsed, l1FeeScalar, gasUsedForL1

Block (15) — sha3Uncles, logsBloom, transactionsRoot, receiptsRoot, totalDifficulty, size, uncles, blobGasUsed, excessBlobGas, parentBeaconBlockRoot, withdrawalsRoot, l1BlockNumber, sendCount, sendRoot, mixHash

By @DZakh in #1539

Other fixes and improvements

Full Changelog: v3.6.1...v3.7.0