Struct polymesh_api_client::client::Client
source · pub struct Client { /* private fields */ }
Implementations§
source§impl Client
impl Client
pub async fn new(url: &str) -> Result<Self>
pub fn get_transaction_version(&self) -> i64
pub fn get_metadata(&self) -> &RuntimeMetadataPrefixed
pub fn get_genesis_hash(&self) -> BlockHash
pub async fn get_additional_signed( &self, lifetime: Option<u64> ) -> Result<(AdditionalSigned, Era)>
sourcepub async fn get_system_properties(&self) -> Result<SystemProperties>
pub async fn get_system_properties(&self) -> Result<SystemProperties>
Get the SystemProperties
of the chain.
pub async fn get_storage_keys_paged( &self, prefix: &StorageKey, count: usize, start_key: Option<&StorageKey>, at: Option<BlockHash> ) -> Result<Vec<StorageKey>>
pub async fn get_storage_by_key<T: Decode>( &self, key: StorageKey, at: Option<BlockHash> ) -> Result<Option<T>>
pub async fn get_storage_data_by_key( &self, key: StorageKey, at: Option<BlockHash> ) -> Result<Option<StorageData>>
sourcepub async fn subscribe_blocks(&self) -> Result<Subscription<Header>>
pub async fn subscribe_blocks(&self) -> Result<Subscription<Header>>
Subscribe to new blocks.
sourcepub async fn subscribe_finalized_blocks(&self) -> Result<Subscription<Header>>
pub async fn subscribe_finalized_blocks(&self) -> Result<Subscription<Header>>
Subscribe to new finalized blocks.
sourcepub async fn submit_and_watch(
&self,
tx_hex: String
) -> Result<Subscription<TransactionStatus>>
pub async fn submit_and_watch( &self, tx_hex: String ) -> Result<Subscription<TransactionStatus>>
Submit and watch a transaction.
sourcepub async fn request<'a, R>(
&self,
method: &'a str,
params: ArrayParams
) -> Result<R>where
R: DeserializeOwned,
pub async fn request<'a, R>(
&self,
method: &'a str,
params: ArrayParams
) -> Result<R>where
R: DeserializeOwned,
Make a RPC request to the node.
sourcepub async fn batch_request<'a, R>(
&self,
batch: BatchRequestBuilder<'a>
) -> Result<BatchResponse<'a, R>>
pub async fn batch_request<'a, R>( &self, batch: BatchRequestBuilder<'a> ) -> Result<BatchResponse<'a, R>>
Make a batch of RPC requests to the node.
sourcepub async fn subscribe<'a, Notif>(
&self,
subscribe_method: &'a str,
params: ArrayParams,
unsubscribe_method: &'a str
) -> Result<Subscription<Notif>>where
Notif: DeserializeOwned,
pub async fn subscribe<'a, Notif>(
&self,
subscribe_method: &'a str,
params: ArrayParams,
unsubscribe_method: &'a str
) -> Result<Subscription<Notif>>where
Notif: DeserializeOwned,
Subscribe to RPC updates.
sourcepub async fn get_finalized_block(&self) -> Result<BlockHash>
pub async fn get_finalized_block(&self) -> Result<BlockHash>
Get the current finalized block hash.
sourcepub async fn get_signed_block(
&self,
block: Option<BlockHash>
) -> Result<Option<SignedBlock>>
pub async fn get_signed_block( &self, block: Option<BlockHash> ) -> Result<Option<SignedBlock>>
Get a block.
sourcepub async fn find_extrinsic_block_index(
&self,
block: BlockHash,
tx_hash: TxHash
) -> Result<Option<usize>>
pub async fn find_extrinsic_block_index( &self, block: BlockHash, tx_hash: TxHash ) -> Result<Option<usize>>
Get find extrinsic index in block. The extrinsic index is used to filter the block events for that extrinsic.
sourcepub async fn get_block_header(
&self,
block: Option<BlockHash>
) -> Result<Option<Header>>
pub async fn get_block_header( &self, block: Option<BlockHash> ) -> Result<Option<Header>>
Get the header of a block.
sourcepub async fn get_block_hash(
&self,
block_number: u32
) -> Result<Option<BlockHash>>
pub async fn get_block_hash( &self, block_number: u32 ) -> Result<Option<BlockHash>>
Get the block hash for a block_number
.
sourcepub async fn subscribe_runtime_version(
&self
) -> Result<Subscription<RuntimeVersion>>
pub async fn subscribe_runtime_version( &self ) -> Result<Subscription<RuntimeVersion>>
Subscribe to RuntimeVersion updates.
sourcepub async fn get_block_runtime_version(
&self,
block: Option<BlockHash>
) -> Result<Option<RuntimeVersion>>
pub async fn get_block_runtime_version( &self, block: Option<BlockHash> ) -> Result<Option<RuntimeVersion>>
Get the RuntimeVersion of a block.
sourcepub async fn get_block_metadata(
&self,
block: Option<BlockHash>
) -> Result<Option<RuntimeMetadataPrefixed>>
pub async fn get_block_metadata( &self, block: Option<BlockHash> ) -> Result<Option<RuntimeMetadataPrefixed>>
Get the RuntimeMetadata of a block.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
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
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of
T
.