Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v0.2.0 #4

Merged
merged 57 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e9ab4e4
wip
isaac-asdf Aug 2, 2023
d5f1f8c
wip
isaac-asdf Aug 2, 2023
526d2d1
compiles but test fails
isaac-asdf Aug 2, 2023
a2f0c37
relay response parsing works
isaac-asdf Aug 2, 2023
53dcd6e
Update relay_responses.rs
isaac-asdf Aug 2, 2023
30c3523
better error handling
isaac-asdf Aug 3, 2023
c44e744
error handling wip
isaac-asdf Aug 3, 2023
fe57f70
more error handling
isaac-asdf Aug 3, 2023
ebc1e3a
errors again, you bet
isaac-asdf Aug 3, 2023
579cc51
add auth event
isaac-asdf Aug 3, 2023
31e5127
bump version
isaac-asdf Aug 3, 2023
3661104
fix doc test
isaac-asdf Aug 4, 2023
ea1cf6a
start dms
isaac-asdf Aug 4, 2023
e6b7896
start dm tests
isaac-asdf Aug 4, 2023
7508eca
nip04 wip
isaac-asdf Aug 5, 2023
27e58d9
nip04 wip
isaac-asdf Aug 6, 2023
cad885a
encrypt might be working?
isaac-asdf Aug 6, 2023
07bf0f1
executes but not right
isaac-asdf Aug 7, 2023
a12afa7
decode works, need to remove padding
isaac-asdf Aug 7, 2023
62b558f
padding removed, need to handle errors now
isaac-asdf Aug 7, 2023
be026d8
slight optimize
isaac-asdf Aug 8, 2023
3223310
wip
isaac-asdf Aug 8, 2023
fec287d
wip
isaac-asdf Aug 8, 2023
93ce5c5
move privkey to notebuilder type
isaac-asdf Aug 8, 2023
dd237ab
wip for dm builder
isaac-asdf Aug 9, 2023
0ddce07
changed tag structure, dm read works
isaac-asdf Aug 10, 2023
69d3695
remove unwraps in lib
isaac-asdf Aug 10, 2023
d671e93
lib errors cleaned up
isaac-asdf Aug 10, 2023
8d760ae
fix comma removal
isaac-asdf Aug 10, 2023
bc2c214
nip04 errors cleaned up
isaac-asdf Aug 10, 2023
31a14e6
move time set into build
isaac-asdf Aug 10, 2023
e3873cc
Update lib.rs
isaac-asdf Aug 10, 2023
be4f371
doc update
isaac-asdf Aug 10, 2023
eadbb49
better creation of auth msg
isaac-asdf Aug 11, 2023
26a61a9
Update README.md
isaac-asdf Aug 11, 2023
40ae219
docs, fix auth note kind
isaac-asdf Aug 11, 2023
06fbef6
Update nip04.rs
isaac-asdf Aug 11, 2023
5d47ef8
reduce features of secp256k1
isaac-asdf Aug 11, 2023
8b1fb4d
Update lib.rs
isaac-asdf Aug 11, 2023
3f86a3c
doc update
isaac-asdf Aug 11, 2023
3cbfc25
handle unknown kinds generically
isaac-asdf Aug 11, 2023
79874ec
reorg, add random iot event number
isaac-asdf Aug 11, 2023
f98dc29
start adding query
isaac-asdf Aug 11, 2023
5d7d30b
query wip
isaac-asdf Aug 11, 2023
97f72b2
pubkey looks right
isaac-asdf Aug 12, 2023
6879150
relay query wip
isaac-asdf Aug 13, 2023
cd0697b
wip
isaac-asdf Aug 13, 2023
34c593f
handle bigger numbers for dec string conversion
isaac-asdf Aug 13, 2023
c881a40
since until and limit working
isaac-asdf Aug 13, 2023
78f248b
comment out last comma trackers
isaac-asdf Aug 14, 2023
2b6bcab
use util function more
isaac-asdf Aug 14, 2023
41e17ab
error message fix
isaac-asdf Aug 14, 2023
108690d
fix unwraps
isaac-asdf Aug 14, 2023
35a13a6
file rename
isaac-asdf Aug 14, 2023
23b4483
add subscription id, docs
isaac-asdf Aug 14, 2023
a1de881
fix doc test
isaac-asdf Aug 14, 2023
8a32bb0
add subscription id to event parsing
isaac-asdf Aug 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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