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.
Implementors
impl<Block, Client> ChainApi<<<Block as Block>::Header as Header>::Number, <Block as Block>::Hash, <Block as Block>::Header, SignedBlock<Block>> for Chain<Block, Client> where
Block: BlockT + 'static,
Client: HeaderBackend<Block> + BlockchainEvents<Block> + 'static,
[src]
Block: BlockT + 'static,
Client: HeaderBackend<Block> + BlockchainEvents<Block> + 'static,
type Metadata = Metadata
fn header(
&self,
hash: Option<Block::Hash>
) -> FutureResult<Option<Block::Header>>
[src]
&self,
hash: Option<Block::Hash>
) -> FutureResult<Option<Block::Header>>
fn block(
&self,
hash: Option<Block::Hash>
) -> FutureResult<Option<SignedBlock<Block>>>
[src]
&self,
hash: Option<Block::Hash>
) -> FutureResult<Option<SignedBlock<Block>>>
fn block_hash(
&self,
number: Option<ListOrValue<NumberOrHex>>
) -> Result<ListOrValue<Option<Block::Hash>>>
[src]
&self,
number: Option<ListOrValue<NumberOrHex>>
) -> Result<ListOrValue<Option<Block::Hash>>>
fn finalized_head(&self) -> Result<Block::Hash>
[src]
fn subscribe_all_heads(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Block::Header>
)
[src]
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Block::Header>
)
fn unsubscribe_all_heads(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>
[src]
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>
fn subscribe_new_heads(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Block::Header>
)
[src]
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Block::Header>
)
fn unsubscribe_new_heads(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>
[src]
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>
fn subscribe_finalized_heads(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Block::Header>
)
[src]
&self,
metadata: Self::Metadata,
subscriber: Subscriber<Block::Header>
)
fn unsubscribe_finalized_heads(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>
[src]
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>