Method: Nostr::Filter#initialize

Defined in:
lib/nostr/filter.rb

#initialize(**kwargs) ⇒ Filter

Instantiates a new Filter

of these

Examples:

Nostr::Filter.new(
  ids: ['c24881c305c5cfb7c1168be7e9b0e150'],
  authors: ['000000001c5c45196786e79f83d21fe801549fdc98e2c26f96dcef068a5dbcd7'],
  kinds: [0, 1, 2],
  since: 1230981305,
  until: 1292190341,
  e: ['7bdb422f254194ae4bb86d354c0bd5a888fce233ffc77dceb3e844ceec1fcfb2'],
  p: ['000000001c5c45196786e79f83d21fe801549fdc98e2c26f96dcef068a5dbcd7']
)

Parameters:

  • kwargs (Hash)

Options Hash (**kwargs):

  • ids (Array<String>, nil)

    A list of event ids

  • authors (Array<String>, nil)

    A list of pubkeys, the pubkey of an event must be one

  • kinds (Array<Integer>, nil)

    A list of a kind numbers

  • e (Array<String>, nil)

    A list of event ids that are referenced in an “e” tag

  • p (Array<String, nil>)

    A list of pubkeys that are referenced in a “p” tag

  • since (Integer, nil)

    A timestamp, events must be newer than this to pass

  • until (Integer, nil)

    A timestamp, events must be older than this to pass

  • limit (Integer, nil)

    Maximum number of events to be returned in the initial query



120
121
122
123
124
125
126
127
128
129
# File 'lib/nostr/filter.rb', line 120

def initialize(**kwargs)
  @ids = kwargs[:ids]
  @authors = kwargs[:authors]
  @kinds = kwargs[:kinds]
  @e = kwargs[:e]
  @p = kwargs[:p]
  @since = kwargs[:since]
  @until = kwargs[:until]
  @limit = kwargs[:limit]
end