From cf9bf49685d144b6dad9662d6cd459e6314616c0 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Sat, 2 Sep 2023 09:56:14 +0100 Subject: [PATCH] bindings: `MintVersion` feilds --- bindings/cashu-ffi/src/cashu.udl | 8 ++++++ bindings/cashu-ffi/src/nuts/nut09/mod.rs | 32 ++++++++++++++++++++++++ bindings/cashu-sdk-ffi/src/cashu_sdk.udl | 8 ++++++ 3 files changed, 48 insertions(+) diff --git a/bindings/cashu-ffi/src/cashu.udl b/bindings/cashu-ffi/src/cashu.udl index 270f42c6..07fd6833 100644 --- a/bindings/cashu-ffi/src/cashu.udl +++ b/bindings/cashu-ffi/src/cashu.udl @@ -214,6 +214,14 @@ interface MintVersion { interface MintInfo { constructor(string? name, PublicKey? pubkey, MintVersion? version, string? description, string? description_long, sequence>? contact, sequence nuts, string? motd); + string? name(); + PublicKey? pubkey(); + MintVersion? version(); + string? description(); + string? description_long(); + sequence>? contact(); + sequence nuts(); + string? motd(); }; enum InvoiceStatus { diff --git a/bindings/cashu-ffi/src/nuts/nut09/mod.rs b/bindings/cashu-ffi/src/nuts/nut09/mod.rs index d8e31e90..28d24594 100644 --- a/bindings/cashu-ffi/src/nuts/nut09/mod.rs +++ b/bindings/cashu-ffi/src/nuts/nut09/mod.rs @@ -73,6 +73,38 @@ impl MintInfo { }, } } + + pub fn name(&self) -> Option { + self.inner.name.clone() + } + + pub fn pubkey(&self) -> Option> { + self.inner.pubkey.clone().map(|p| Arc::new(p.into())) + } + + pub fn version(&self) -> Option> { + self.inner.version.clone().map(|v| Arc::new(v.into())) + } + + pub fn description(&self) -> Option { + self.inner.description.clone() + } + + pub fn description_long(&self) -> Option { + self.inner.description_long.clone() + } + + pub fn contact(&self) -> Option>> { + self.inner.contact.clone() + } + + pub fn nuts(&self) -> Vec { + self.inner.nuts.clone() + } + + pub fn motd(&self) -> Option { + self.inner.motd.clone() + } } impl From for MintInfo { diff --git a/bindings/cashu-sdk-ffi/src/cashu_sdk.udl b/bindings/cashu-sdk-ffi/src/cashu_sdk.udl index a4764e5c..65eb5895 100644 --- a/bindings/cashu-sdk-ffi/src/cashu_sdk.udl +++ b/bindings/cashu-sdk-ffi/src/cashu_sdk.udl @@ -217,6 +217,14 @@ interface MintVersion { interface MintInfo { constructor(string? name, PublicKey? pubkey, MintVersion? version, string? description, string? description_long, sequence>? contact, sequence nuts, string? motd); + string? name(); + PublicKey? pubkey(); + MintVersion? version(); + string? description(); + string? description_long(); + sequence>? contact(); + sequence nuts(); + string? motd(); }; enum InvoiceStatus {