diff --git a/Cargo.toml b/Cargo.toml index 9c52622..2e901cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ members = [ [workspace.dependencies] base32 = "0.4.0" +bech32 = { version = "0.11", default-features = false } bitflags = "2.5.0" dirs = "5.0.1" eframe = { version = "0.29.1", default-features = false, features = [ "wgpu", "wayland", "x11", "android-native-activity" ] } @@ -26,7 +27,7 @@ hex = "0.4.3" image = { version = "0.25", features = ["jpeg", "png", "webp"] } indexmap = "2.6.0" log = "0.4.17" -nostr = { version = "0.30.0" } +nostr = { version = "0.37.0", default-features = false, features = ["std", "nip49"] } nostrdb = { git = "https://github.com/damus-io/nostrdb-rs", rev = "71154e4100775f6932ee517da4350c433ba14ec7" } notedeck = { path = "crates/notedeck" } notedeck_chrome = { path = "crates/notedeck_chrome" } @@ -35,7 +36,6 @@ open = "5.3.0" poll-promise = { version = "0.3.0", features = ["tokio"] } puffin = { git = "https://github.com/jb55/puffin", package = "puffin", rev = "70ff86d5503815219b01a009afd3669b7903a057" } puffin_egui = { git = "https://github.com/jb55/puffin", package = "puffin_egui", rev = "70ff86d5503815219b01a009afd3669b7903a057" } -reqwest = { version = "0.12.4", default-features = false, features = [ "rustls-tls-native-roots" ] } serde = { version = "1", features = ["derive"] } # You only need this if you want app persistence serde_derive = "1" serde_json = "1.0.89" diff --git a/crates/enostr/Cargo.toml b/crates/enostr/Cargo.toml index 45e8ccf..fa83a9b 100644 --- a/crates/enostr/Cargo.toml +++ b/crates/enostr/Cargo.toml @@ -11,6 +11,7 @@ serde_derive = "1" serde = { version = "1", features = ["derive"] } # You only need this if you want app persistence serde_json = { workspace = true } nostr = { workspace = true } +bech32 = { workspace = true } nostrdb = { workspace = true } hex = { workspace = true } tracing = { workspace = true } diff --git a/crates/enostr/src/note.rs b/crates/enostr/src/note.rs index 997ce14..389f083 100644 --- a/crates/enostr/src/note.rs +++ b/crates/enostr/src/note.rs @@ -13,7 +13,7 @@ impl fmt::Debug for NoteId { } } -static HRP_NOTE: nostr::bech32::Hrp = nostr::bech32::Hrp::parse_unchecked("note"); +static HRP_NOTE: bech32::Hrp = bech32::Hrp::parse_unchecked("note"); impl NoteId { pub fn new(bytes: [u8; 32]) -> Self { @@ -34,7 +34,7 @@ impl NoteId { } pub fn to_bech(&self) -> Option { - nostr::bech32::encode::(HRP_NOTE, &self.0).ok() + bech32::encode::(HRP_NOTE, &self.0).ok() } } diff --git a/crates/enostr/src/pubkey.rs b/crates/enostr/src/pubkey.rs index 8333071..5dfb62c 100644 --- a/crates/enostr/src/pubkey.rs +++ b/crates/enostr/src/pubkey.rs @@ -1,7 +1,6 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use crate::Error; -use nostr::bech32::Hrp; use std::fmt; use std::ops::Deref; use tracing::debug; @@ -9,7 +8,7 @@ use tracing::debug; #[derive(Eq, PartialEq, Clone, Copy, Hash, Ord, PartialOrd)] pub struct Pubkey([u8; 32]); -static HRP_NPUB: Hrp = Hrp::parse_unchecked("npub"); +static HRP_NPUB: bech32::Hrp = bech32::Hrp::parse_unchecked("npub"); impl Deref for Pubkey { type Target = [u8; 32]; @@ -58,7 +57,7 @@ impl Pubkey { } pub fn try_from_bech32_string(s: &str, verify: bool) -> Result { - let data = match nostr::bech32::decode(s) { + let data = match bech32::decode(s) { Ok(res) => Ok(res), Err(_) => Err(Error::InvalidBech32), }?; @@ -79,7 +78,7 @@ impl Pubkey { } pub fn to_bech(&self) -> Option { - nostr::bech32::encode::(HRP_NPUB, &self.0).ok() + bech32::encode::(HRP_NPUB, &self.0).ok() } } diff --git a/crates/notedeck_columns/Cargo.toml b/crates/notedeck_columns/Cargo.toml index e47c59e..ed374e2 100644 --- a/crates/notedeck_columns/Cargo.toml +++ b/crates/notedeck_columns/Cargo.toml @@ -32,7 +32,6 @@ open = { workspace = true } poll-promise = { workspace = true } puffin = { workspace = true, optional = true } puffin_egui = { workspace = true, optional = true } -reqwest = { workspace = true } serde = { workspace = true } serde_derive = { workspace = true } serde_json = { workspace = true }