Skip to content

Documentation / @etherfold/processor-entities / groupByBlock

Function: groupByBlock() ​

groupByBlock<ABI>(eventStream): BlockOfEvents<ABI>[]

Defined in: packages/processor-entities/src/stream.ts:34

Group the APPLIED events by block, preserving stream order.

Keyed by block hash, matching the core's groupLogsPerBlock, so that two distinct blocks at the same height (which is exactly what a reorg produces inside one stream) stay two blocks. Removed events are dropped here: they were already answered by the revert, and re-running them as mutations would apply the dead branch a second time.

Type Parameters ​

ABI ​

ABI extends Abi

Parameters ​

eventStream ​

readonly LogEvent<ABI>[]

Returns ​

BlockOfEvents<ABI>[]