Trait sc_rpc_spec_v2::archive::api::ArchiveApiServer
source · pub trait ArchiveApiServer<Hash>: Sized + Send + Sync + 'static {
// Required methods
fn archive_unstable_body(
&self,
hash: Hash
) -> RpcResult<Option<Vec<String>>>;
fn archive_unstable_genesis_hash(&self) -> RpcResult<String>;
fn archive_unstable_header(&self, hash: Hash) -> RpcResult<Option<String>>;
fn archive_unstable_finalized_height(&self) -> RpcResult<u64>;
fn archive_unstable_hash_by_height(
&self,
height: u64
) -> RpcResult<Vec<String>>;
fn archive_unstable_call(
&self,
hash: Hash,
function: String,
call_parameters: String
) -> RpcResult<MethodResult>;
fn archive_unstable_storage(
&self,
hash: Hash,
items: Vec<PaginatedStorageQuery<String>>,
child_trie: Option<String>
) -> RpcResult<ArchiveStorageResult>;
// Provided method
fn into_rpc(self) -> RpcModule<Self>
where Hash: Send + Sync + 'static + DeserializeOwned { ... }
}
Expand description
Server trait implementation for the ArchiveApi
RPC API.
Required Methods§
sourcefn archive_unstable_body(&self, hash: Hash) -> RpcResult<Option<Vec<String>>>
fn archive_unstable_body(&self, hash: Hash) -> RpcResult<Option<Vec<String>>>
Retrieves the body (list of transactions) of a given block hash.
Returns an array of strings containing the hexadecimal-encoded SCALE-codec-encoded transactions in that block. If no block with that hash is found, null.
§Unstable
This method is unstable and subject to change in the future.
sourcefn archive_unstable_genesis_hash(&self) -> RpcResult<String>
fn archive_unstable_genesis_hash(&self) -> RpcResult<String>
Get the chain’s genesis hash.
Returns a string containing the hexadecimal-encoded hash of the genesis block of the chain.
§Unstable
This method is unstable and subject to change in the future.
sourcefn archive_unstable_header(&self, hash: Hash) -> RpcResult<Option<String>>
fn archive_unstable_header(&self, hash: Hash) -> RpcResult<Option<String>>
Get the block’s header.
Returns a string containing the hexadecimal-encoded SCALE-codec encoding header of the block.
§Unstable
This method is unstable and subject to change in the future.
sourcefn archive_unstable_finalized_height(&self) -> RpcResult<u64>
fn archive_unstable_finalized_height(&self) -> RpcResult<u64>
Get the height of the current finalized block.
Returns an integer height of the current finalized block of the chain.
§Unstable
This method is unstable and subject to change in the future.
sourcefn archive_unstable_hash_by_height(&self, height: u64) -> RpcResult<Vec<String>>
fn archive_unstable_hash_by_height(&self, height: u64) -> RpcResult<Vec<String>>
Get the hashes of blocks from the given height.
Returns an array (possibly empty) of strings containing an hexadecimal-encoded hash of a block header.
§Unstable
This method is unstable and subject to change in the future.
sourcefn archive_unstable_call(
&self,
hash: Hash,
function: String,
call_parameters: String
) -> RpcResult<MethodResult>
fn archive_unstable_call( &self, hash: Hash, function: String, call_parameters: String ) -> RpcResult<MethodResult>
Call into the Runtime API at a specified block’s state.
§Unstable
This method is unstable and subject to change in the future.