Selaa lähdekoodia

feat: have check mint quote return MintQuote in bindings (#1633)

tsk 3 viikkoa sitten
vanhempi
säilyke
b53dbe8478

+ 2 - 2
crates/cdk-ffi/src/npubcash.rs

@@ -25,7 +25,7 @@ impl NpubCashClient {
     ///
     /// # Arguments
     ///
-    /// * `base_url` - Base URL of the NpubCash service (e.g., "https://npub.cash")
+    /// * `base_url` - Base URL of the NpubCash service (e.g., <https://npub.cash>)
     /// * `nostr_secret_key` - Nostr secret key for authentication. Accepts either:
     ///   - Hex-encoded secret key (64 characters)
     ///   - Bech32 `nsec` format (e.g., "nsec1...")
@@ -74,7 +74,7 @@ impl NpubCashClient {
     ///
     /// # Arguments
     ///
-    /// * `mint_url` - URL of the Cashu mint to use (e.g., "https://mint.example.com")
+    /// * `mint_url` - URL of the Cashu mint to use (e.g., <https://mint.example.com>)
     ///
     /// # Errors
     ///

+ 5 - 4
crates/cdk-ffi/src/wallet.rs

@@ -229,10 +229,11 @@ impl Wallet {
     /// Updates local store with current state from mint.
     /// If there was a crashed mid-mint (pending saga), attempts to complete it.
     /// Does NOT mint tokens directly - use mint() for that.
-    pub async fn check_mint_quote(
-        &self,
-        quote_id: String,
-    ) -> Result<MintQuoteBolt11Response, FfiError> {
+    ///
+    /// **Note:** The mint quote must be known to the wallet (stored locally) for this
+    /// function to work. If the quote is not stored locally, use `fetch_mint_quote`
+    /// instead.
+    pub async fn check_mint_quote(&self, quote_id: String) -> Result<MintQuote, FfiError> {
         let quote = self.inner.check_mint_quote_status(&quote_id).await?;
         Ok(quote.into())
     }

+ 4 - 0
crates/cdk/src/wallet/issue/mod.rs

@@ -238,6 +238,10 @@ impl Wallet {
     /// Updates local store with current state from mint.
     /// If there was a crashed mid-mint (pending saga), attempts to complete it.
     /// Does NOT mint tokens directly - use mint() for that.
+    ///
+    /// **Note:** The mint quote must be known to the wallet (stored locally) for this
+    /// function to work. If the quote is not stored locally, use `fetch_mint_quote`
+    /// instead.
     #[instrument(skip(self, quote_id))]
     pub async fn check_mint_quote_status(&self, quote_id: &str) -> Result<MintQuote, Error> {
         let mint_quote = self