Skip to content

Commit

Permalink
Add ìd` getter to UtxoContext
Browse files Browse the repository at this point in the history
  • Loading branch information
KaffinPX committed Oct 22, 2024
1 parent fb61ea9 commit bc1ddae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions wallet/core/src/wasm/utxo/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit bc1ddae

Please sign in to comment.