From bc1ddae5153c4152a6959bd9da8d659d5a53f740 Mon Sep 17 00:00:00 2001 From: KaffinPX Date: Wed, 23 Oct 2024 02:11:53 +0300 Subject: [PATCH] =?UTF-8?q?Add=20`=C3=ACd``=20getter=20to=20UtxoContext?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wallet/core/src/wasm/utxo/context.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wallet/core/src/wasm/utxo/context.rs b/wallet/core/src/wasm/utxo/context.rs index 3298a4829..6fd7b3784 100644 --- a/wallet/core/src/wasm/utxo/context.rs +++ b/wallet/core/src/wasm/utxo/context.rs @@ -8,6 +8,7 @@ use kaspa_addresses::AddressOrStringArrayT; use kaspa_consensus_client::UtxoEntryReferenceArrayT; use kaspa_hashes::Hash; use kaspa_wallet_macros::declare_typescript_wasm_interface as declare; +use kaspa_wasm_core::types::HexString; declare! { IUtxoContextArgs, @@ -147,6 +148,12 @@ impl UtxoContext { self.inner().clear().await } + /// Deterministic ID of the context, allows differentiation across event notifications. + #[wasm_bindgen(getter, js_name = "id")] + pub fn id(&self) -> HexString { + self.inner.id().to_hex().into() + } + #[wasm_bindgen(getter, js_name = "isActive")] pub fn active(&self) -> bool { let processor = self.inner().processor();