substrate_api_client/api/runtime_api/
staking.rs1use super::{RuntimeApi, RuntimeApiClient};
15use crate::{api::Result, rpc::Request};
16use ac_primitives::config::Config;
17#[cfg(all(not(feature = "sync-api"), not(feature = "std")))]
18use alloc::boxed::Box;
19use alloc::vec;
20use sp_core::Encode;
21
22#[maybe_async::maybe_async(?Send)]
23pub trait StakingApi: RuntimeApi {
24 type Balance;
25
26 async fn nominations_quota(
28 &self,
29 balance: Self::Balance,
30 at_block: Option<Self::Hash>,
31 ) -> Result<u32>;
32}
33
34#[maybe_async::maybe_async(?Send)]
35impl<T, Client> StakingApi for RuntimeApiClient<T, Client>
36where
37 T: Config,
38 Client: Request,
39{
40 type Balance = T::Balance;
41
42 async fn nominations_quota(
43 &self,
44 balance: Self::Balance,
45 at_block: Option<Self::Hash>,
46 ) -> Result<u32> {
47 self.runtime_call("StakingApi_nominations_quota", vec![balance.encode()], at_block)
48 .await
49 }
50}