feat: add claim rewards component and API route to yield demo#149
Merged
rodrigo-privy merged 1 commit intomainfrom Mar 5, 2026
Merged
feat: add claim rewards component and API route to yield demo#149rodrigo-privy merged 1 commit intomainfrom
rodrigo-privy merged 1 commit intomainfrom
Conversation
69dc466 to
08075f8
Compare
08075f8 to
e61f5db
Compare
e61f5db to
d58acbd
Compare
d58acbd to
7f1cc4a
Compare
madeleine-c
approved these changes
Mar 4, 2026
| } | ||
|
|
||
| // Create one transaction per reward token | ||
| const now = Date.now(); |
Contributor
There was a problem hiding this comment.
can't we pull now from the claim response? like this should be created_at
Contributor
Author
There was a problem hiding this comment.
Ooh this is a good callout - the yield claim API doesn't have created_at and updated_at like deposit and withdraw yet. But it should be super easy to add because those fields are available in the CockroachDB transaction.
GIT_VALID_PII_OVERRIDE
7f1cc4a to
3304dc7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/api/claimroute to the yield demo, calling the newethereum_yield_claimendpoint to claim accrued incentive rewards (e.g. MORPHO) via the Merkl protocolChanges
ClaimRewardsFormcomponent — single-button UI (no amount input), placed below Withdraw on the dashboard/api/claimroute — proxies to Privy'sethereum_yield_claimendpoint, normalizes the broader claim status set to match the three-value model used by deposit/withdrawTransactioninterface — addedtoken_symbolandtoken_decimalsas required fields, madevault_idoptional (claims don't involve a vault)USDC_TOKENconstant when storing transactionsTransactionHistory— renders claim rows as "Claimed X.XXXX MORPHO" alongside existing "Deposited/Withdrew $X.XX USDC" rowsconstants.ts— added MORPHO token constants,USDC_TOKENshorthand, and genericformatTokenAmountformatterTesting
code: "no_rewards"Screenshots
Claim component under withdrawal component:

Loading state:

No rewards available to claim:

Transaction history table with claim API mocked (pending additional test, see above):
