Trait sc_rpc_api::child_state::ChildStateApiServer
source · pub trait ChildStateApiServer<Hash>: Sized + Send + Sync + 'static {
// Required methods
fn storage_keys(
&self,
child_storage_key: PrefixedStorageKey,
prefix: StorageKey,
hash: Option<Hash>
) -> RpcResult<Vec<StorageKey>>;
fn storage_keys_paged(
&self,
child_storage_key: PrefixedStorageKey,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>,
hash: Option<Hash>
) -> RpcResult<Vec<StorageKey>>;
fn storage(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> RpcResult<Option<StorageData>>;
fn storage_entries(
&self,
child_storage_key: PrefixedStorageKey,
keys: Vec<StorageKey>,
hash: Option<Hash>
) -> RpcResult<Vec<Option<StorageData>>>;
fn storage_hash(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> RpcResult<Option<Hash>>;
fn storage_size(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> RpcResult<Option<u64>>;
fn read_child_proof(
&self,
child_storage_key: PrefixedStorageKey,
keys: Vec<StorageKey>,
hash: Option<Hash>
) -> RpcResult<ReadProof<Hash>>;
// Provided method
fn into_rpc(self) -> RpcModule<Self>
where Hash: Send + Sync + 'static + DeserializeOwned + Serialize { ... }
}
Expand description
Server trait implementation for the ChildStateApi
RPC API.
Required Methods§
sourcefn storage_keys(
&self,
child_storage_key: PrefixedStorageKey,
prefix: StorageKey,
hash: Option<Hash>
) -> RpcResult<Vec<StorageKey>>
fn storage_keys( &self, child_storage_key: PrefixedStorageKey, prefix: StorageKey, hash: Option<Hash> ) -> RpcResult<Vec<StorageKey>>
Returns the keys with prefix from a child storage, leave empty to get all the keys
sourcefn storage_keys_paged(
&self,
child_storage_key: PrefixedStorageKey,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>,
hash: Option<Hash>
) -> RpcResult<Vec<StorageKey>>
fn storage_keys_paged( &self, child_storage_key: PrefixedStorageKey, prefix: Option<StorageKey>, count: u32, start_key: Option<StorageKey>, hash: Option<Hash> ) -> RpcResult<Vec<StorageKey>>
Returns the keys with prefix from a child storage with pagination support.
Up to count
keys will be returned.
If start_key
is passed, return next keys in storage in lexicographic order.
sourcefn storage(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> RpcResult<Option<StorageData>>
fn storage( &self, child_storage_key: PrefixedStorageKey, key: StorageKey, hash: Option<Hash> ) -> RpcResult<Option<StorageData>>
Returns a child storage entry at a specific block’s state.
sourcefn storage_entries(
&self,
child_storage_key: PrefixedStorageKey,
keys: Vec<StorageKey>,
hash: Option<Hash>
) -> RpcResult<Vec<Option<StorageData>>>
fn storage_entries( &self, child_storage_key: PrefixedStorageKey, keys: Vec<StorageKey>, hash: Option<Hash> ) -> RpcResult<Vec<Option<StorageData>>>
Returns child storage entries for multiple keys at a specific block’s state.
sourcefn storage_hash(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> RpcResult<Option<Hash>>
fn storage_hash( &self, child_storage_key: PrefixedStorageKey, key: StorageKey, hash: Option<Hash> ) -> RpcResult<Option<Hash>>
Returns the hash of a child storage entry at a block’s state.
sourcefn storage_size(
&self,
child_storage_key: PrefixedStorageKey,
key: StorageKey,
hash: Option<Hash>
) -> RpcResult<Option<u64>>
fn storage_size( &self, child_storage_key: PrefixedStorageKey, key: StorageKey, hash: Option<Hash> ) -> RpcResult<Option<u64>>
Returns the size of a child storage entry at a block’s state.
sourcefn read_child_proof(
&self,
child_storage_key: PrefixedStorageKey,
keys: Vec<StorageKey>,
hash: Option<Hash>
) -> RpcResult<ReadProof<Hash>>
fn read_child_proof( &self, child_storage_key: PrefixedStorageKey, keys: Vec<StorageKey>, hash: Option<Hash> ) -> RpcResult<ReadProof<Hash>>
Returns proof of storage for child key entries at a specific block’s state.