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

View Source

Follow Sets (Kind 30000)

Categorized groups of users a client may choose to check out in different circumstances. This is an addressable event with a d tag identifier.

Sets can have optional metadata: title, image, and description.

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

Summary

Functions

Creates a new follow set (kind 30000).

Parses a kind 30000 event into a FollowSets struct.

Types

t()

@type t() :: %Nostr.Event.FollowSets{
  description: binary() | nil,
  event: Nostr.Event.t(),
  identifier: binary(),
  image: binary() | nil,
  pubkeys: [binary()],
  title: binary() | nil
}

Functions

create(identifier, pubkeys, opts \\ [])

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

Creates a new follow set (kind 30000).

Arguments

  • identifier - Unique identifier for this set (used in d tag)
  • pubkeys - List of pubkeys to include in the set
  • opts - Optional event arguments and set metadata

Options

  • :title - Set title for display
  • :image - Set image URL
  • :description - Set description
  • :pubkey - Event author pubkey
  • :created_at - Event timestamp

Example

FollowSets.create("developers", ["pubkey1", "pubkey2"],
  title: "Nostr Developers",
  description: "People building on Nostr"
)

parse(event)

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

Parses a kind 30000 event into a FollowSets struct.