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