From a8c2ef9b5a98fe15aed5b7d639b08d729a64e3ac Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Fri, 24 May 2024 22:02:31 +0100 Subject: [PATCH] feat(bindings): getters for mint quote response --- bindings/cdk-js/src/nuts/nut04.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bindings/cdk-js/src/nuts/nut04.rs b/bindings/cdk-js/src/nuts/nut04.rs index e1ca01b9..ca50981c 100644 --- a/bindings/cdk-js/src/nuts/nut04.rs +++ b/bindings/cdk-js/src/nuts/nut04.rs @@ -43,6 +43,29 @@ impl From 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 { + self.inner.expiry + } +} + #[wasm_bindgen(js_name = MintBolt11Request)] pub struct JsMintBolt11Request { inner: MintBolt11Request,