Skip to content

Add Reward Claiming Feature/functionality to User Dashboard #60

@JamesVictor-O

Description

@JamesVictor-O

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

Metadata

Metadata

Assignees

Labels

FrontendenhancementNew feature or requestonlydust-waveContribute to awesome OSS repos during OnlyDust's open source week

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions