15 breaking releases

new 0.25.0 Mar 26, 2023
0.23.0 Feb 26, 2023
0.15.0 Dec 21, 2022
0.0.0 Nov 21, 2022

#1586 in Magic Beans

Download history 94/week @ 2022-12-11 154/week @ 2022-12-18 18/week @ 2022-12-25 12/week @ 2023-01-01 48/week @ 2023-01-08 42/week @ 2023-01-15 48/week @ 2023-01-22 55/week @ 2023-01-29 83/week @ 2023-02-05 86/week @ 2023-02-12 119/week @ 2023-02-19 82/week @ 2023-02-26 78/week @ 2023-03-05 19/week @ 2023-03-12 44/week @ 2023-03-19

238 downloads per month
Used in 2 crates

Apache-2.0 and GPL-3.0-or-later…

515KB
11K SLoC

substrate-rpc-client

Auto-generated README.md for publishing to crates.io


lib.rs:

Shared JSON-RPC client related code and abstractions.

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

Usage

# use substrate_rpc_client::{ws_client, StateApi};
# use sp_core::{H256, storage::StorageKey};

#[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();
}

Dependencies

~52–92MB
~1.5M SLoC