Skip to main content

Class: EvmIndexerClient

Defined in: evm-client/src/indexer.ts:69

EVM implementation of OvercastIndexerClient.

Every protocol event is an event on the one Core proxy, so a scan is eth_getLogs over a block window filtered to that address — there is no counterpart to Solana's self-CPI decoding, and nothing here has to distinguish an event from a real instruction. What EVM takes away instead is the envelope: a log carries no timestamp, so each block that holds events costs one header read (cached per page).

A checkpoint is a block boundary, not a transaction

A Checkpoint maps onto EVM as { height: block number, txIdx: index of the transaction within its block, timestamp: block time (ms) }. The checkpoint field is the transaction hash for an event and the block hash for a head or a paging cursor, because a bound here really is a block: eth_getLogs is addressed by block range, and the store only round-trips height and the hash (see getCheckpoint, which drops txIdx), so a cursor that pointed into the middle of a block could not survive a restart.

Paging therefore moves in whole blocks, descending — matching Solana's direction and core's backfill cursor, which is documented as the lowest point swept so far. floor is read as "this block is fully swept, start above it" and ceil as "include this block entirely", which is exactly how the tails' successive (floor, ceil] ranges meet: a tick stores its ceil head, the next tick starts at that block plus one. No gaps, no double-inserts.

Implements​

  • OvercastIndexerClient

Constructors​

Constructor​

new EvmIndexerClient(
client,
config,
subscriptionClient?): EvmIndexerClient;

Defined in: evm-client/src/indexer.ts:101

Parameters​

ParameterTypeDescription
client{ }a viem public client on the chain core is deployed to. Only getLogs, getBlock and one readContract are used, so an account-less transport is enough.
configEvmConfig<string>the deployment being indexed. Takes the whole config rather than a bare address like EvmReader and EvmWriter do, because a scan is shaped by more than where core lives: finality decides what "canonical" means for this chain and logBlockRange how wide a request may be. Both are properties of the deployment, so they belong to the config that describes it rather than to a per-client options bag.
subscriptionClient?{ }a websocket client to push live activity, see watch.

Returns​

EvmIndexerClient

Properties​

blockRange​

readonly blockRange: number;

Defined in: evm-client/src/indexer.ts:74

Widest block span passed to one eth_getLogs. See EvmConfig.logBlockRange.


coreAddress​

readonly coreAddress: `0x${string}`;

Defined in: evm-client/src/indexer.ts:71

The deployed Core proxy whose logs are the protocol's event log.


domain​

readonly domain: number;

Defined in: evm-client/src/indexer.ts:79


finality​

readonly finality: EvmFinality;

Defined in: evm-client/src/indexer.ts:77

How this chain's finalized head is resolved. See EvmFinality.


watch?​

readonly optional watch?: (onActivity) => void;

Defined in: evm-client/src/indexer.ts:86

Wakes on every Core log via eth_subscribe. Only set with a websocket client, else core polls. viem resubscribes after a reconnect, and a dead socket just falls back to core's watch timeout.

Parameters​

ParameterType
onActivity() => void

Returns​

void

Implementation of​

OvercastIndexerClient.watch

Methods​

getEvents()​

getEvents(
range,
cursor,
limit): Promise<EventPage>;

Defined in: evm-client/src/indexer.ts:138

One bounded page of events in the range (floor, ceil]. Pass cursor as null to start, then thread back EventPage until it is null (range drained). Returns at most limit events, oldest first. The adapter owns the scan direction and drops anything above ceil. commitment is the tier being indexed; an adapter may skip work only the finalized tier needs (e.g. an exact txIdx).

Parameters​

ParameterType
range{ ceil: Checkpoint; floor: Checkpoint | null; }
range.ceilCheckpoint
range.floorCheckpoint | null
cursorCheckpoint | null
limitnumber

Returns​

Promise<EventPage>

Implementation of​

OvercastIndexerClient.getEvents

getHead()​

getHead(commitment): Promise<Checkpoint>;

Defined in: evm-client/src/indexer.ts:125

The current chain head at a Commitment level: live (fast, still reorgable) or finalized (settled, canonical). A sweep runs toward the head at its level as a ceiling.

Parameters​

ParameterType
commitmentCommitment

Returns​

Promise<Checkpoint>

Implementation of​

OvercastIndexerClient.getHead