Expand description

It exposes a WebSocket JSON-RPC client that implements the RPC interface in [sc-rpc-api] along with some abstractions.

Usage


#[tokio::main]
async fn main() {

    let client = ws_client("ws://127.0.0.1:9944").await.unwrap();
    client.storage(StorageKey(vec![]), Some(H256::zero())).await.unwrap();

    // if all type params are not known you need to provide type params
    StateApi::<H256>::storage(&client, StorageKey(vec![]), None).await.unwrap();
}

Macros

  • Convert the given values to a [crate::params::ArrayParams] as expected by a jsonrpsee Client (http or websocket).

Structs

Enums

Traits

  • Client implementation for the AuthorApi RPC API.
  • Client implementation for the ChainApi RPC API.
  • Client implementation for the ChildStateApi RPC API.
  • JSON-RPC client interface that can make requests and notifications.
  • Client implementation for the DevApi RPC API.
  • Abstraction over RPC calling for headers.
  • Abstraction over RPC subscription for finalized headers.
  • Client implementation for the OffchainApi RPC API.
  • Client implementation for the StateApi RPC API.
  • JSON-RPC client interface that can make requests, notifications and subscriptions.
  • Client implementation for the SystemApi RPC API.

Functions

  • Create a new WebSocket connection with shared settings.

Type Definitions