feat: use account API v4 transactions#29536
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. |
8b6d6b5 to
04b18d4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #29536 +/- ##
===========================================
- Coverage 82.16% 44.44% -37.73%
===========================================
Files 5176 5179 +3
Lines 137275 137376 +101
Branches 31024 31052 +28
===========================================
- Hits 112795 61055 -51740
- Misses 16840 70626 +53786
+ Partials 7640 5695 -1945 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9db07e8 to
e7dcf8b
Compare
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
b8a00bb to
d607d82
Compare
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## **Description** Registers a mock empty Accounts API v4 transactions response for testing. Part of breaking down the Activity transactions PR into smaller chunks. ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: MetaMask#29536 ## **Manual testing steps** N/A - test infrastructure mock-only change. ## **Screenshots/Recordings** N/A - no user-facing UI changes. ### **Before** N/A ### **After** N/A ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. #### Performance checks (if applicable) - [x] I've tested on Android - N/A - mock-only change. - [x] I've tested with a power user scenario - N/A - mock-only change. - [x] I've instrumented key operations with Sentry traces for production performance metrics - N/A - mock-only change. ## **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. <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-f352c865-12ef-417e-b135-ece1f40ce868"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-f352c865-12ef-417e-b135-ece1f40ce868"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2e28a13 to
86cda23
Compare
09d69ea to
d978b7b
Compare
d978b7b to
3ef4b58
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.
Reviewed by Cursor Bugbot for commit d14b023. Configure here.
d14b023 to
016149e
Compare
016149e to
8b8ef87
Compare
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
Co-authored-by: Francis Nepomuceno <n3ps@users.noreply.github.com>
ccddda7 to
a3e6592
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: This PR introduces a major architectural change to the transaction history/activity view (UnifiedTransactionsView), switching from local Redux state to an API-based infinite query system using @tanstack/react-query and a new v4 accounts API endpoint. Primary impact - SmokeWalletPlatform:
SmokeSwap selected because:
SmokeStake selected because:
SmokeConfirmations selected because:
SmokeNetworkExpansion selected because:
The changes do NOT directly affect: account management (SmokeAccounts), identity/sync (SmokeIdentity), network management UI (SmokeNetworkAbstractions), browser (SmokeBrowser), Snaps (SmokeSnaps), card/ramps (SmokeMoney), perps (SmokePerps), predictions (SmokePredictions), multi-chain API sessions (SmokeMultiChainAPI), or seedless onboarding (SmokeSeedlessOnboarding). Performance Test Selection: |
|




Description
Note: Due to the API requesting a bearer token, there is a current bottleneck in that token retrieval, in particular in
AuthenticationController.getPrimaryEntropySourceIdChangelog
CHANGELOG entry: feat: use accounts API v4 for transactions
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
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
Moderate risk because it rewires the Activity/UnifiedTransactionsView data source and filtering/deduping logic, which can change what transactions appear and when pagination/refresh occurs.
Overview
Confirmed EVM Activity now comes from the Accounts v4 API via a new React Query
useTransactionsQueryhook, while local pending EVM transactions continue to come from controller state and are merged/deduped with the API results.Adds a small transformation layer (
helpers/adapters+helpers/transformations) to normalize API responses intoTransactionMeta-compatible view models, filter out unwanted items (e.g. spam/incoming transfers/zero-value self-sends), and handle bridge-history matching/deduping (including case-insensitive hash matching).Updates
UnifiedTransactionsViewto support infinite scrolling pagination (prefetch near the end of confirmed EVM items), show initial/next-page loading indicators, and refresh both local polling and the query. Related selector additions (selectLocalTransactions,selectRequiredTransactionHashes/Ids) support filtering required child txs and nonce/hash collisions, and tests/smoke mocks were updated accordingly.Reviewed by Cursor Bugbot for commit a3e6592. Bugbot is set up for automated code reviews on this repo. Configure here.