Skip to content

Commit

Permalink
v0.2.0 (#4)
Browse files Browse the repository at this point in the history
* wip

* wip

* compiles but test fails

* relay response parsing works

* Update relay_responses.rs

* better error handling

* error handling wip

* more error handling

* errors again, you bet

* add auth event

* bump version

* fix doc test

* start dms

* start dm tests

* nip04 wip

* nip04 wip

compiles now... but encryption is def not right. decryption not started

* encrypt might be working?

* executes but not right

* decode works, need to remove padding

* padding removed, need to handle errors now

* slight optimize

* wip

* wip

need to refine mechanics of note creation

* move privkey to notebuilder type

* wip for dm builder

need to handle errors

* changed tag structure, dm read works

* remove unwraps in lib

* lib errors cleaned up

* fix comma removal

* nip04 errors cleaned up

add documentation/examples

* move time set into build

* Update lib.rs

* doc update

* better creation of auth msg

* Update README.md

* docs, fix auth note kind

* Update nip04.rs

* reduce features of secp256k1

* Update lib.rs

* doc update

* handle unknown kinds generically

* reorg, add random iot event number

* start adding query

* query wip

* pubkey looks right

add quotes on it, figure out serializing kinds

* relay query wip

* wip

* handle bigger numbers for dec string conversion

* since until and limit working

* comment out last comma trackers

* use util function more

* error message fix

* fix unwraps

* file rename

* add subscription id, docs

* fix doc test

* add subscription id to event parsing
  • Loading branch information
isaac-asdf authored Aug 14, 2023
1 parent dda6fa4 commit 0683744
Show file tree
Hide file tree
Showing 9 changed files with 1,387 additions and 216 deletions.
11 changes: 8 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nostr-nostd"
version = "0.1.0"
version = "0.2.0"
description = "A crate to assist with implementing a nostr client in a ![no_std] environment"
documentation = "https://docs.rs/nostr-nostd"
repository = "https://github.com/isaac-asdf/nostr-nostd"
Expand All @@ -16,5 +16,10 @@ edition = "2021"
[dependencies]
base16ct = "0.2.0"
heapless = { version = "0.7.14", default-features = false }
secp256k1 = {version = "0.27.0", default-features = false, features = ["serde", "rand", "recovery", "lowmemory"] }
sha2 = { version = "0.10.7", default-features = false }
secp256k1 = {version = "0.27.0", default-features = false, features = ["lowmemory"] }
sha2 = { version = "0.10.7", default-features = false }

# NIP04
aes = "0.8.3"
cbc = { version = "0.1.2", default-features = false }
base64ct = "1.6.0"
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ A demo project can be seen [here](https://github.com/isaac-asdf/esp32-nostr-clie

# Implemented

- Basic Kind 1 note creation
- Tag addition, up to 5
- Kinds implemented
- ShortNote, 1
- DMs, 4
- Auth, 22242
- Tags on notes, limit of 5

# Future improvements

- Support more note kinds, investigate Kind 4 for private sending in an IOT context
- Support more note kinds
- Investigate GenericArray to make length of content able to be larger without always filling memory

[//]: # "badges"
[crate-image]: https://buildstats.info/crate/nostr-nostd
Expand Down
17 changes: 16 additions & 1 deletion src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,22 @@
//! Possible errors thrown by this crate

#[derive(PartialEq, Debug)]
pub enum ResponseErrors {
pub enum Error {
InvalidPubkey,
InvalidPrivkey,
InternalPubkeyError,
InternalSigningError,
TagNameTooLong,
UnknownKind,
InvalidType,
TypeNotAccepted,
MalformedContent,
ContentOverflow,
EventNotValid,
EventMissingField,
TooManyTags,
InternalError,
EncodeError,
Secp256k1Error,
QueryBuilderOverflow,
}
Loading

0 comments on commit 0683744

Please sign in to comment.