View Source NostrBasics.Models.Note.Convert (NostrBasics v0.1.6)

Convert a note model to a nostr event

Link to this section Summary

Functions

Creates a new nostr note

Link to this section Functions

Link to this function

to_event(note, note_pubkey)

View Source

Creates a new nostr note

examples

Examples

iex> %NostrBasics.Models.Note{
...>   content: "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks"
...> }
...> |> NostrBasics.Models.Note.Convert.to_event(<<0x5ab9f2efb1fda6bc32696f6f3fd715e156346175b93b6382099d23627693c3f2::256>>)
{
  :ok,
  %NostrBasics.Event{
    pubkey: <<0x5ab9f2efb1fda6bc32696f6f3fd715e156346175b93b6382099d23627693c3f2::256>>,
    kind: 1,
    content: "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks",
    tags: []
  }
}