use super::{RuntimeApi, RuntimeApiClient};
use crate::{api::Result, rpc::Request};
use ac_primitives::config::Config;
#[cfg(all(not(feature = "sync-api"), not(feature = "std")))]
use alloc::boxed::Box;
use alloc::vec;
use sp_core::Encode;
#[maybe_async::maybe_async(?Send)]
pub trait StakingApi: RuntimeApi {
type Balance;
async fn nominations_quota(
&self,
balance: Self::Balance,
at_block: Option<Self::Hash>,
) -> Result<u32>;
}
#[maybe_async::maybe_async(?Send)]
impl<T, Client> StakingApi for RuntimeApiClient<T, Client>
where
T: Config,
Client: Request,
{
type Balance = T::Balance;
async fn nominations_quota(
&self,
balance: Self::Balance,
at_block: Option<Self::Hash>,
) -> Result<u32> {
self.runtime_call("StakingApi_nominations_quota", vec![balance.encode()], at_block)
.await
}
}