Filter class

Represents a filter for querying Nostr events.

This class encapsulates various criteria that can be used to filter Nostr events when querying relays or local caches. https://github.com/nostr-protocol/nips/blob/master/01.md#communication-between-clients-and-relays

Constructors

Filter({List<String>? ids, List<String>? authors, List<int>? kinds, String? search, List<String>? eTags, List<String>? pTags, List<String>? tTags, List<String>? aTags, List<String>? dTags, int? since, int? until, int? limit})
Filter.fromJson(Map<String, dynamic> json)
factory
Filter.fromMap(Map<String, dynamic> map)
Filter.mergeAuthors(Filter filter1, Filter filter2)
Creates a new Filter by merging authors from two filters.

Properties

aTags List<String>?
List of replaceable event tags to filter by.
getter/setter pair
authors List<String>?
List of author public keys to filter by.
getter/setter pair
dTags List<String>?
getter/setter pair
eTags List<String>?
List of event tags to filter by.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
ids List<String>?
List of event IDs to filter by.
getter/setter pair
kinds List<int>?
List of event kinds to filter by.
getter/setter pair
limit int?
Maximum number of events to return.
getter/setter pair
pTags List<String>?
List of pubkey tags to filter by.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
Text to search for in event content.
getter/setter pair
since int?
Unix timestamp to filter events created after this time.
getter/setter pair
tTags List<String>?
List of hashtag tags to filter by.
getter/setter pair
until int?
Unix timestamp to filter events created before this time.
getter/setter pair

Methods

clone() Filter
cloneWithAuthors(List<String> authors) Filter
Creates a new Filter with updated authors.
cloneWithPTags(List<String> pTags) Filter
Creates a new Filter with updated pubkey tags.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
toMap() Map<String, dynamic>
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited