use crate::{
api::{Api, GetStorage, Result},
rpc::Request,
};
use ac_primitives::config::Config;
#[cfg(all(not(feature = "sync-api"), not(feature = "std")))]
use alloc::boxed::Box;
#[maybe_async::maybe_async(?Send)]
pub trait GetBalance {
type Balance;
async fn get_existential_deposit(&self) -> Result<Self::Balance>;
}
#[maybe_async::maybe_async(?Send)]
impl<T, Client> GetBalance for Api<T, Client>
where
T: Config,
Client: Request,
{
type Balance = T::Balance;
async fn get_existential_deposit(&self) -> Result<Self::Balance> {
self.get_constant("Balances", "ExistentialDeposit").await
}
}