Crate nostr_types

Source
Expand description

This crate provides types for nostr protocol handling.

Structs§

DelegationConditions
Conditions of delegation
EncryptedPrivateKey
This is an encrypted private key.
Event
The main event type
EventPointer
An event id along with some relays in which that event may be found.
Filter
Filter which specify what events a client is looking for
Id
An event identifier, constructed as a SHA256 hash of the event fields according to NIP-01
IdHex
An event identifier, constructed as a SHA256 hash of the event fields according to NIP-01, as a hex string
IdHexPrefix
An event identifier prefix, constructed as a SHA256 hash of the event fields according to NIP-01, as a hex string
Metadata
Metadata about a user
Nip05
The content of a webserver’s /.well-known/nostr.json file used in NIP-05 and NIP-35 This allows lookup and verification of a nostr user via a user@domain style identifier.
PayRequestData
This is a response from a zapper lnurl
PreEvent
Data used to construct an event
PrivateKey
This is a private key which is to be kept secret and is used to prove identity
Profile
A person’s profile on nostr which consists of the data needed in order to follow someone.
PublicKey
This is a public key, which identifies an actor (usually a person) and is shared.
PublicKeyHex
This is a public key, which identifies an actor (usually a person) and is shared, as a hex string
PublicKeyHexPrefix
This is a public key prefix, which identifies an actor (usually a person) and is shared, as a hex string
RelayInformationDocument
Relay information document as described in NIP-11, supplied by a relay
RelayLimitation
Relay limitations
RelayUrl
A Url validated as a nostr relay url in canonical form We don’t serialize/deserialize these directly, see UncheckedUrl for that
Signature
A Schnorr signature that signs an Event, taken on the Event Id field
SignatureHex
A Schnorr signature that signs an Event, taken on the Event Id field, as a hex string
SimpleRelayList
A list of relays with SimpleRelayUsage
SimpleRelayUsage
When and how to use a Relay
SubscriptionId
A random client-chosen string used to refer to a subscription
UncheckedUrl
A string that is supposed to represent a URL but which might be invalid
Unixtime
An integer count of the number of seconds from 1st January 1970. This does not count any of the leap seconds that have occurred, it simply presumes UTC never had leap seconds; yet it is well known and well understood.
Url
A String representing a valid URL with an authority present including an Internet based host.

Enums§

ClientMessage
A message from a client to a relay
Error
Errors that can occur in the nostr-proto crate
EventDelegation
Delegation information for an Event
EventKind
A kind of Event
KeySecurity
This indicates the security of the key by keeping track of whether the secret key material was handled carefully. If the secret is exposed in any way, or leaked and the memory not zeroed, the key security drops to Weak.
RelayMessage
A message from a relay to a client
Tag
A tag on an Event