Skip to content

Documentation / @etherfold/core / captureStream

Function: captureStream() ​

captureStream<ABI>(provider, source, options): Promise<StreamFixture<ABI>>

Defined in: packages/core/src/stream/capture.ts:61

Fetch a range of logs once and return it as a replayable fixture.

This is the ONLY part of the replay path that talks to a node, and that is the point: a measurement or a regression test that fetches per run is slow, rate-limited, and unfair between two things being compared, because each of them sees different bytes. Capture once, commit the result, replay it forever.

Events are decoded here (by the same LogEventFetcher the live path uses), so a fixture holds LogEvents rather than raw logs and a replay does not re-run the decoder. The ABI still travels along inside source, because it is part of WHAT WAS ASKED FOR, not merely of how the answer was decoded.

Type Parameters ​

ABI ​

ABI extends Abi

Parameters ​

provider ​

EIP1193ProviderWithoutEvents

source ​

IndexingSource<ABI>

options ​

CaptureStreamOptions

Returns ​

Promise<StreamFixture<ABI>>