1234567891011121314151617#![cfg_attr(not(feature = "std"), no_std)]1819use sp_std::vec::Vec;20use codec::Decode;21use sp_runtime::{22 DispatchError,23 traits::{AtLeast32BitUnsigned, Member},24};2526type Result<T> = core::result::Result<T, DispatchError>;2728sp_api::decl_runtime_apis! {29 #[api_version(2)]30 31 pub trait AppPromotionApi<BlockNumber ,CrossAccountId, AccountId> where32 BlockNumber: Decode + Member + AtLeast32BitUnsigned,33 AccountId: Decode,34 CrossAccountId: pallet_evm::account::CrossAccountId<AccountId>,35 {36 fn total_staked(staker: Option<CrossAccountId>) -> Result<u128>;37 fn total_staked_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;38 fn pending_unstake(staker: Option<CrossAccountId>) -> Result<u128>;39 fn pending_unstake_per_block(staker: CrossAccountId) -> Result<Vec<(BlockNumber, u128)>>;40 }41}