Browse Source

feat(bindings): getters for mint quote response

thesimplekid 9 tháng trước cách đây
mục cha
commit
a8c2ef9b5a
1 tập tin đã thay đổi với 23 bổ sung0 xóa
  1. 23 0
      bindings/cdk-js/src/nuts/nut04.rs

+ 23 - 0
bindings/cdk-js/src/nuts/nut04.rs

@@ -43,6 +43,29 @@ impl From<MintQuoteBolt11Response> for JsMintQuoteBolt11Response {
     }
     }
 }
 }
 
 
+#[wasm_bindgen(js_class = MintQuoteBolt11Response)]
+impl JsMintQuoteBolt11Response {
+    #[wasm_bindgen(getter)]
+    pub fn paid(&self) -> bool {
+        self.inner.paid
+    }
+
+    #[wasm_bindgen(getter)]
+    pub fn quote(&self) -> String {
+        self.inner.quote.clone()
+    }
+
+    #[wasm_bindgen(getter)]
+    pub fn request(&self) -> String {
+        self.inner.request.clone()
+    }
+
+    #[wasm_bindgen(getter)]
+    pub fn expiry(&self) -> Option<u64> {
+        self.inner.expiry
+    }
+}
+
 #[wasm_bindgen(js_name = MintBolt11Request)]
 #[wasm_bindgen(js_name = MintBolt11Request)]
 pub struct JsMintBolt11Request {
 pub struct JsMintBolt11Request {
     inner: MintBolt11Request,
     inner: MintBolt11Request,