Skip to content

feat: add Claim button for empty cash section#27909

Draft
PatrykLucka wants to merge 3 commits intomainfrom
add-claim-bonus-for-empty-cash-section
Draft

feat: add Claim button for empty cash section#27909
PatrykLucka wants to merge 3 commits intomainfrom
add-claim-bonus-for-empty-cash-section

Conversation

@PatrykLucka
Copy link
Contributor

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): wires useMerklBonusClaim with shared LINEA_MUSD_ASSET_FOR_MERKL, shows a full-width secondary Claim CTA when there is a claimable reward and no pending claim.
  • Button copy uses earn.claim_bonus_with_fiat so the label includes the amount formatted with formatWithThreshold + getLocaleLanguageCode(), converting Merkl’s USD amount with the same USD → selected fiat basis as the mUSD price row (oneUsdInUserFiat from mainnet currency rates).
  • Errors from useMerklClaimTransaction are surfaced via useMerklBonusClaim as error and 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: reuses LINEA_MUSD_ASSET_FOR_MERKL from constants; row press always navigates to Mainnet mUSD asset details (no longer branches to Cash full view when the user has mUSD).
  • Tests for CashGetMusdEmptyState, useMerklBonusClaim, useMerklClaimTransaction, and Homepage mocks updated as needed.
  • Locales: 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

Feature: Cash section claim bonus when wallet has no mUSD

  Scenario: User with no mUSD and claimable Merkl bonus sees claim CTA on home
    Given mUSD conversion Cash is enabled and the user is geo-eligible
    And the user has no mUSD balance on supported chains
    And Merkl reports a claimable mUSD bonus above the minimum threshold
    When the user views the Wallet home screen
    Then the Cash section shows the empty "Get mUSD" state
    And a secondary button is shown whose label starts with "Claim" and includes a formatted fiat amount

  Scenario: User taps Claim bonus from Cash empty state
    Given the Claim bonus button is visible on the Cash empty state
    When the user taps the Claim bonus button
    Then the wallet proceeds with the Merkl claim flow (e.g. transaction confirmation) when reward data is available
    Or a toast appears with an error message when the claim cannot be completed

  Scenario: Cash full view empty state
    Given the user opens the Cash token list full view with no mUSD balance
    And a claimable bonus exists
    Then the same Claim bonus control is available with consistent labeling

Screenshots/Recordings

Before

After

Screenshot 2026-03-24 at 15 06 10

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@PatrykLucka PatrykLucka self-assigned this Mar 25, 2026
@github-actions
Copy link
Contributor

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.

@metamaskbot metamaskbot added the team-mobile-ux Mobile UX team label Mar 25, 2026
@PatrykLucka PatrykLucka changed the title feat: add error handling and claim bonus functionality for Merkl rewards feat: add Claim button for empty cash section Mar 25, 2026
@PatrykLucka PatrykLucka force-pushed the add-claim-bonus-for-empty-cash-section branch from c00bffe to 0efc195 Compare March 25, 2026 13:01
@github-actions
Copy link
Contributor

🔍 Smart E2E Test Selection

⏭️ Smart E2E selection skipped - draft PR

All E2E tests pre-selected.

View GitHub Actions results

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

E2E Fixture Validation — Schema is up to date
16 value mismatches detected (expected — fixture represents an existing user).
View details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants