avail_rust_core/rpc/chainspec.rs
1use crate::error::Error;
2use primitive_types::H256;
3use std::str::FromStr;
4use subxt_rpcs::{RpcClient, rpc_params};
5
6pub async fn v1_genesishash(client: &RpcClient) -> Result<H256, Error> {
7 let value: String = client.request("chainSpec_v1_genesisHash", rpc_params![]).await?;
8 Ok(H256::from_str(&value).map_err(|e| e.to_string())?)
9}