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

View Source

Pinned Notes (Kind 10001)

A list of events the user intends to showcase in their profile page. Typically contains kind:1 note event IDs.

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

Summary

Functions

Creates a new pinned notes list (kind 10001).

Parses a kind 10001 event into a PinnedNotes struct.

Types

t()

@type t() :: %Nostr.Event.PinnedNotes{event: Nostr.Event.t(), notes: [binary()]}

Functions

create(note_ids, opts \\ [])

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

Creates a new pinned notes list (kind 10001).

Arguments

  • note_ids - List of event IDs to pin
  • opts - Optional event arguments (pubkey, created_at)

Example

iex> PinnedNotes.create(["abc123", "def456"])

parse(event)

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

Parses a kind 10001 event into a PinnedNotes struct.