feat: [MUSD-1021] show musd back transactions in money activity#32004
feat: [MUSD-1021] show musd back transactions in money activity#32004Jwhiles wants to merge 4 commits into
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. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
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: |
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
Screenshots/Recordings
Before
n/a
After
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
User-visible activity and filtering depend on assumed
METAMASK_CARD_CASHBACKAPI 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:
CardTransactionbecomes a discriminatedAccountsApiActivity(kind: 'card' | 'cashback') withpaidTo/receivedFrom;parseAccountsApiActivityhandlesMETAMASK_CARD_CASHBACKusing the inbound leg to the money account. Card-only hookuseMoneyAccountCardTransactionsis renamed touseMoneyAccountApiActivityand returns a singleactivityarray.List behavior:
useMoneyActivityItemscentralizes merge, mock-data handling, loading, and filter buckets—cashback in Deposits, card spends in Transfers—soMoneyActivityViewandMoneyHomeViewshare one path. Merge adds stable id tie-breaking when timestamps collide.UI:
CardActivityItem→AccountsApiActivityItem; details sheet →MoneyApiActivityDetailsSheetwith kind-specific copy and incoming amount styling; routeAPI_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.