View Source Nex.Messages.Event (Nex v0.1.0)
Nostr Event schema.
See NIP-01.
Link to this section Summary
Functions
Calculates the ID for the given event. Returns a hex-encoded ID.
Returns a changeset from the given params.
Returns the ID preimage for the given event. Clients will sign this value.
Guard returning true if the given kind is of any ephemeral event.
Guard returning true if the given kind is of any replaceable event.
Returns a changeset from the given params.
Link to this section Types
@type t() :: %Nex.Messages.Event{ __meta__: term(), content: String.t(), created_at: integer(), db_tags: term(), delegator: String.t(), expires_at: integer(), id: String.t(), inserted_at: term(), kind: integer(), nid: term(), pubkey: String.t(), replace_key: String.t(), sig: String.t(), tags: [Nex.Messages.Tag.t()] }
Event
Link to this section Functions
@spec calc_id(Ecto.Schema.t()) :: String.t()
Calculates the ID for the given event. Returns a hex-encoded ID.
@spec changeset(Ecto.Schema.t(), map()) :: Ecto.Changeset.t()
Returns a changeset from the given params.
This base changeset validates the presents and format of all fields, but does not verify the event ID or signature.
@spec id_preimage(Ecto.Schema.t()) :: String.t()
Returns the ID preimage for the given event. Clients will sign this value.
Guard returning true if the given kind is of any ephemeral event.
Guard returning true if the given kind is of any replaceable event.
@spec verify_changeset(Ecto.Schema.t(), map()) :: Ecto.Changeset.t()
Returns a changeset from the given params.
As f:changeset/2
but also verifies the event ID and signature.