You can also retrieve the rewards history for a specific epoch using the history() method. This returns details such as pool rewards, cumulative difficulty, and the best solution difficulty.
To claim rewards, use the claim() method. You need to provide the amount of ORE to claim, the withdrawal token (SOL, USDC, or ORE), and the withdrawal address.
async function claimRewards(amount, withdrawalToken, withdrawalAddress) {
const result = await rewards.claim(
amount,
withdrawalToken,
withdrawalAddress
);
console.log("Claim Result:", result);
}
// Example: Claim 0.0001 ORE and swap it to SOL at the current market rate
claimRewards(10000000, "SOL", "your-wallet-address-here");
// Response:
// {
// "status": "inProgress"
// }