Packages

A Nostr client library for Elixir. Uses `nostr_lib` and `mint` to connect to relays, send events, and subscribe to relays.

Current section

Files

Jump to
nostr_ex lib signer.ex
Raw

lib/signer.ex

defmodule NostrEx.Signer do
@moduledoc """
Behaviour for signing Nostr events.
"""
alias Nostr.Event
@doc """
Sign a Nostr event.
Returns the signed event with id and sig fields populated.
"""
@callback sign_event(pid() | atom(), Event.t()) :: {:ok, Event.t()} | {:error, String.t()}
@doc """
Get the public key for this signer.
"""
@callback get_pubkey(pid() | atom()) :: {:ok, binary()} | {:error, String.t()}
end