Nostr.Event.BlockedRelays (Nostr Lib v0.2.1) (event) (nip51)

View Source

Blocked Relays List (Kind 10006)

A list of relays that clients should never connect to. Contains relay URLs via relay tags.

Defined in NIP 51 https://github.com/nostr-protocol/nips/blob/master/51.md

Summary

Functions

Creates a new blocked relays list (kind 10006).

Parses a kind 10006 event into a BlockedRelays struct.

Types

t()

@type t() :: %Nostr.Event.BlockedRelays{event: Nostr.Event.t(), relays: [URI.t()]}

Functions

create(relay_urls, opts \\ [])

@spec create([binary()], Keyword.t()) :: t()

Creates a new blocked relays list (kind 10006).

Arguments

  • relay_urls - List of relay URLs to block
  • opts - Optional event arguments (pubkey, created_at)

Example

iex> BlockedRelays.create(["wss://spam-relay.com", "wss://bad-relay.net"])

parse(event)

@spec parse(Nostr.Event.t()) :: t()

Parses a kind 10006 event into a BlockedRelays struct.