Skip to main content
Version: 1.11.1

Type Alias: LogFilter

LogFilter = { address?: string; endBefore?: string; endBlock?: number | "finalized" | "latest"; page?: number; startBlock?: number; startTime?: number; topics?: (string | string[] | null)[]; watch?: boolean | AbortSignal; }

Defined in: chain.ts:283

Filter options for getLogs queries across chains.

Properties

address?

optional address?: string

Defined in: chain.ts:297

Contract address to filter logs by.


endBefore?

optional endBefore?: string

Defined in: chain.ts:291

Cursor hint for the exclusive upper end of iteration on chains that support it.


endBlock?

optional endBlock?: number | "finalized" | "latest"

Defined in: chain.ts:289

Ending block number (inclusive).


page?

optional page?: number

Defined in: chain.ts:301

Page size for pagination.


startBlock?

optional startBlock?: number

Defined in: chain.ts:285

Starting block number (inclusive). Required unless startTime is provided; explicit 0 is allowed.


startTime?

optional startTime?: number

Defined in: chain.ts:287

Starting Unix timestamp (inclusive).


topics?

optional topics?: (string | string[] | null)[]

Defined in: chain.ts:299

Topics to filter logs by.


watch?

optional watch?: boolean | AbortSignal

Defined in: chain.ts:295

watch mode: polls for new logs after fetching since start (required), until endBlock finality tag (e.g. endBlock=finalized polls only finalized logs); can be an AbortSignal to cancel loop