Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Commit

Permalink
Merge pull request #967 from MutinyWallet/requests
Browse files Browse the repository at this point in the history
DM requests for invoices
  • Loading branch information
benthecarman authored Jan 23, 2024
2 parents 24b74a9 + fadc167 commit 6512e70
Show file tree
Hide file tree
Showing 11 changed files with 909 additions and 266 deletions.
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions mutiny-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ futures-util = { version = "0.3", default-features = false }
reqwest = { version = "0.11", default-features = false, features = ["json"] }
async-trait = "0.1.68"
url = { version = "2.3.1", features = ["serde"] }
nostr = { version = "0.27.0", default-features = false, features = ["nip05", "nip47", "nip57"] }
nostr-sdk = { version = "0.27.0", default-features = false }
nostr = { version = "0.27.0", default-features = false, features = ["nip04", "nip05", "nip47", "nip57"] }
nostr-sdk = { version = "0.27.0", default-features = false, features = ["nip04", "nip05", "nip47", "nip57"] }
cbc = { version = "0.1", features = ["alloc"] }
aes = { version = "0.8" }
jwt-compact = { version = "0.8.0-beta.1", features = ["es256k"] }
Expand Down Expand Up @@ -82,6 +82,9 @@ js-sys = "0.3.65"
gloo-net = { version = "0.4.0" }
instant = { version = "0.1", features = ["wasm-bindgen"] }
getrandom = { version = "0.2", features = ["js"] }
# add nip07 feature for wasm32
nostr = { version = "0.27.0", default-features = false, features = ["nip04", "nip05", "nip07", "nip47", "nip57"] }
nostr-sdk = { version = "0.27.0", default-features = false, features = ["nip04", "nip05", "nip07", "nip47", "nip57"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
tokio = { version = "1", features = ["rt"] }
Expand Down
10 changes: 10 additions & 0 deletions mutiny-core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ pub enum MutinyError {
/// Error getting nostr data
#[error("Failed to get nostr data.")]
NostrError,
/// Error with Nip07 Extension
#[error("Error with NIP-07 extension")]
Nip07Extension,
/// Incorrect password entered.
#[error("Incorrect password entered.")]
IncorrectPassword,
Expand Down Expand Up @@ -463,6 +466,13 @@ impl From<nostr::nips::nip04::Error> for MutinyError {
}
}

#[cfg(target_arch = "wasm32")]
impl From<nostr::nips::nip07::Error> for MutinyError {
fn from(_e: nostr::nips::nip07::Error) -> Self {
Self::Nip07Extension
}
}

impl From<nostr::nips::nip57::Error> for MutinyError {
fn from(_e: nostr::nips::nip57::Error) -> Self {
Self::NostrError
Expand Down
Loading

0 comments on commit 6512e70

Please sign in to comment.