pallet_capacity_runtime_api/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![allow(clippy::too_many_arguments)]
3#![allow(clippy::unnecessary_mut_passed)]
4#![allow(rustdoc::bare_urls)]
5// Strong Documentation Lints
6#![deny(
7	rustdoc::broken_intra_doc_links,
8	rustdoc::missing_crate_level_docs,
9	rustdoc::invalid_codeblock_attributes,
10	missing_docs
11)]
12
13//! Runtime API definition for [Capacity](../pallet_capacity/index.html)
14//!
15//! This api must be implemented by the node runtime.
16//! Runtime APIs Provide:
17//! - An interface between the runtime and Custom RPCs.
18//! - Runtime interfaces for end users beyond just State Queries
19
20use common_primitives::capacity::UnclaimedRewardInfo;
21use parity_scale_codec::Codec;
22use sp_runtime::traits::MaybeDisplay;
23extern crate alloc;
24use alloc::vec::Vec;
25
26// Here we declare the runtime API. It is implemented it the `impl` block in
27// runtime files (the `runtime` folder)
28sp_api::decl_runtime_apis! {
29	/// Runtime Version for Capacity
30	/// - MUST be incremented if anything changes
31	/// - See: https://paritytech.github.io/polkadot/doc/polkadot_primitives/runtime_api/index.html
32	#[api_version(1)]
33	/// Runtime APIs for [Capacity](../pallet_capacity/index.html)
34	pub trait CapacityRuntimeApi<AccountId, Balance, BlockNumber> where
35		AccountId: Codec + MaybeDisplay,
36		Balance: Codec + MaybeDisplay,
37		BlockNumber: Codec + MaybeDisplay,
38	{
39		// state_call method: CapacityRuntimeApi_list_unclaimed_rewards
40		/// Get the list of unclaimed rewards information for each eligible Reward Era.
41		fn list_unclaimed_rewards(who: AccountId) -> Vec<UnclaimedRewardInfo<Balance, BlockNumber>>;
42	}
43}