View Source Nostr.Client (Nostr v0.1.1)
Connects to a relay through websockets
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Follow a new contact
Sends a note to the relay
Starts the client
Get an author's contacts
Get an author's deletions
Get a note by id
Get an author's notes
Get an author's profile
Get an author's reactions
Get an author's reposts
Get an author's realtime timeline including notes from everyone the author follows
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec follow(<<_::256>>, <<_::256>>) :: :ok
Follow a new contact
@spec send_note(String.t(), K256.Schnorr.signing_key()) :: :ok | {:error, binary() | atom()}
Sends a note to the relay
@spec start_link(tuple()) :: Supervisor.on_start()
Starts the client
examples
Examples
iex> Nostr.Client.start_link("wss://relay.nostr.pro")
@spec subscribe_contacts(<<_::256>>) :: binary()
Get an author's contacts
Get an author's deletions
@spec subscribe_note(<<_::256>>) :: binary()
Get a note by id
@spec subscribe_notes(<<_::256>>) :: binary()
Get an author's notes
@spec subscribe_profile(<<_::256>>) :: binary()
Get an author's profile
Get an author's reactions
Get an author's reposts
@spec subscribe_timeline(<<_::256>>) :: binary()
Get an author's realtime timeline including notes from everyone the author follows