8. Rewards History
Overview
Initializing the Pool and Fetching Rewards History
const staker = new EthereumStaker({ network: 'hoodi' })
await staker.init()
// Setting the date range: from 1 month ago to today
const from = new Date()
from.setMonth(from.getMonth() - 1)
const to = new Date()
const rewardsHistory = await staker.getRewardsHistory({
startTime: from.getTime(),
endTime: to.getTime(),
delegatorAddress: userAddress,
validatorAddress
})Visualizing Rewards Data with a Chart
Chart Representation on the Screen

Wrapping Up
Last updated
Was this helpful?