feat: implement nut-06 time

This commit is contained in:
Pavol Rusnak
2024-09-02 18:43:36 +02:00
committed by thesimplekid
parent 69be0838c4
commit e67dc15ce6
5 changed files with 33 additions and 4 deletions

View File

@@ -79,6 +79,7 @@ impl JsMintInfo {
nuts: JsValue,
mint_icon_url: Option<String>,
motd: Option<String>,
time: Option<u64>,
) -> Result<JsMintInfo> {
Ok(JsMintInfo {
inner: MintInfo {
@@ -92,6 +93,7 @@ impl JsMintInfo {
nuts: serde_wasm_bindgen::from_value(nuts).map_err(into_err)?,
mint_icon_url,
motd,
time,
},
})
}
@@ -152,6 +154,12 @@ impl JsMintInfo {
pub fn motd(&self) -> Option<String> {
self.inner.motd.clone()
}
/// Get time
#[wasm_bindgen(getter)]
pub fn time(&self) -> Option<u64> {
self.inner.time
}
}
#[wasm_bindgen(js_name = ContactInfo)]