Trait sc_rpc::chain::ChainApiClient
source · pub trait ChainApiClient<Number, Hash, Header, SignedBlock>: SubscriptionClientTwhere
Number: 'static + Send + Sync,
Hash: 'static + Send + Sync + Serialize + DeserializeOwned,
Header: 'static + Send + Sync + DeserializeOwned,
SignedBlock: 'static + Send + Sync + DeserializeOwned,{
fn header<'life0, 'async_trait>(
&'life0 self,
hash: Option<Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<Header>, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait + Sync,
{ ... }
fn block<'life0, 'async_trait>(
&'life0 self,
hash: Option<Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock>, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait + Sync,
{ ... }
fn block_hash<'life0, 'async_trait>(
&'life0 self,
hash: Option<ListOrValue<NumberOrHex>>
) -> Pin<Box<dyn Future<Output = Result<ListOrValue<Option<Hash>>, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait + Sync,
{ ... }
fn finalized_head<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Hash, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait + Sync,
{ ... }
fn subscribe_all_heads<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Subscription<Header>, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait + Sync,
{ ... }
fn subscribe_new_heads<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Subscription<Header>, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait + Sync,
{ ... }
fn subscribe_finalized_heads<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Subscription<Header>, Error>> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
Self: 'async_trait + Sync,
{ ... }
}
Expand description
Client implementation for the ChainApi
RPC API.
Provided Methods§
sourcefn header<'life0, 'async_trait>(
&'life0 self,
hash: Option<Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<Header>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
fn header<'life0, 'async_trait>(
&'life0 self,
hash: Option<Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<Header>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
Get header.
sourcefn block<'life0, 'async_trait>(
&'life0 self,
hash: Option<Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
fn block<'life0, 'async_trait>(
&'life0 self,
hash: Option<Hash>
) -> Pin<Box<dyn Future<Output = Result<Option<SignedBlock>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
Get header and body of a relay chain block.
sourcefn block_hash<'life0, 'async_trait>(
&'life0 self,
hash: Option<ListOrValue<NumberOrHex>>
) -> Pin<Box<dyn Future<Output = Result<ListOrValue<Option<Hash>>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
fn block_hash<'life0, 'async_trait>(
&'life0 self,
hash: Option<ListOrValue<NumberOrHex>>
) -> Pin<Box<dyn Future<Output = Result<ListOrValue<Option<Hash>>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
Get hash of the n-th block in the canon chain.
By default returns latest block hash.
sourcefn finalized_head<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Hash, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
fn finalized_head<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Hash, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
Get hash of the last finalized block in the canon chain.
sourcefn subscribe_all_heads<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Subscription<Header>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
fn subscribe_all_heads<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Subscription<Header>, Error>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait + Sync,
All head subscription.