Documentation / @etherfold/browser / EventProcessor
Type Alias: EventProcessor<ABI, ProcessResultType>
EventProcessor<
ABI,ProcessResultType> =object
Defined in: core/dist/types.d.ts:26
Type Parameters
ABI
ABI extends Abi
ProcessResultType
ProcessResultType = void
Properties
clear
clear: () =>
Promise<void>
Defined in: core/dist/types.d.ts:55
Returns
Promise<void>
load
load: (
source,streamConfig) =>Promise<{lastSync:LastSync<ABI>;state:ProcessResultType; } |undefined>
Defined in: core/dist/types.d.ts:49
Parameters
source
IndexingSource<ABI>
streamConfig
Returns
Promise<{ lastSync: LastSync<ABI>; state: ProcessResultType; } | undefined>
process
process: (
eventStream,lastSync) =>Promise<ProcessResultType>
Defined in: core/dist/types.d.ts:53
Parameters
eventStream
LogEvent<ABI>[]
lastSync
LastSync<ABI>
Returns
Promise<ProcessResultType>
reset
reset: () =>
Promise<void>
Defined in: core/dist/types.d.ts:54
Returns
Promise<void>
Methods
getCodeFingerprint()
getCodeFingerprint():
string|undefined
Defined in: core/dist/types.d.ts:48
A hash of the processor's own handler SOURCE, or undefined when it cannot be derived.
Advisory, and deliberately NOT part of getVersionHash(): it moves when a minifier or a transpiler re-emits the same behaviour differently, and folding that into the version hash would force a full state rebuild on a deploy that changed no logic. The core only compares it, reports when it differs at an UNCHANGED version hash (the "forgot to bump" case), and never discards state because of it.
REQUIRED, unlike the value it returns. An optional method is a hole with a polite name: an implementation that simply never wrote one would lose drift detection silently, and a WRAPPER (a cache, a decorator) that forgot to forward it would take the wrapped processor's detection down with it, invisibly. Being required makes both a compile error instead. Returning undefined is still allowed, because "cannot tell" is a real answer (a processor whose handlers are all bound or proxied has no readable source), and the core reads it as "do not report" rather than as "unchanged".
Returns
string | undefined
getVersionHash()
getVersionHash():
string
Defined in: core/dist/types.d.ts:27
Returns
string