Trait sc_rpc::state::StateApi[][src]

pub trait StateApi<Hash>: 'static + Send + Sync {
    type Metadata: PubSubMetadata;
    pub fn call(
        &self,
        name: String,
        bytes: Bytes,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = Bytes> + 'static + Send, Global>;
pub fn storage_keys(
        &self,
        prefix: StorageKey,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = Vec<StorageKey, Global>> + 'static + Send, Global>;
pub fn storage_pairs(
        &self,
        prefix: StorageKey,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = Vec<(StorageKey, StorageData), Global>> + 'static + Send, Global>;
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>;
pub fn storage(
        &self,
        key: StorageKey,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = Option<StorageData>> + 'static + Send, Global>;
pub fn storage_hash(
        &self,
        key: StorageKey,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = Option<Hash>> + 'static + Send, Global>;
pub fn storage_size(
        &self,
        key: StorageKey,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = Option<u64>> + 'static + Send, Global>;
pub fn metadata(
        &self,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = Bytes> + 'static + Send, Global>;
pub fn runtime_version(
        &self,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = RuntimeVersion> + 'static + Send, Global>;
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>;
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>;
pub fn read_proof(
        &self,
        keys: Vec<StorageKey, Global>,
        hash: Option<Hash>
    ) -> Box<dyn Future<Error = Error, Item = ReadProof<Hash>> + 'static + Send, Global>;
pub fn subscribe_runtime_version(
        &self,
        metadata: Self::Metadata,
        subscriber: Subscriber<RuntimeVersion, Error>
    );
pub fn unsubscribe_runtime_version(
        &self,
        metadata: Option<Self::Metadata>,
        id: SubscriptionId
    ) -> Result<bool, Error>;
pub fn subscribe_storage(
        &self,
        metadata: Self::Metadata,
        subscriber: Subscriber<StorageChangeSet<Hash>, Error>,
        keys: Option<Vec<StorageKey, Global>>
    );
pub fn unsubscribe_storage(
        &self,
        metadata: Option<Self::Metadata>,
        id: SubscriptionId
    ) -> Result<bool, Error>; pub fn to_delegate(self) -> IoDelegate<Self, Self::Metadata>
    where
        Hash: Send + Sync + 'static + Serialize + DeserializeOwned
, { ... } }

Substrate state API

Associated Types

type Metadata: PubSubMetadata[src]

RPC Metadata

Loading content...

Required methods

pub fn call(
    &self,
    name: String,
    bytes: Bytes,
    hash: Option<Hash>
) -> Box<dyn Future<Error = Error, Item = Bytes> + 'static + Send, Global>
[src]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

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]

New runtime version subscription

pub fn unsubscribe_runtime_version(
    &self,
    metadata: Option<Self::Metadata>,
    id: SubscriptionId
) -> Result<bool, Error>
[src]

Unsubscribe from runtime version subscription

pub fn subscribe_storage(
    &self,
    metadata: Self::Metadata,
    subscriber: Subscriber<StorageChangeSet<Hash>, Error>,
    keys: Option<Vec<StorageKey, Global>>
)
[src]

New storage subscription

pub fn unsubscribe_storage(
    &self,
    metadata: Option<Self::Metadata>,
    id: SubscriptionId
) -> Result<bool, Error>
[src]

Unsubscribe from storage subscription

Loading content...

Provided methods

pub fn to_delegate(self) -> IoDelegate<Self, Self::Metadata> where
    Hash: Send + Sync + 'static + Serialize + DeserializeOwned
[src]

Create an IoDelegate, wiring rpc calls to the trait methods.

Loading content...

Implementors

impl<Block, Client> StateApi<<Block as Block>::Hash> for State<Block, Client> where
    Block: BlockT + 'static,
    Client: Send + Sync + 'static, 
[src]

type Metadata = Metadata

Loading content...