Relay balance metrics (#1291)

* relay balance metrics

* convert balance to "main" tokens in balance metrics

* add balances widgets to maintenance dashboard
This commit is contained in:
Svyatoslav Nikolsky
2022-01-21 14:50:41 +03:00
committed by Bastian Köcher
parent 25008a5166
commit fe34a526bb
9 changed files with 208 additions and 49 deletions
@@ -541,6 +541,15 @@ impl<C: Chain> Client<C> {
.await
}
/// Return `tokenDecimals` property from the set of chain properties.
pub async fn token_decimals(&self) -> Result<Option<u64>> {
self.jsonrpsee_execute(move |client| async move {
let system_properties = Substrate::<C>::system_properties(&*client).await?;
Ok(system_properties.get("tokenDecimals").and_then(|v| v.as_u64()))
})
.await
}
/// Return new justifications stream.
pub async fn subscribe_justifications(&self) -> Result<Subscription<Bytes>> {
let subscription = self