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

Convert a reaction model to a nostr event

Link to this section Summary

Functions

Convert a reaction to a nostr event

Link to this section Functions

Link to this function

to_event(reaction, reaction_pubkey)

View Source

Convert a reaction to a nostr event

examples

Examples

iex> %NostrBasics.Models.Reaction{
...>   event_id: "note1ufw7j6w60xaq04qvwxs2002jt5d8uwe5el7tw2fkfskvnl8f9d7sp9xfah",
...>   event_pubkey: "npub1dergggklka99wwrs92yz8wdjs952h2ux2ha2ed598ngwu9w7a6fsh9xzpc"
...> }
...> |> NostrBasics.Models.Reaction.Convert.to_event(<<0x5ab9f2efb1fda6bc32696f6f3fd715e156346175b93b6382099d23627693c3f2::256>>)
{
  :ok,
  %NostrBasics.Event{
    pubkey: <<0x5ab9f2efb1fda6bc32696f6f3fd715e156346175b93b6382099d23627693c3f2::256>>,
    kind: 7,
    tags: [
      ["e", "e25de969da79ba07d40c71a0a7bd525d1a7e3b34cffcb729364c2cc9fce92b7d"],
      ["p", "6e468422dfb74a5738702a8823b9b28168abab8655faacb6853cd0ee15deee93"]
    ],
    content: "+"
  }
}