View Source Nostr.Event.Metadata (Nostr Lib v0.1.1) (event) (nip01)

Set metadata

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

Summary

Types

@type t() :: %Nostr.Event.Metadata{
  about: String.t(),
  event: Nostr.Event.t(),
  name: String.t(),
  nip05: String.t(),
  other: map(),
  picture: URI.t(),
  user: <<_::32, _::_*8>>
}

Functions

Link to this function

create(name, about, picture, nip05, opts \\ [])

View Source
@spec create(
  name :: String.t(),
  about :: String.t(),
  picture :: URI.t() | String.t(),
  nip05 :: String.t(),
  opts :: Keyword.t()
) :: t()

Create new Nostr.Event.Metadata struct

Arguments:

  • name - username
  • about
  • picture - URI struct or just String URL
  • nip05 - NIP-05 identifier
  • opts - keyword list of other optional event params (pubkey, created_at, tags)
@spec parse(event :: Nostr.Event.t()) :: t()

Parse generic Nostr.Event to Nostr.Event.Metadata struct