Expand description
Implementation of Nostr for a #![no_std] environment. It supports note creation and parsing relay responses. An example project using an esp32 can be seen here.
§Example
use nostr_nostd::{Note, String, ClientMsgKinds};
let privkey = "a5084b35a58e3e1a26f5efb46cb9dbada73191526aa6d11bccb590cbeb2d8fa3";
let content: String<400> = String::from("Hello, World!");
let tag: String<150> = String::from("relay,wss://relay.example.com/");
// aux_rand should be generated from a random number generator
// required to keep PRIVKEY secure with Schnorr signatures
let aux_rand = [0; 32];
let note = Note::new_builder(privkey)
.unwrap()
.content(content)
.add_tag(tag)
.build(1686880020, aux_rand)
.unwrap();
let msg = note.serialize_to_relay(ClientMsgKinds::Event);Modules§
- errors
- Possible errors thrown by this crate
- query
- Build queries to get events from relays
- relay_
responses - Handle messages from relays
Structs§
- Build
Status - Used to track the addition of the time created and the number of tags added
- Five
Tags - Five tags have been added
- Four
Tags - Four tags have been added
- Note
- Representation of Nostr Note
- Note
Builder - Used to fill in the fields of a Note.
- OneTag
- One tag has been added
- String
- A fixed capacity
String - Three
Tags - Three tags have been added
- TwoTags
- Two tags have been added
- Vec
- A fixed capacity
Vec - Zero
Tags - No tags have been added
Enums§
- Client
MsgKinds - Note
Kinds - Defined by the nostr protocol