Browse Source

refactor: remove nut09 feature

thesimplekid 1 year ago
parent
commit
e557d3ec6d

+ 1 - 2
crates/cashu-sdk/Cargo.toml

@@ -14,10 +14,9 @@ default = ["mint", "wallet", "all-nuts"]
 mint = ["cashu/mint"]
 wallet = ["cashu/wallet", "dep:minreq", "dep:once_cell"]
 gloo = ["dep:gloo"]
-all-nuts = ["nut07", "nut08", "nut09"]
+all-nuts = ["nut07", "nut08"]
 nut07 = ["cashu/nut07"]
 nut08 = ["cashu/nut08"]
-nut09 = ["cashu/nut09"]
 
 
 [dependencies]

+ 1 - 4
crates/cashu-sdk/src/client/gloo_client.rs

@@ -1,11 +1,9 @@
 //! gloo wasm http Client
 
 use async_trait::async_trait;
-#[cfg(feature = "nut09")]
-use cashu::nuts::MintInfo;
 use cashu::nuts::{
     BlindedMessage, Keys, MeltBolt11Request, MeltBolt11Response, MintBolt11Request,
-    MintBolt11Response, PreMintSecrets, Proof, SwapRequest, SwapResponse, *,
+    MintBolt11Response, MintInfo, PreMintSecrets, Proof, SwapRequest, SwapResponse, *,
 };
 #[cfg(feature = "nut07")]
 use cashu::nuts::{CheckSpendableRequest, CheckSpendableResponse};
@@ -183,7 +181,6 @@ impl Client for HttpClient {
     }
 
     /// Get Mint Info [NUT-09]
-    #[cfg(feature = "nut09")]
     async fn get_mint_info(&self, mint_url: Url) -> Result<MintInfo, Error> {
         let url = join_url(mint_url, "info")?;
         let res = Request::get(url.as_str())

+ 1 - 4
crates/cashu-sdk/src/client/minreq_client.rs

@@ -3,11 +3,9 @@
 use std::println;
 
 use async_trait::async_trait;
-#[cfg(feature = "nut09")]
-use cashu::nuts::MintInfo;
 use cashu::nuts::{
     BlindedMessage, Keys, MeltBolt11Request, MeltBolt11Response, MintBolt11Request,
-    MintBolt11Response, PreMintSecrets, Proof, SwapRequest, SwapResponse, *,
+    MintBolt11Response, MintInfo, PreMintSecrets, Proof, SwapRequest, SwapResponse, *,
 };
 #[cfg(feature = "nut07")]
 use cashu::nuts::{CheckSpendableRequest, CheckSpendableResponse};
@@ -148,7 +146,6 @@ impl Client for HttpClient {
     }
 
     /// Get Mint Info [NUT-09]
-    #[cfg(feature = "nut09")]
     async fn get_mint_info(&self, mint_url: Url) -> Result<MintInfo, Error> {
         let url = join_url(mint_url, "v1")?;
         let url = join_url(url, "info")?;

+ 2 - 5
crates/cashu-sdk/src/client/mod.rs

@@ -5,11 +5,9 @@ use async_trait::async_trait;
 use cashu::nuts::nut00;
 #[cfg(feature = "nut07")]
 use cashu::nuts::CheckSpendableResponse;
-#[cfg(feature = "nut09")]
-use cashu::nuts::MintInfo;
 use cashu::nuts::{
-    BlindedMessage, Keys, KeysetResponse, MeltBolt11Response, MintBolt11Response, PreMintSecrets,
-    Proof, SwapRequest, SwapResponse,
+    BlindedMessage, Keys, KeysetResponse, MeltBolt11Response, MintBolt11Response, MintInfo,
+    PreMintSecrets, Proof, SwapRequest, SwapResponse,
 };
 use cashu::utils;
 use serde::{Deserialize, Serialize};
@@ -121,7 +119,6 @@ pub trait Client {
         proofs: Vec<nut00::mint::Proof>,
     ) -> Result<CheckSpendableResponse, Error>;
 
-    #[cfg(feature = "nut09")]
     async fn get_mint_info(&self, mint_url: Url) -> Result<MintInfo, Error>;
 }
 

+ 1 - 2
crates/cashu/Cargo.toml

@@ -15,10 +15,9 @@ description = "Cashu rust wallet and mint library"
 default = ["mint", "wallet", "all-nuts"]
 mint = []
 wallet = []
-all-nuts = ["nut07", "nut08", "nut09"]
+all-nuts = ["nut07", "nut08"]
 nut07 = []
 nut08 = []
-nut09 = []
 
 
 [dependencies]