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

View Source

Interest Sets (Kind 30015)

Interest topics represented by a bunch of hashtags. 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 interest set (kind 30015).

Parses a kind 30015 event into an InterestSets struct.

Types

t()

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

Functions

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

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

Creates a new interest set (kind 30015).

Arguments

  • identifier - Unique identifier for this set (used in d tag)
  • hashtags - List of hashtags (without #)
  • 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

InterestSets.create("tech", ["programming", "opensource", "linux"],
  title: "Tech Interests",
  description: "Technology and software development topics"
)

parse(event)

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

Parses a kind 30015 event into an InterestSets struct.