Struct kaspa_wrpc_client::wasm::RpcClient
source · pub struct RpcClient { /* private fields */ }Expand description
Kaspa RPC client
Implementations§
source§impl RpcClient
impl RpcClient
sourcepub fn new(encoding: Encoding, url: &str) -> RpcClient
pub fn new(encoding: Encoding, url: &str) -> RpcClient
Create a new RPC client with Encoding and a url.
sourcepub async fn connect(&self) -> Result<(), JsError>
pub async fn connect(&self) -> Result<(), JsError>
Connect to the Kaspa RPC server. This function starts a background
task that connects and reconnects to the server if the connection
is terminated. Use [disconnect()] to terminate the connection.
sourcepub async fn disconnect(&self) -> Result<(), JsError>
pub async fn disconnect(&self) -> Result<(), JsError>
Disconnect from the Kaspa RPC server.
source§impl RpcClient
impl RpcClient
sourcepub async fn subscribe_daa_score(&self) -> Result<(), JsError>
pub async fn subscribe_daa_score(&self) -> Result<(), JsError>
Subscription to DAA Score (test)
sourcepub async fn unsubscribe_daa_score(&self) -> Result<(), JsError>
pub async fn unsubscribe_daa_score(&self) -> Result<(), JsError>
Unsubscribe from DAA Score (test)
sourcepub async fn subscribe_utxos_changed(
&self,
addresses: &JsValue
) -> Result<(), JsError>
pub async fn subscribe_utxos_changed( &self, addresses: &JsValue ) -> Result<(), JsError>
Subscription to UTXOs Changed notifications
sourcepub async fn unsubscribe_utxos_changed(
&self,
addresses: &JsValue
) -> Result<(), JsError>
pub async fn unsubscribe_utxos_changed( &self, addresses: &JsValue ) -> Result<(), JsError>
Unsubscribe from DAA Score (test)
pub async fn subscribe_virtual_chain_changed( &self, include_accepted_transaction_ids: bool ) -> Result<(), JsError>
pub async fn unsubscribe_virtual_chain_changed( &self, include_accepted_transaction_ids: bool ) -> Result<(), JsError>
source§impl RpcClient
impl RpcClient
pub async fn subscribe_block_added(&self) -> Result<(), JsError>
pub async fn unsubscribe_block_added(&self) -> Result<(), JsError>
pub async fn subscribe_finality_conflict(&self) -> Result<(), JsError>
pub async fn unsubscribe_finality_conflict(&self) -> Result<(), JsError>
pub async fn subscribe_finality_conflict_resolved(&self) -> Result<(), JsError>
pub async fn unsubscribe_finality_conflict_resolved( &self ) -> Result<(), JsError>
pub async fn subscribe_sink_blue_score_changed(&self) -> Result<(), JsError>
pub async fn unsubscribe_sink_blue_score_changed(&self) -> Result<(), JsError>
pub async fn subscribe_virtual_daa_score_changed(&self) -> Result<(), JsError>
pub async fn unsubscribe_virtual_daa_score_changed(&self) -> Result<(), JsError>
pub async fn subscribe_pruning_point_utxo_set_override( &self ) -> Result<(), JsError>
pub async fn unsubscribe_pruning_point_utxo_set_override( &self ) -> Result<(), JsError>
pub async fn subscribe_new_block_template(&self) -> Result<(), JsError>
pub async fn unsubscribe_new_block_template(&self) -> Result<(), JsError>
source§impl RpcClient
impl RpcClient
pub async fn get_block_count(&self) -> Result<JsValue, JsError>
pub async fn get_block_dag_info(&self) -> Result<JsValue, JsError>
pub async fn get_coin_supply(&self) -> Result<JsValue, JsError>
pub async fn get_connected_peer_info(&self) -> Result<JsValue, JsError>
pub async fn get_info(&self) -> Result<JsValue, JsError>
pub async fn get_peer_addresses(&self) -> Result<JsValue, JsError>
pub async fn get_process_metrics(&self) -> Result<JsValue, JsError>
pub async fn get_selected_tip_hash(&self) -> Result<JsValue, JsError>
pub async fn get_sink_blue_score(&self) -> Result<JsValue, JsError>
pub async fn ping(&self) -> Result<JsValue, JsError>
pub async fn shutdown(&self) -> Result<JsValue, JsError>
pub async fn add_peer(&self, request: JsValue) -> Result<JsValue, JsError>
pub async fn ban(&self, request: JsValue) -> Result<JsValue, JsError>
pub async fn estimate_network_hashes_per_second( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn get_balance_by_address( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn get_balances_by_addresses( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn get_block(&self, request: JsValue) -> Result<JsValue, JsError>
pub async fn get_blocks(&self, request: JsValue) -> Result<JsValue, JsError>
pub async fn get_block_template( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn get_current_network( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn get_headers(&self, request: JsValue) -> Result<JsValue, JsError>
pub async fn get_mempool_entries( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn get_mempool_entries_by_addresses( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn get_mempool_entry( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn get_subnetwork(&self, request: JsValue) -> Result<JsValue, JsError>
pub async fn get_virtual_chain_from_block( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn resolve_finality_conflict( &self, request: JsValue ) -> Result<JsValue, JsError>
pub async fn submit_block(&self, request: JsValue) -> Result<JsValue, JsError>
pub async fn unban(&self, request: JsValue) -> Result<JsValue, JsError>
Trait Implementations§
source§impl FromWasmAbi for RpcClient
impl FromWasmAbi for RpcClient
source§impl IntoWasmAbi for RpcClient
impl IntoWasmAbi for RpcClient
source§impl LongRefFromWasmAbi for RpcClient
impl LongRefFromWasmAbi for RpcClient
source§impl OptionFromWasmAbi for RpcClient
impl OptionFromWasmAbi for RpcClient
source§impl OptionIntoWasmAbi for RpcClient
impl OptionIntoWasmAbi for RpcClient
source§impl RefFromWasmAbi for RpcClient
impl RefFromWasmAbi for RpcClient
source§impl RefMutFromWasmAbi for RpcClient
impl RefMutFromWasmAbi for RpcClient
Auto Trait Implementations§
impl !RefUnwindSafe for RpcClient
impl Send for RpcClient
impl Sync for RpcClient
impl Unpin for RpcClient
impl !UnwindSafe for RpcClient
Blanket Implementations§
§impl<T> CastFrom for Twhere
T: Any + 'static,
impl<T> CastFrom for Twhere T: Any + 'static,
§fn ref_any(&self) -> &(dyn Any + 'static)
fn ref_any(&self) -> &(dyn Any + 'static)
Returns a immutable reference to
Any, which is backed by the type implementing this trait.§fn mut_any(&mut self) -> &mut (dyn Any + 'static)
fn mut_any(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to
Any, which is backed by the type implementing this trait.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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 + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
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, 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::Abisource§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.