Эх сурвалжийг харах

FIX: `NUT04` breaking change

thesimplekid 1 жил өмнө
parent
commit
d138135613
3 өөрчлөгдсөн 5 нэмэгдсэн , 13 устгасан
  1. 2 9
      src/cashu_wallet.rs
  2. 2 3
      src/client.rs
  3. 1 1
      src/types.rs

+ 2 - 9
src/cashu_wallet.rs

@@ -45,17 +45,10 @@ impl CashuWallet {
     }
 
     /// Mint Token
-    pub async fn mint_token(
-        &self,
-        amount: Amount,
-        payment_hash: &str,
-    ) -> Result<Vec<Proof>, Error> {
+    pub async fn mint_token(&self, amount: Amount, hash: &str) -> Result<Vec<Proof>, Error> {
         let blinded_messages = BlindedMessages::random(amount)?;
 
-        let mint_res = self
-            .client
-            .mint(blinded_messages.clone(), payment_hash)
-            .await?;
+        let mint_res = self.client.mint(blinded_messages.clone(), hash).await?;
 
         let proofs = construct_proofs(
             mint_res.promises,

+ 2 - 3
src/client.rs

@@ -64,11 +64,10 @@ impl Client {
     pub async fn mint(
         &self,
         blinded_messages: BlindedMessages,
-        payment_hash: &str,
+        hash: &str,
     ) -> Result<PostMintResponse, Error> {
         let mut url = self.mint_url.join("mint")?;
-        url.query_pairs_mut()
-            .append_pair("payment_hash", payment_hash);
+        url.query_pairs_mut().append_pair("hash", hash);
 
         let request = MintRequest {
             outputs: blinded_messages.blinded_messages,

+ 1 - 1
src/types.rs

@@ -136,7 +136,7 @@ pub struct MintKeySets {
 pub struct RequestMintResponse {
     /// Bolt11 payment request
     pub pr: Invoice,
-    /// Hash of Invoice
+    /// Random Hash
     pub hash: String,
 }