mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 08:27:55 +00:00
Expose properties and per-era preferences
This commit is contained in:
+20
@@ -96,6 +96,18 @@ impl From<u32> for BlockNumber {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
/// System properties for a Substrate-based runtime
|
||||
pub struct Properties {
|
||||
/// The address format
|
||||
pub ss58_format: u8,
|
||||
/// The number of digits after the decimal point in the native token
|
||||
pub token_decimals: u8,
|
||||
/// The symbol of the native token
|
||||
pub token_symbol: String,
|
||||
}
|
||||
|
||||
/// Client for substrate rpc interfaces
|
||||
pub struct Rpc<T: Runtime> {
|
||||
client: Client,
|
||||
@@ -208,6 +220,14 @@ impl<T: Runtime> Rpc<T> {
|
||||
Ok(metadata)
|
||||
}
|
||||
|
||||
/// Fetch system properties
|
||||
pub async fn properties(&self) -> Result<Properties, Error> {
|
||||
Ok(self
|
||||
.client
|
||||
.request("system_properties", Params::None)
|
||||
.await?)
|
||||
}
|
||||
|
||||
/// Get a header
|
||||
pub async fn header(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user