use color_eyre::Result; use subxt::{ utils::H256, client::OnlineClient, }; use crate::{ casper_network::{ self, runtime_types::{frame_system::AccountInfo, pallet_balances::types::AccountData}, }, CasperConfig, }; pub async fn balance( online_client: &OnlineClient, at_hash: Option<&H256>, account: &[u8; 32], ) -> Result>>> { let account_id = super::convert_array_to_account_id(account); let storage_key = casper_network::storage().system().account(account_id); let maybe_balance = super::do_storage_call(online_client, &storage_key, at_hash).await?; Ok(maybe_balance) }