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 |
|
#1586 in Magic Beans
238 downloads per month
Used in 2 crates
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