From bdc1779e09fc91b3e6ce8b70247b54ac9c0685c3 Mon Sep 17 00:00:00 2001 From: Jose D Robles Date: Sat, 5 Aug 2023 08:13:33 +0200 Subject: [PATCH] Adding watcher_unspent_utxos to web interface --- src/web.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/web.rs b/src/web.rs index 5b1eb2d3..1dff7837 100644 --- a/src/web.rs +++ b/src/web.rs @@ -609,6 +609,20 @@ pub mod rgb { } }) } + + #[wasm_bindgen] + pub fn watcher_unspent_utxos(nostr_hex_sk: String, name: String, iface: String) -> Promise { + set_panic_hook(); + + future_to_promise(async move { + match crate::rgb::watcher_unspent_utxos(&nostr_hex_sk, &name, &iface).await { + Ok(result) => Ok(JsValue::from_string( + serde_json::to_string(&result).unwrap(), + )), + Err(err) => Err(JsValue::from_string(err.to_string())), + } + }) + } } pub mod lightning {