diff --git a/bindings/cashu-sdk-ffi/Cargo.toml b/bindings/cashu-sdk-ffi/Cargo.toml index b4c38733..e7b11cb4 100644 --- a/bindings/cashu-sdk-ffi/Cargo.toml +++ b/bindings/cashu-sdk-ffi/Cargo.toml @@ -12,7 +12,7 @@ crate-type = ["cdylib", "staticlib"] [dependencies] cashu-ffi = { path = "../cashu-ffi" } -cashu-sdk = { path = "../../crates/cashu-sdk", default-features = false, features = ["wallet", "mint", "blocking"] } +cashu-sdk = { path = "../../crates/cashu-sdk", default-features = false, features = ["wallet", "mint"] } tracing = { workspace = true } tracing-subscriber = { workspace = true } uniffi = { workspace = true } diff --git a/crates/cashu-sdk/Cargo.toml b/crates/cashu-sdk/Cargo.toml index 5855cce6..60830823 100644 --- a/crates/cashu-sdk/Cargo.toml +++ b/crates/cashu-sdk/Cargo.toml @@ -12,7 +12,6 @@ license.workspace = true [features] default = ["mint", "wallet"] mint = ["cashu/mint"] -blocking = ["dep:once_cell"] wallet = ["cashu/wallet", "dep:minreq", "dep:once_cell"] nut07 = ["cashu/nut07"] # nut08 = ["cashu/nut08"] diff --git a/crates/cashu-sdk/src/client/blocking.rs b/crates/cashu-sdk/src/client/blocking.rs deleted file mode 100644 index 1f802722..00000000 --- a/crates/cashu-sdk/src/client/blocking.rs +++ /dev/null @@ -1,80 +0,0 @@ -use cashu::nuts::nut00::wallet::BlindedMessages; -use cashu::nuts::nut00::{BlindedMessage, Proof}; -use cashu::nuts::nut01::Keys; -use cashu::nuts::nut02; -use cashu::nuts::nut03::RequestMintResponse; -use cashu::nuts::nut04::PostMintResponse; -use cashu::nuts::nut05::CheckFeesResponse; -use cashu::nuts::nut06::{SplitRequest, SplitResponse}; -#[cfg(feature = "nut07")] -use cashu::nuts::nut07::CheckSpendableResponse; -use cashu::nuts::nut08::MeltResponse; -#[cfg(feature = "nut09")] -use cashu::nuts::nut09::MintInfo; -use cashu::{Amount, Bolt11Invoice}; - -use super::Error; -use crate::RUNTIME; - -#[derive(Debug, Clone)] -pub struct Client { - pub(crate) client: super::Client, -} - -impl Client { - pub fn new(mint_url: &str) -> Result { - Ok(Self { - client: super::Client::new(mint_url)?, - }) - } - - pub fn get_keys(&self) -> Result { - RUNTIME.block_on(async { self.client.get_keys().await }) - } - - pub fn get_keysets(&self) -> Result { - RUNTIME.block_on(async { self.client.get_keysets().await }) - } - - pub fn request_mint(&self, amount: Amount) -> Result { - RUNTIME.block_on(async { self.client.request_mint(amount).await }) - } - - pub fn mint( - &self, - blinded_messages: BlindedMessages, - hash: &str, - ) -> Result { - RUNTIME.block_on(async { self.client.mint(blinded_messages, hash).await }) - } - - pub fn check_fees(&self, invoice: Bolt11Invoice) -> Result { - RUNTIME.block_on(async { self.client.check_fees(invoice).await }) - } - - pub fn melt( - &self, - proofs: Vec, - invoice: Bolt11Invoice, - outputs: Option>, - ) -> Result { - RUNTIME.block_on(async { self.client.melt(proofs, invoice, outputs).await }) - } - - pub fn split(&self, split_request: SplitRequest) -> Result { - RUNTIME.block_on(async { self.client.split(split_request).await }) - } - - #[cfg(feature = "nut07")] - pub fn check_spendable( - &self, - proofs: &Vec, - ) -> Result { - RUNTIME.block_on(async { self.client.check_spendable(proofs).await }) - } - - #[cfg(feature = "nut09")] - pub fn get_info(&self) -> Result { - RUNTIME.block_on(async { self.client.get_info().await }) - } -} diff --git a/crates/cashu-sdk/src/client/mod.rs b/crates/cashu-sdk/src/client/mod.rs index 0499e2e4..062e3ca1 100644 --- a/crates/cashu-sdk/src/client/mod.rs +++ b/crates/cashu-sdk/src/client/mod.rs @@ -21,8 +21,6 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use url::Url; -#[cfg(feature = "blocking")] -pub mod blocking; #[cfg(not(target_arch = "wasm32"))] pub mod minreq_client;