Here is an example of how to make a claimRewards request using the QUBIT SDK:
Response
Use Cases
Crypto Staking Platforms: The claimRewards function can be used by crypto staking platforms to allow users to claim their rewards from the reward pool for their specific stake.
Decentralized Finance (DeFi) Applications: The function can be used by DeFi applications that offer staking as one of their services, allowing users to claim their rewards from the reward pool.
Crypto Wallets: The claimRewards function can be used by crypto wallets that support staking to enable their users to claim their rewards.
// import QUBIT SDK library
const { rewards } = require('@nest25/tokenomics-lib');
// create a new instance of the rewards class
const Rewards = new rewards();
async function main() {
// claim rewards for a given user and amount
const result = await Rewards.claimRewards(49, '0.3', TEST_PRIVATE_KEY);
// log the result
console.log(result);
}
main();