mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-09 16:27:58 +00:00
[Staking] Runtime api if era rewards are pending to be claimed (#4301)
closes https://github.com/paritytech/polkadot-sdk/issues/426. related to https://github.com/paritytech/polkadot-sdk/pull/1189. Would help offchain programs to query if there are unclaimed pages of rewards for a given era. The logic could look like below ```js // loop as long as all era pages are claimed. while (api.call.stakingApi.pendingRewards(era, validator_stash)) { api.tx.staking.payout_stakers(validator_stash, era) } ```
This commit is contained in:
@@ -30,7 +30,10 @@ sp_api::decl_runtime_apis! {
|
||||
/// Returns the nominations quota for a nominator with a given balance.
|
||||
fn nominations_quota(balance: Balance) -> u32;
|
||||
|
||||
/// Returns the page count of exposures for a validator in a given era.
|
||||
/// Returns the page count of exposures for a validator `account` in a given era.
|
||||
fn eras_stakers_page_count(era: sp_staking::EraIndex, account: AccountId) -> sp_staking::Page;
|
||||
|
||||
/// Returns true if validator `account` has pages to be claimed for the given era.
|
||||
fn pending_rewards(era: sp_staking::EraIndex, account: AccountId) -> bool;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user