Trait sc_rpc::chain::ChainApi [−][src]
Substrate blockchain API
Associated Types
type Metadata: PubSubMetadata
[src][−]
RPC metadata
Required methods
pub fn header(
&self,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<Header>> + 'static + Send, Global>
[src][−]
&self,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<Header>> + 'static + Send, Global>
Get header of a relay chain block.
pub fn block(
&self,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<SignedBlock>> + 'static + Send, Global>
[src][−]
&self,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<SignedBlock>> + 'static + Send, Global>
Get header and body of a relay chain block.
pub fn block_hash(
&self,
hash: Option<ListOrValue<NumberOrHex>>
) -> Result<ListOrValue<Option<Hash>>, Error>
[src][−]
&self,
hash: Option<ListOrValue<NumberOrHex>>
) -> Result<ListOrValue<Option<Hash>>, Error>
Get hash of the n-th block in the canon chain.
By default returns latest block hash.
pub fn finalized_head(&self) -> Result<Hash, Error>
[src][−]
Get hash of the last finalized block in the canon chain.
pub fn subscribe_all_heads(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Header, Error>
)
[src][−]
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Header, Error>
)
All head subscription
pub fn unsubscribe_all_heads(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
[src][−]
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
Unsubscribe from all head subscription.
pub fn subscribe_new_heads(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Header, Error>
)
[src][−]
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Header, Error>
)
New head subscription
pub fn unsubscribe_new_heads(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
[src][−]
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
Unsubscribe from new head subscription.
pub fn subscribe_finalized_heads(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Header, Error>
)
[src][−]
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Header, Error>
)
Finalized head subscription
pub fn unsubscribe_finalized_heads(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
[src][−]
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
Unsubscribe from finalized head subscription.
Provided methods
pub fn to_delegate(self) -> IoDelegate<Self, Self::Metadata> where
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
SignedBlock: Send + Sync + 'static + Serialize,
Header: Send + Sync + 'static + Serialize,
Number: Send + Sync + 'static,
[src][−]
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
SignedBlock: Send + Sync + 'static + Serialize,
Header: Send + Sync + 'static + Serialize,
Number: Send + Sync + 'static,
Create an IoDelegate
, wiring rpc calls to the trait methods.