-
Notifications
You must be signed in to change notification settings - Fork 18
Description
Description:
Allow users to claim their available rewards by calling the Submission.claimRewards function. Provide feedback on transaction success or failure and update the dashboard after claiming.
Tasks:
-
Add a "Claim Rewards" button to the user dashboard.
-
Check getClaimableRewards(userAddress) to ensure rewards are available before enabling the button.
-
Call claimRewards() using DCUContracts(Networks.ARBITRUM_SEPOLIA).Submission.connect(signer).
-
Handle transaction confirmation and display the transaction hash.
-
Catch errors (e.g., SUBMISSION__NoRewardsAvailable) and show user-friendly messages.
-
Refresh claimable rewards and submission statuses after a successful claim.
Acceptance Criteria:
-
"Claim Rewards" button is enabled only when rewards are available.
-
claimRewards is called successfully, and the transaction is confirmed.
-
Errors are caught and displayed (e.g., "No rewards available").
-
Dashboard updates to reflect claimed rewards (zero balance, updated submission status).
-
Type-safe interactions are used via @decleanup/contracts.
Note
note the integration is done using type-chain, here is the docs to the type-chain Docs