v3.7.0
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
},
);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
Other fixes and improvements
- Fix reorg detection for SVM by @DZakh in #1405
- Fix an edge-case for EVM RPC source reorg detection by @DZakh in #1405
- SVM API preparations for the final release and SVM ReScript support removal by @DZakh in #1547, #1551, #1549, #1552
- Many improvements for internal testing @DZakh in #1534, #1553, #1544, #1556
Full Changelog: v3.6.1...v3.7.0