Skip to content

feat: [MUSD-1021] show musd back transactions in money activity#32004

Open
Jwhiles wants to merge 4 commits into
mainfrom
john-musd-1021
Open

feat: [MUSD-1021] show musd back transactions in money activity#32004
Jwhiles wants to merge 4 commits into
mainfrom
john-musd-1021

Conversation

@Jwhiles

@Jwhiles Jwhiles commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Description

This PR updates the money activity list to show musdback transactions. It assumes a particular type for the transactions, which has not been confirmed by the accounts team yet. In the interest of speed, we plan to merge this and then make a cherry pick PR if the type needs to be changed.

Changelog

CHANGELOG entry: show cashback transactions in money activity

Related issues

Fixes: musd-1021

Manual testing steps

Feature: money activity
  Scenario: user has cashback transactions that land in their money account
    Given user has cashback transactions that land in their money account

    When user looks at the money activity
    Then they see the transactions

Screenshots/Recordings

Before

n/a

After

image Screenshot 2026-06-18 at 16 23 36 Screenshot 2026-06-18 at 16 23 45

Pre-merge author checklist

Performance checks (if applicable)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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.

Note

Medium Risk
User-visible activity and filtering depend on assumed METAMASK_CARD_CASHBACK API shape; wrong types could hide or mis-bucket rewards, though parsing is defensive and heavily tested.

Overview
Extends Money activity beyond card spends to cashback (mUSD back) from the same Accounts API feed, and consolidates how that off-device data is merged with on-chain transactions.

Data model & parsing: CardTransaction becomes a discriminated AccountsApiActivity (kind: 'card' | 'cashback') with paidTo / receivedFrom; parseAccountsApiActivity handles METAMASK_CARD_CASHBACK using the inbound leg to the money account. Card-only hook useMoneyAccountCardTransactions is renamed to useMoneyAccountApiActivity and returns a single activity array.

List behavior: useMoneyActivityItems centralizes merge, mock-data handling, loading, and filter buckets—cashback in Deposits, card spends in Transfers—so MoneyActivityView and MoneyHomeView share one path. Merge adds stable id tie-breaking when timestamps collide.

UI: CardActivityItemAccountsApiActivityItem; details sheet → MoneyApiActivityDetailsSheet with kind-specific copy and incoming amount styling; route API_ACTIVITY_DETAILS_SHEET. Mock QA data adds a sample cashback row. Locales and tests updated throughout.

Reviewed by Cursor Bugbot for commit f103920. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

Copy link
Copy Markdown
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.

@github-actions github-actions Bot added pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. size-XL labels Jun 18, 2026
@Jwhiles Jwhiles marked this pull request as ready for review June 18, 2026 15:26
@Jwhiles Jwhiles requested a review from a team as a code owner June 18, 2026 15:26
@Jwhiles Jwhiles removed the pr-not-ready-for-e2e Skip E2E and block merging. Remove this label once the PR is ready to run the E2E tests. label Jun 18, 2026
@Jwhiles Jwhiles changed the title feat: [MUSD-1021] show cashback transactions in money activity feat: [MUSD-1021] show musd back transactions in money activity Jun 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeMoney
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 90%
click to see 🤖 AI reasoning details

E2E Test Selection:
All changes in this PR are confined to the Money/Card feature area (app/components/UI/Money/). The PR refactors the card transaction system to support both card spends and cashback rewards from the Accounts API:

  1. Core refactoring: CardTransaction type → AccountsApiActivity union type (card | cashback), useMoneyAccountCardTransactionsuseMoneyAccountApiActivity, MoneyCardTransactionDetailsSheetMoneyApiActivityDetailsSheet, CardActivityItemAccountsApiActivityItem
  2. New cashback feature: Added kind: 'cashback' activity type with its own display logic, bucketing, and detail sheet copy
  3. Unified hook: useMoneyActivityItems now consolidates all activity merging/bucketing logic used by both MoneyHomeView and MoneyActivityView
  4. Route rename: CARD_TRANSACTION_DETAILS_SHEETAPI_ACTIVITY_DETAILS_SHEET in Routes.ts (Money-specific route only)
  5. Localization: New strings for cashback/card activity details in en.json

The SmokeMoney tag covers CardHome, Add Funds, and ramps flows which are the primary user-facing surfaces affected by these changes. The route rename could potentially break navigation to the card transaction details sheet if any test navigates to it by the old route name. No other feature areas (confirmations, swaps, accounts, network, etc.) are affected by these changes.

Performance Test Selection:
The changes are a refactoring of the Money/Card activity system with addition of cashback support. While there are some changes to how activity items are merged and bucketed (useMoneyActivityItems hook), these are not performance-sensitive operations - they involve simple array filtering and sorting of activity items. No performance test tags cover Money/Card activity rendering specifically. The changes don't affect app launch, login, onboarding, account list rendering, swap flows, or asset loading performance.

View GitHub Actions results

@github-actions github-actions Bot added the risk:medium AI analysis: medium risk label Jun 18, 2026
@Jwhiles Jwhiles added the skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. label Jun 18, 2026
@Jwhiles Jwhiles enabled auto-merge June 18, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:medium AI analysis: medium risk size-XL skip-sonar-cloud Only used for bypassing sonar cloud when failures are not relevant to the changes. team-earn

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants