Trait sc_rpc::state::StateApi [−][src]
Substrate state API
Associated Types
type Metadata: PubSubMetadata
[src]
RPC Metadata
Required methods
pub fn call(
&self,
name: String,
bytes: Bytes,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Bytes> + 'static + Send, Global>
[src]
&self,
name: String,
bytes: Bytes,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Bytes> + 'static + Send, Global>
Call a contract at a block’s state.
pub fn storage_keys(
&self,
prefix: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<StorageKey, Global>> + 'static + Send, Global>
[src]
&self,
prefix: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<StorageKey, Global>> + 'static + Send, Global>
DEPRECATED: Please use state_getKeysPaged
with proper paging support.
Returns the keys with prefix, leave empty to get all the keys.
pub fn storage_pairs(
&self,
prefix: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<(StorageKey, StorageData), Global>> + 'static + Send, Global>
[src]
&self,
prefix: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<(StorageKey, StorageData), Global>> + 'static + Send, Global>
Returns the keys with prefix, leave empty to get all the keys
pub fn storage_keys_paged(
&self,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<StorageKey, Global>> + 'static + Send, Global>
[src]
&self,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<StorageKey, Global>> + 'static + Send, Global>
Returns the keys with prefix with pagination support.
Up to count
keys will be returned.
If start_key
is passed, return next keys in storage in lexicographic order.
pub fn storage(
&self,
key: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<StorageData>> + 'static + Send, Global>
[src]
&self,
key: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<StorageData>> + 'static + Send, Global>
Returns a storage entry at a specific block’s state.
pub fn storage_hash(
&self,
key: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<Hash>> + 'static + Send, Global>
[src]
&self,
key: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<Hash>> + 'static + Send, Global>
Returns the hash of a storage entry at a block’s state.
pub fn storage_size(
&self,
key: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<u64>> + 'static + Send, Global>
[src]
&self,
key: StorageKey,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Option<u64>> + 'static + Send, Global>
Returns the size of a storage entry at a block’s state.
pub fn metadata(
&self,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Bytes> + 'static + Send, Global>
[src]
&self,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Bytes> + 'static + Send, Global>
Returns the runtime metadata as an opaque blob.
pub fn runtime_version(
&self,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = RuntimeVersion> + 'static + Send, Global>
[src]
&self,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = RuntimeVersion> + 'static + Send, Global>
Get the runtime version.
pub fn query_storage(
&self,
keys: Vec<StorageKey, Global>,
block: Hash,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<StorageChangeSet<Hash>, Global>> + 'static + Send, Global>
[src]
&self,
keys: Vec<StorageKey, Global>,
block: Hash,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<StorageChangeSet<Hash>, Global>> + 'static + Send, Global>
Query historical storage entries (by key) starting from a block given as the second parameter.
NOTE This first returned result contains the initial state of storage for all keys. Subsequent values in the vector represent changes to the previous state (diffs).
pub fn query_storage_at(
&self,
keys: Vec<StorageKey, Global>,
at: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<StorageChangeSet<Hash>, Global>> + 'static + Send, Global>
[src]
&self,
keys: Vec<StorageKey, Global>,
at: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Vec<StorageChangeSet<Hash>, Global>> + 'static + Send, Global>
Query storage entries (by key) starting at block hash given as the second parameter.
pub fn read_proof(
&self,
keys: Vec<StorageKey, Global>,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = ReadProof<Hash>> + 'static + Send, Global>
[src]
&self,
keys: Vec<StorageKey, Global>,
hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = ReadProof<Hash>> + 'static + Send, Global>
Returns proof of storage entries at a specific block’s state.
pub fn subscribe_runtime_version(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<RuntimeVersion, Error>
)
[src]
&self,
metadata: Self::Metadata,
subscriber: Subscriber<RuntimeVersion, Error>
)
New runtime version subscription
pub fn unsubscribe_runtime_version(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
[src]
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
Unsubscribe from runtime version subscription
pub fn subscribe_storage(
&self,
metadata: Self::Metadata,
subscriber: Subscriber<StorageChangeSet<Hash>, Error>,
keys: Option<Vec<StorageKey, Global>>
)
[src]
&self,
metadata: Self::Metadata,
subscriber: Subscriber<StorageChangeSet<Hash>, Error>,
keys: Option<Vec<StorageKey, Global>>
)
New storage subscription
pub fn unsubscribe_storage(
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
[src]
&self,
metadata: Option<Self::Metadata>,
id: SubscriptionId
) -> Result<bool, Error>
Unsubscribe from storage subscription
Provided methods
pub fn to_delegate(self) -> IoDelegate<Self, Self::Metadata> where
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
[src]
Hash: Send + Sync + 'static + Serialize + DeserializeOwned,
Create an IoDelegate
, wiring rpc calls to the trait methods.
Implementors
impl<Block, Client> StateApi<<Block as Block>::Hash> for State<Block, Client> where
Block: BlockT + 'static,
Client: Send + Sync + 'static,
[src]
Block: BlockT + 'static,
Client: Send + Sync + 'static,
type Metadata = Metadata
fn call(
&self,
method: String,
data: Bytes,
block: Option<Block::Hash>
) -> FutureResult<Bytes>
[src]
&self,
method: String,
data: Bytes,
block: Option<Block::Hash>
) -> FutureResult<Bytes>
fn storage_keys(
&self,
key_prefix: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Vec<StorageKey>>
[src]
&self,
key_prefix: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Vec<StorageKey>>
fn storage_pairs(
&self,
key_prefix: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Vec<(StorageKey, StorageData)>>
[src]
&self,
key_prefix: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Vec<(StorageKey, StorageData)>>
fn storage_keys_paged(
&self,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>,
block: Option<Block::Hash>
) -> FutureResult<Vec<StorageKey>>
[src]
&self,
prefix: Option<StorageKey>,
count: u32,
start_key: Option<StorageKey>,
block: Option<Block::Hash>
) -> FutureResult<Vec<StorageKey>>
fn storage(
&self,
key: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Option<StorageData>>
[src]
&self,
key: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Option<StorageData>>
fn storage_hash(
&self,
key: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Option<Block::Hash>>
[src]
&self,
key: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Option<Block::Hash>>
fn storage_size(
&self,
key: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Option<u64>>
[src]
&self,
key: StorageKey,
block: Option<Block::Hash>
) -> FutureResult<Option<u64>>
fn metadata(&self, block: Option<Block::Hash>) -> FutureResult<Bytes>
[src]
fn query_storage(
&self,
keys: Vec<StorageKey>,
from: Block::Hash,
to: Option<Block::Hash>
) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>>
[src]
&self,
keys: Vec<StorageKey>,
from: Block::Hash,
to: Option<Block::Hash>
) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>>
fn query_storage_at(
&self,
keys: Vec<StorageKey>,
at: Option<Block::Hash>
) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>>
[src]
&self,
keys: Vec<StorageKey>,
at: Option<Block::Hash>
) -> FutureResult<Vec<StorageChangeSet<Block::Hash>>>
fn read_proof(
&self,
keys: Vec<StorageKey>,
block: Option<Block::Hash>
) -> FutureResult<ReadProof<Block::Hash>>
[src]
&self,
keys: Vec<StorageKey>,
block: Option<Block::Hash>
) -> FutureResult<ReadProof<Block::Hash>>
fn subscribe_storage(
&self,
meta: Self::Metadata,
subscriber: Subscriber<StorageChangeSet<Block::Hash>>,
keys: Option<Vec<StorageKey>>
)
[src]
&self,
meta: Self::Metadata,
subscriber: Subscriber<StorageChangeSet<Block::Hash>>,
keys: Option<Vec<StorageKey>>
)
fn unsubscribe_storage(
&self,
meta: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>
[src]
&self,
meta: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>
fn runtime_version(
&self,
at: Option<Block::Hash>
) -> FutureResult<RuntimeVersion>
[src]
&self,
at: Option<Block::Hash>
) -> FutureResult<RuntimeVersion>
fn subscribe_runtime_version(
&self,
meta: Self::Metadata,
subscriber: Subscriber<RuntimeVersion>
)
[src]
&self,
meta: Self::Metadata,
subscriber: Subscriber<RuntimeVersion>
)
fn unsubscribe_runtime_version(
&self,
meta: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>
[src]
&self,
meta: Option<Self::Metadata>,
id: SubscriptionId
) -> RpcResult<bool>