Skip to main content
@tevm/voltaire
@tevm/voltaire / primitives/LogFilter

primitives/LogFilter

Classes

InvalidLogFilterError

Defined in: src/primitives/LogFilter/errors.js:4 Error thrown when LogFilter is invalid

Extends

  • Error

Constructors

Constructor
new InvalidLogFilterError(message, details?): InvalidLogFilterError
Defined in: src/primitives/LogFilter/errors.js:9
Parameters
message
string
details?
object
Returns
InvalidLogFilterError
Overrides
Error.constructor

Properties

details
details: object | undefined
Defined in: src/primitives/LogFilter/errors.js:13
name
name: string
Defined in: src/primitives/LogFilter/errors.js:11
Inherited from
Error.name

Type Aliases

BlockTag

BlockTag = "earliest" | "latest" | "pending"
Defined in: src/primitives/LogFilter/LogFilterType.ts:10 Block identifier for log filter queries

LogFilterType

LogFilterType = object & object
Defined in: src/primitives/LogFilter/LogFilterType.ts:36 Log filter parameters for eth_getLogs and eth_newFilter Filters can specify:
  • Block range (fromBlock/toBlock) OR specific block (blockhash)
  • Contract address(es) to filter by
  • Topic filters for indexed event parameters

Type Declaration

address?
readonly optional address: AddressType | readonly AddressType[]
Single address or array of addresses to filter by
blockhash?
readonly optional blockhash: HashType
Specific block hash (mutually exclusive with fromBlock/toBlock)
fromBlock?
readonly optional fromBlock: BlockNumberType | BlockTag
Starting block number or tag
toBlock?
readonly optional toBlock: BlockNumberType | BlockTag
Ending block number or tag
topics?
readonly optional topics: TopicFilterType
Topic filters (up to 4 indexed parameters)

Type Declaration

[brand]
readonly [brand]: "LogFilter"

Example

Functions

from()

from(params): LogFilterType
Defined in: src/primitives/LogFilter/from.js:30 Create LogFilter from parameters

Parameters

params
Partial<LogFilterType> Filter parameters

Returns

LogFilterType

Throws

Example


isEmpty()

isEmpty(filter): boolean
Defined in: src/primitives/LogFilter/isEmpty.js:14 Check if log filter is empty (no filtering criteria)

Parameters

filter
LogFilterType

Returns

boolean

Example


matches()

matches(filter, log): boolean
Defined in: src/primitives/LogFilter/matches.js:16 Check if a log entry matches this filter

Parameters

filter
LogFilterType
log
EventLogType<AddressType, readonly HashType[]> Log entry to test

Returns

boolean

Example