View Source Nostr.Client (Nostr v0.1.3)
Connects to a relay through websockets
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Deletes events
Get encrypted direct messages from a private key
Follow a new contact using either a binary public key or a npub
Reposts a note
Sends an encrypted direct message
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
Unfollow from a contact
Update the profile that's linked to the private key
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Deletes events
@spec encrypted_direct_messages(<<_::256>>) :: DynamicSupervisor.on_start_child()
Get encrypted direct messages from a private key
@spec follow(Nostr.Models.Profile.t(), K256.Schnorr.signing_key()) :: GenServer.on_start()
@spec follow(<<_::256>> | String.t(), <<_::256>> | String.t()) :: {:ok, GenServer.on_start()} | {:error, binary()}
Follow a new contact using either a binary public key or a npub
@spec repost(<<_::256>> | String.t(), <<_::256>> | String.t()) :: GenServer.on_start()
Reposts a note
send_encrypted_direct_messages(remote_pubkey, message, private_key)
View Source@spec send_encrypted_direct_messages( K256.Schnorr.verifying_key() | <<_::256>>, String.t(), K256.Schnorr.signing_key() | <<_::256>> ) :: {:ok, :ok} | {:error, binary() | atom()}
Sends an encrypted direct message
@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>>) :: DynamicSupervisor.on_start_child()
Get an author's contacts
@spec subscribe_deletions(list()) :: DynamicSupervisor.on_start_child()
Get an author's deletions
@spec subscribe_note(<<_::256>>) :: DynamicSupervisor.on_start_child()
Get a note by id
@spec subscribe_notes([<<_::256>>]) :: DynamicSupervisor.on_start_child()
Get an author's notes
@spec subscribe_profile(K256.Schnorr.verifying_key() | binary()) :: {:ok, DynamicSupervisor.on_start_child()} | {:error, String.t()}
Get an author's profile
@spec subscribe_reactions([<<_::256>>]) :: DynamicSupervisor.on_start_child()
Get an author's reactions
@spec subscribe_reposts(list()) :: DynamicSupervisor.on_start_child()
Get an author's reposts
@spec subscribe_timeline(<<_::256>>) :: DynamicSupervisor.on_start_child()
Get an author's realtime timeline including notes from everyone the author follows
@spec unfollow(<<_::256>> | String.t(), <<_::256>> | String.t()) :: {:ok, GenServer.on_start()} | {:error, binary()}
Unfollow from a contact
Update the profile that's linked to the private key