Defines the options used to filter events in a subscription. These options can specify which events to include based on various blockchain parameters.

interface FilterOptions {
    address?: string | string[];
    blockhash?: string;
    fromBlock?: string;
    toBlock?: string;
    topics?: string[];
}

Properties

address?: string | string[]

The contract address or addresses to filter for events.

blockhash?: string

The hash of a specific block. If defined, only events from this block are included.

fromBlock?: string

The starting block number (inclusive) from which to begin filtering events.

toBlock?: string

The ending block number (inclusive) at which to stop filtering events.

topics?: string[]

An array of topic identifiers to filter events. Each event must match all specified topics to be included.