Cesar Rodas 6 天之前
父節點
當前提交
252d5604ce
共有 1 個文件被更改,包括 15 次插入0 次删除
  1. 15 0
      crates/cdk/src/wallet/melt.rs

+ 15 - 0
crates/cdk/src/wallet/melt.rs

@@ -112,6 +112,21 @@ impl Wallet {
         Ok(response)
     }
 
+    /// Melt a quote
+    #[instrument(skip(self))]
+    pub async fn melt(&self, quote_id: &str) -> Result<Melted, Error> {
+        let quote_info = self
+            .localstore
+            .get_melt_quote(quote_id)
+            .await?
+            .ok_or(Error::UnknownQuote)?;
+        ensure_cdk!(
+            quote_info.expiry.gt(&unix_time()),
+            Error::ExpiredQuote(quote_info.expiry, unix_time())
+        );
+        todo!()
+    }
+
     /// Melt specific proofs
     #[instrument(skip(self, proofs))]
     pub async fn melt_proofs(&self, quote_id: &str, proofs: Proofs) -> Result<Melted, Error> {