Nostr. Filter
(Nostr Lib v0.2.1)
View Source
Nostr filter
Summary
Functions
Returns true if the event matches any filter in the list (OR semantics).
Returns true if the event satisfies all present constraints in the filter
(AND semantics). A nil field means no constraint — always passes.
Parse filter from raw list to Nostr.Filter struct
Types
@type t() :: %Nostr.Filter{ "#a": nil | [<<_::32, _::_*8>>], "#d": nil | [binary()], "#e": nil | [<<_::32, _::_*8>>], "#p": nil | [<<_::32, _::_*8>>], authors: nil | [<<_::32, _::_*8>>], ids: nil | [<<_::32, _::_*8>>], kinds: nil | [non_neg_integer()], limit: nil | non_neg_integer(), search: nil | String.t(), since: nil | DateTime.t(), tags: nil | %{required(String.t()) => [binary()]}, until: nil | DateTime.t() }
Functions
@spec any_match?([t()], Nostr.Event.t()) :: boolean()
Returns true if the event matches any filter in the list (OR semantics).
@spec matches?(t(), Nostr.Event.t()) :: boolean()
Returns true if the event satisfies all present constraints in the filter
(AND semantics). A nil field means no constraint — always passes.
Parse filter from raw list to Nostr.Filter struct