Преглед на файлове

feat(bindings): getters for mint quote response

thesimplekid преди 9 месеца
родител
ревизия
a8c2ef9b5a
променени са 1 файла, в които са добавени 23 реда и са изтрити 0 реда
  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)]
 pub struct JsMintBolt11Request {
     inner: MintBolt11Request,