feat: add Claim button for empty cash section#27909
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
c00bffe to
0efc195
Compare
0efc195 to
64884f4
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
…etaMask/metamask-mobile into add-claim-bonus-for-empty-cash-section
550636c
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: The changes in this PR are focused on:
Tag selection rationale:
The changes are primarily additive (new UI feature, error handling improvement, new mock) with low risk of breaking existing functionality. The mock addition is the most impactful change as it affects all tests using default mocks, but it's a safe addition (returns empty array for Merkl rewards). Performance Test Selection: |
|
✅ E2E Fixture Validation — Schema is up to date |
|




Description
Reason: Users with no mUSD balance but a claimable Merkl bonus only saw the claim flow after drilling into the aggregated mUSD row / asset overview. The home Cash empty state did not surface a claim action, and claim failures could occur with little feedback.
Solution:
CashGetMusdEmptyState(homepage Cash section and Cash full view empty state): wiresuseMerklBonusClaimwith sharedLINEA_MUSD_ASSET_FOR_MERKL, shows a full-width secondary Claim CTA when there is a claimable reward and no pending claim.earn.claim_bonus_with_fiatso the label includes the amount formatted withformatWithThreshold+getLocaleLanguageCode(), converting Merkl’s USD amount with the same USD → selected fiat basis as the mUSD price row (oneUsdInUserFiatfrom mainnet currency rates).useMerklClaimTransactionare surfaced viauseMerklBonusClaimaserrorand a plain toast on the empty state when a claim attempt fails.useMerklClaimTransaction: if the first Merkl fetch returns no reward data, clears the in-memory Merkl cache and retries once to avoid stale empty cache vs. display.MusdAggregatedRow: reusesLINEA_MUSD_ASSET_FOR_MERKLfrom constants; row press always navigates to Mainnet mUSD asset details (no longer branches to Cash full view when the user has mUSD).CashGetMusdEmptyState,useMerklBonusClaim,useMerklClaimTransaction, and Homepage mocks updated as needed.claim_bonus_with_fiat(and aligned keys where added) for the new string.Changelog
CHANGELOG entry: Added a Claim bonus action on the home Cash section when users have no mUSD but have a claimable Merkl bonus, with the amount shown in the selected fiat currency.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Adds a new claim path in the Cash empty-state UI and changes Merkl claim fetching to clear cache and retry, which could affect user flows and network/API behavior but is limited to the mUSD/Merkl feature area.
Overview
Adds a secondary “Claim bonus” CTA to the Cash (mUSD) empty state (homepage + full view) when a Merkl bonus is claimable, including fiat-formatted amount labeling and analytics tracking; claim failures now surface as a toast.
Extends
useMerklBonusClaimto expose anerrorfromuseMerklClaimTransaction, and updatesuseMerklClaimTransactionto clear the Merkl in-memory cache and retry once when the initial rewards fetch returns no data.Refactors Cash mUSD components to share a
LINEA_MUSD_ASSET_FOR_MERKLconstant and adjustsMusdAggregatedRownavigation to always open mainnet mUSD asset details; updates tests, mocks, locale string (earn.claim_bonus_with_fiat), and API-mocking defaults for Merkl rewards.Written by Cursor Bugbot for commit 550636c. This will update automatically on new commits. Configure here.