Struct kaspa_wasm::UtxoContext
source · pub struct UtxoContext { /* private fields */ }
Implementations§
source§impl UtxoContext
impl UtxoContext
pub fn inner(&self) -> &UtxoContext
pub fn context(&self) -> MutexGuard<'_, Context>
source§impl UtxoContext
impl UtxoContext
pub async fn ctor(js_value: JsValue) -> Result<UtxoContext, Error>
sourcepub async fn track_addresses(
&self,
addresses: JsValue,
optional_current_daa_score: JsValue
) -> Result<(), Error>
pub async fn track_addresses( &self, addresses: JsValue, optional_current_daa_score: JsValue ) -> Result<(), Error>
Performs a scan of the given addresses and registers them in the context for event notifications.
sourcepub async fn unregister_addresses(
&self,
addresses: JsValue
) -> Result<(), Error>
pub async fn unregister_addresses( &self, addresses: JsValue ) -> Result<(), Error>
Unregister a list of addresses from the context. This will stop tracking of these addresses.
sourcepub async fn clear(&self) -> Result<(), Error>
pub async fn clear(&self) -> Result<(), Error>
Clear the UtxoContext. Unregisters all addresses and clears all UTXO entries.
sourcepub fn mature(&self) -> Result<Array, Error>
pub fn mature(&self) -> Result<Array, Error>
Returns the mature UTXO entries that are currently in the context.
sourcepub fn pending(&self) -> Result<Array, Error>
pub fn pending(&self) -> Result<Array, Error>
Returns the mature UTXO entries that are currently in the context.
pub fn balance(&self) -> JsValue
pub async fn calculate_balance(&self) -> Balance
Trait Implementations§
source§impl Clone for UtxoContext
impl Clone for UtxoContext
source§fn clone(&self) -> UtxoContext
fn clone(&self) -> UtxoContext
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl From<UtxoContext> for JsValue
impl From<UtxoContext> for JsValue
source§fn from(value: UtxoContext) -> JsValue
fn from(value: UtxoContext) -> JsValue
Converts to this type from the input type.
source§impl From<UtxoContext> for UtxoContext
impl From<UtxoContext> for UtxoContext
source§fn from(inner: UtxoContext) -> UtxoContext
fn from(inner: UtxoContext) -> UtxoContext
Converts to this type from the input type.
source§impl FromWasmAbi for UtxoContext
impl FromWasmAbi for UtxoContext
source§impl IntoWasmAbi for UtxoContext
impl IntoWasmAbi for UtxoContext
source§impl LongRefFromWasmAbi for UtxoContext
impl LongRefFromWasmAbi for UtxoContext
§type Anchor = Ref<'static, UtxoContext>
type Anchor = Ref<'static, UtxoContext>
Same as
RefFromWasmAbi::Anchor
source§unsafe fn long_ref_from_abi(
js: <UtxoContext as LongRefFromWasmAbi>::Abi
) -> <UtxoContext as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <UtxoContext as LongRefFromWasmAbi>::Abi ) -> <UtxoContext as LongRefFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
source§impl OptionFromWasmAbi for UtxoContext
impl OptionFromWasmAbi for UtxoContext
source§fn is_none(abi: &<UtxoContext as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<UtxoContext as FromWasmAbi>::Abi) -> bool
Tests whether the argument is a “none” instance. If so it will be
deserialized as
None
, and otherwise it will be passed to
FromWasmAbi
.source§impl OptionIntoWasmAbi for UtxoContext
impl OptionIntoWasmAbi for UtxoContext
source§fn none() -> <UtxoContext as IntoWasmAbi>::Abi
fn none() -> <UtxoContext as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the
None
branch of this option. Read moresource§impl RefFromWasmAbi for UtxoContext
impl RefFromWasmAbi for UtxoContext
§type Anchor = Ref<'static, UtxoContext>
type Anchor = Ref<'static, UtxoContext>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.source§unsafe fn ref_from_abi(
js: <UtxoContext as RefFromWasmAbi>::Abi
) -> <UtxoContext as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <UtxoContext as RefFromWasmAbi>::Abi ) -> <UtxoContext as RefFromWasmAbi>::Anchor
source§impl RefMutFromWasmAbi for UtxoContext
impl RefMutFromWasmAbi for UtxoContext
§type Anchor = RefMut<'static, UtxoContext>
type Anchor = RefMut<'static, UtxoContext>
Same as
RefFromWasmAbi::Anchor
source§unsafe fn ref_mut_from_abi(
js: <UtxoContext as RefMutFromWasmAbi>::Abi
) -> <UtxoContext as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <UtxoContext as RefMutFromWasmAbi>::Abi ) -> <UtxoContext as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abi
Auto Trait Implementations§
impl !RefUnwindSafe for UtxoContext
impl Send for UtxoContext
impl Sync for UtxoContext
impl Unpin for UtxoContext
impl !UnwindSafe for UtxoContext
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> ExactFrom<T> for Uwhere
U: TryFrom<T>,
fn exact_from(value: T) -> U
§impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
impl<T, U> ExactInto<U> for Twhere
U: ExactFrom<T>,
fn exact_into(self) -> U
§impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
impl<T, U> OverflowingInto<U> for Twhere
U: OverflowingFrom<T>,
fn overflowing_into(self) -> (U, bool)
source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.