@tevm/voltaire / primitives/TopicFilter
primitives/TopicFilter
Classes
InvalidTopicFilterError
Defined in: src/primitives/TopicFilter/errors.js:4 Error thrown when TopicFilter is invalidExtends
Error
Constructors
Constructor
new InvalidTopicFilterError(Defined in: src/primitives/TopicFilter/errors.js:9message,details?):InvalidTopicFilterError
Parameters
message
string
details?
object
Returns
InvalidTopicFilterError
Overrides
Error.constructor
Properties
details
details:Defined in: src/primitives/TopicFilter/errors.js:13object|undefined
name
name: string
Defined in: src/primitives/TopicFilter/errors.js:11
Inherited from
Error.name
Type Aliases
TopicEntry
TopicEntry =Defined in: src/primitives/TopicFilter/TopicFilterType.ts:7 Single topic filter entry - either a specific hash, array of hashes (OR), or null (wildcard)HashType| readonlyHashType[] |null
TopicFilterType
TopicFilterType = readonly [Defined in: src/primitives/TopicFilter/TopicFilterType.ts:30 Topic filter array for event filteringTopicEntry?,TopicEntry?,TopicEntry?,TopicEntry?] &object
- Up to 4 indexed event parameters (topic0, topic1, topic2, topic3)
- topic0 is typically the event signature hash
- null entries match any value (wildcard)
- Array entries match any of the values (OR logic)
- Positions use AND logic: all non-null positions must match
Type Declaration
[brand]
readonly[brand]:"TopicFilter"
Example
Functions
from()
from(Defined in: src/primitives/TopicFilter/from.js:25 Create TopicFilter from arraytopics):TopicFilterType
Parameters
topics
readonly [TopicEntry | undefined, TopicEntry | undefined, TopicEntry | undefined, TopicEntry | undefined]
Topic filter array (up to 4 entries)
Returns
TopicFilterType
Throws
Example
isEmpty()
isEmpty(Defined in: src/primitives/TopicFilter/isEmpty.js:12 Check if topic filter is empty (all wildcards)filter):boolean
Parameters
filter
TopicFilterType
Returns
boolean
Example
matches()
matches(Defined in: src/primitives/TopicFilter/matches.js:19 Check if a topic array matches this filter Uses AND logic across positions and OR logic within arrays:filter,logTopics):boolean
- All non-null filter positions must match the corresponding log topic
- Array entries match if ANY of the hashes match (OR)
- null entries always match (wildcard)
Parameters
filter
TopicFilterType
logTopics
readonlyHashType[]
Topics from a log entry
Returns
boolean

