As a developer,I want to use the interface to search this information: which can get the amount which nominator has been rewarded at every era and staking?
1 Answer
Probably what you are looking for is to inspect the Rewarded
event and find the one that corresponds to your nominator of choice. Some useful links to docs/tools:
https://paritytech.github.io/substrate/master/pallet_staking/enum.Event.html#variant.Rewarded https://polkadot.js.org/docs/substrate/events#rewardedaccountid32-u128 https://polkadot.subscan.io/event?address=&module=staking&event=rewarded&startDate=&endDate=&startBlock=&endBlock=&timeType=date&version=9281
-
how to use api.events.staking.Rewarded.is to get reward? like this: let event:IEventLike={ index:9281, method:"staking", section:"rewarded", }; const nominatorReward = api.events.staking.Rewarded.is(event) console.log(nominatorReward)– RoseCommented Oct 5, 2022 at 4:45