Repository navigation
release: 13.58.0 - #47903
release: 13.58.0#47903metamaskbot wants to merge 149 commits into
Conversation
#47560) <!-- CURSOR_AGENT_PR_BODY_BEGIN --> Stacked on #47564 (shared font-size helper) — merge that first. ## **Description** This is the @MetaMask/perps slice of the Grotzec large number amount inputs. It was split from the UAT build in #47557, which has the full plan, the input inventory and the risks. - Ticket: [TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744) - Epic: [TMCU-1741 [Extension] Update large number amount inputs with Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741) **Depends on #47564** (the shared amount scale and `useAmountInputFontSize` hook). This PR is stacked on #47564's branch (`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own copy of the helper, so its diff shows only this slice. Merge #47564 first, then retarget this PR to `main`. **What is the reason for the change?** The Perps withdraw amount was Inter at weight 500 and 64/40/30/20px. Perps balances and prices moved to Grotzec in #47465. This input is the twin of the MM Pay `CustomAmount`, which Mobile moves to Grotzec at 88px in [#38135](MetaMask/metamask-mobile#38135). **What is the improvement?** - **MMDS `Input`.** The `<input>` is now the MMDS `Input` (`textVariant={AmountDisplayLg}`, `font-hero`). The hidden-text measuring pattern stays. The symbol and measuring element are MMDS `Text` (`AmountDisplayLg` + `FontFamily.Hero`), so all three share the same family, weight and size. The explicit `fontWeight: 500` is dropped, as on Mobile. - **Sizing: shared scale.** The withdraw amount uses the scale in #47564 (`ui/helpers/utils/amount-input-font-size.ts`), the same one used by Swap/Bridge, Ramps Buy and the MM Pay amount. It has steps of 88, 72, 60, 48, 40, 32, 24 and 20px, takes the largest step at which `$` and the amount fit the input's measured width (`useAmountInputFontSize`, one `ResizeObserver` per input; 328px is only the fallback before the first measurement), and sets line height equal to font size. In the expanded view long amounts stay large instead of shrinking early. At the 328px popup width, `$25` is 88px, `$1234567.89` is 72px and `$123456789012.34` is 48px. - **Mobile reference.** The 88px start, 88px row, 88px `rounded-lg` skeleton and 20px floor match Mobile #38135. Mobile's MM Pay drops straight from 88px to 40px; Extension steps down gradually so mid-length amounts stay larger. - **Twin stays in sync.** The local length-based `getFontSize` is removed. Its twin, the confirmations `CustomAmount`, moves to the same scale in #47565, so the two can no longer drift. **Risks** - The weight changes from 500 Inter to the Bold Grotzec cut. Perps is USD only, and Grotzec has `$`, so there is no glyph fallback. ## **Changelog** CHANGELOG entry: Updated the Perps withdraw amount input to the Grotzec typeface ## **Related issues** Fixes: [TMCU-1744](https://consensyssoftware.atlassian.net/browse/TMCU-1744) Epic: [TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741) Depends on: #47564 Related: #47565 (MM Pay custom amount twin) Split from: #47557 ## **Manual testing steps** 1. Load this branch in the extension, open Perps and choose Withdraw. 2. Confirm the loading skeleton is 88px tall with rounded corners. 3. Enter `25` and confirm it renders in Grotzec at 88px. 4. Type `123456789012.34` one key at a time and confirm the amount steps down 88 → 72 → 60 → 48px and stays centred. 5. Enter more than the available balance and confirm the amount turns red. 6. Repeat in the expanded view, where long amounts stay larger instead of shrinking early, and in the side panel, where they step down smoothly as the width narrows. ## **Screenshots/Recordings** ### Before / After by code owner Before is `main` @adeaf9ad59 and After is the UAT head (#47557) @28a7077e43, both recorded with the same typing script (type 5, then 500000000000000000, then clear). #### Perps withdraw | Before | After | | --- | --- | | <img width="360" src="https://github.com/user-attachments/assets/bde0cc8d-a0a6-493e-81cd-6754ac6a0a82" alt="Perps withdraw before, side panel"> | <img width="360" src="https://github.com/user-attachments/assets/87e17271-f2a9-4b2e-824f-92456a58a3eb" alt="Perps withdraw after, side panel"> | | <img width="360" src="https://github.com/user-attachments/assets/2c539038-48c1-4f5b-9ef4-85b21391df3b" alt="Perps withdraw before, expanded view"> | <img width="360" src="https://github.com/user-attachments/assets/cc7c54af-42e1-4bf9-bffc-92bd98312ead" alt="Perps withdraw after, expanded view"> | Full MP4s: [Side panel before](https://github.com/user-attachments/assets/49c2722c-88e1-41fb-8ff3-1fda48319b85) · [Side panel after](https://github.com/user-attachments/assets/573cd199-f321-4b96-aab8-790349a292a6) · [Expanded before](https://github.com/user-attachments/assets/0595640d-d948-4c3f-9ec8-fb505f8f01f7) · [Expanded after](https://github.com/user-attachments/assets/85f918b1-09ec-4359-927d-705da4ed3405) ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><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-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><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> [TMCU-1744]: https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [TMCU-1744]: https://consensyssoftware.atlassian.net/browse/TMCU-1744?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Scoped UI swap on the Perps withdraw amount field with no changes to withdrawal submission, balance guards, or backend calls. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 52d1e02. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
…ero cp-13.57.0 (#47565) <!-- CURSOR_AGENT_PR_BODY_BEGIN --> Stacked on #47564 (shared font-size helper) — merge that first. ## **Description** This is the @MetaMask/confirmations slice of the Grotzec large number amount inputs. It was split from the UAT build in #47557. - Epic: [TMCU-1741 [Extension] Update large number amount inputs with Grotzec](https://consensyssoftware.atlassian.net/browse/TMCU-1741) - Ticket: a child ticket of [TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741) is still to be created for the MM Pay custom amount. **Depends on #47564** (the shared amount scale and `useAmountInputFontSize` hook). This PR is stacked on #47564's branch (`cursor/grotzec-amount-input-scale-f3b4`) and does not carry its own copy of the helper, so its diff shows only this slice. Merge #47564 first, then retarget this PR to `main`. **What is the reason for the change?** `CustomAmount` (`ui/pages/confirmations/components/transactions/custom-amount/custom-amount.tsx`) is the MM Pay hero amount. It is used by Perps deposit, the Perps withdraw confirmation, mUSD conversion and Money account deposit and withdraw. It was still Inter at weight 500, sized 64/40/30/20px with line heights 70/44/33/22px, using legacy component-library `Text` and a raw `<input>` sized in `ch`. Mobile moves the same component to Grotzec in [#38135](MetaMask/metamask-mobile#38135). **What is the improvement?** - **MMDS `Input`.** The `<input>` is now the MMDS `Input` (`textVariant={AmountDisplayLg}`, `font-hero`, `isStateStylesDisabled`). The symbol is MMDS `Text` `AmountDisplayLg` + `FontFamily.Hero`. - **Width.** The `ch` estimate is replaced with the hidden measuring `Text` that its Perps twin (`PerpsFiatHeroAmountInput`) uses. The measuring `Text` is set in the same font, so the input width is exact for Grotzec and for fallback symbols. - **Sizing.** Sizes come from the shared scale in #47564: 88, 72, 60, 48, 40, 32, 24, 20px, taking the largest step at which the symbol and amount fit the input's measured width (`useAmountInputFontSize`, one `ResizeObserver` per input; 328px is only the fallback before the first measurement). Line height equals font size. In the expanded view long amounts stay large instead of shrinking early. At the 328px popup width, `$25` is 88px, `$1234567.89` is 72px and a 20-digit amount is 32px. The row and the `rounded-lg` skeleton are both 88px, as in Mobile #38135. - **Unchanged.** Test IDs (`custom-amount-input`, `custom-amount-symbol`, `custom-amount-skeleton`), cents-only display, the 2-decimal input pattern, `autoFocus` and the alert and disabled colours are unchanged. The E2E page objects use the same test IDs. **Risks** - This changes the hero on five confirmation flows at once: Perps deposit, Perps withdraw, mUSD conversion, and Money deposit and withdraw. - Symbols Grotzec lacks (₹ ₩ ₿ …) render in the fallback family. The shared scale budgets for their extra width. - The weight changes from 500 Inter to the Bold Grotzec cut. ## **Changelog** CHANGELOG entry: Updated the MetaMask Pay amount input to the Grotzec typeface ## **Related issues** Epic: [TMCU-1741](https://consensyssoftware.atlassian.net/browse/TMCU-1741). A child ticket is still to be created. Depends on: #47564 Split from: #47557 ## **Manual testing steps** 1. Load this branch in the extension. 2. Start a Perps deposit. Confirm the amount is Grotzec at 88px for `25`. Then type `123456789012.34` one key at a time and confirm it steps down 88 → 72 → 60 → 48px and stays centred. 3. Click Max or a percentage and confirm the amount shows at most 2 decimals. 4. Enter more than the balance and confirm the amount turns red. 5. Repeat the short and long amount check in mUSD conversion and in Money account deposit and withdraw. 6. Repeat in the expanded view, where long amounts stay larger instead of shrinking early, and in the side panel, where they step down smoothly as the width narrows. ## **Screenshots/Recordings** ### Before / After by code owner Before is `main` @adeaf9ad59 and After is the UAT head (#47557) @28a7077e43, both recorded with the same typing script (type 5, then 500000000000000000, then clear). #### MM Pay custom amount | Before | After | | --- | --- | | <img width="360" src="https://github.com/user-attachments/assets/ce28237e-b7de-4816-9a62-4dfab0d2577d" alt="MM Pay custom amount before, side panel"> | <img width="360" src="https://github.com/user-attachments/assets/10617750-5f69-4a1a-8700-a1e1ebef52be" alt="MM Pay custom amount after, side panel"> | | <img width="360" src="https://github.com/user-attachments/assets/a30507a6-420a-4c2a-b240-0176ec1c8f3c" alt="MM Pay custom amount before, expanded view"> | <img width="360" src="https://github.com/user-attachments/assets/7d9fbaf6-c0d0-4590-bac4-4d724808e4da" alt="MM Pay custom amount after, expanded view"> | Full MP4s: [Side panel before](https://github.com/user-attachments/assets/940444b2-140e-47f1-ae07-ad0e2a79fb68) · [Side panel after](https://github.com/user-attachments/assets/b754992c-b785-4fe0-a25c-50da625a0453) · [Expanded before](https://github.com/user-attachments/assets/377356c2-15f9-4d26-9572-af2ee51624e0) · [Expanded after](https://github.com/user-attachments/assets/96562d58-8e05-4ebb-99bf-0285eaf55c1b) ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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-b3180cce-a244-5330-95e3-35b5951ff3b4?cursor_ref=pr_footer&cursor_cta=open_in_web"><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-b3180cce-a244-5330-95e3-35b5951ff3b4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><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> [TMCU-1741]: https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [TMCU-1741]: https://consensyssoftware.atlassian.net/browse/TMCU-1741?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > The same hero control drives several MM Pay confirmation flows; visual and sizing behavior change via the shared component, though fiat display rules and input constraints stay equivalent. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 30842bf. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
…#47490) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Stacked on #47455 (`feat/telemetry-last-activity-state-writes`). Adds the ADR 0068 Option C `msSinceLastUiInteraction` signal to sampled State Persist writes. Trusted `pointerdown` and `keydown` events in MetaMask UI surfaces are throttled to once per second and forwarded to the background through a new `AppStateController:recordUiInteraction` messenger action. The background stamps `lastUiInteractionAt` in `storage.session` and sampled writes expose `state.write.ms_since_ui_interaction`. It's on purpose that this path is separate from `setLastActiveTime`, which only runs while auto-lock is enabled and uses a broader idle-timer event set. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** 1. Reproduce manual testing steps detailed in this PR: #46286 2. Confirm `ms_since_ui_interaction` property is now added to `state.write` metdata of [State Persist](https://metamask.sentry.io/explore/traces/?project=273496&query=transaction%3A%22State%20Persist%22&statsPeriod=30d) traces in Sentry. <img width="714" height="582" alt="Screenshot 2026-11-03 at 15 33 37" src="https://github.com/user-attachments/assets/b62e518b-b036-42d9-b34e-75e962ddf3f2" /> <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. Made with [Cursor](https://cursor.com) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Observability-only changes with throttled listeners, ignored failures, and no auth or persistence logic changes beyond existing session last-activity fields. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1d66f4e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## **Description** Search fields are wrapped in a native `<search>` landmark. Their accessible name now comes from `TextFieldSearch`'s required `inputAriaLabel` prop. `@metamask/design-system-react@0.49.0` added that prop. It sets `aria-label` on the inner input and overrides `inputProps['aria-label']`. It does not copy the placeholder. This PR bumps the design-system packages so every search field can pass `inputAriaLabel` directly ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** 1. Open the extension and go to a page with search: Manage tokens, account list, side nav account search, network list, bridge asset picker, send asset and recipient filters, perps market list, and Discover search. 2. Type in each search field and confirm filtering still works. 3. Confirm the clear button still clears the query. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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-8335f388-00e0-502e-a5f5-9217b04c95b0?cursor_ref=pr_footer&cursor_cta=open_in_web"><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-8335f388-00e0-502e-a5f5-9217b04c95b0&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><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> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Mostly dependency and markup/accessibility updates across UI with snapshot and test follow-ups; no auth, payments, or core transaction logic changes. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5c9d333. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
## **Description** Removes unused imports and locals in the batch-sell review flow and the batch-sell selector tests, as reported by `tsc --noUnusedLocals`. The helpers `hasAnyEnabledAsset` and `hasAtLeastOneQuoteAvailable` stay; only an unused import of them in `total-received-modal.tsx` is removed. The modal still receives `anyEnabledAsset` and `atLeastOneQuoteAvailable` as props. Owner set: none (no CODEOWNERS match for any touched file). | path | removed (file / symbol / class) | why dead | | --- | --- | --- | | `ui/pages/batch-sell/pages/review/components/total-received-modal.tsx` | `useMemo`, `hasAnyEnabledAsset`, `hasAtLeastOneQuoteAvailable` imports | unused local | | `ui/pages/batch-sell/pages/review/hooks/useBatchSellAggregateValidation.ts` | `BigNumber`, `getNativeAssetForChainId` imports | unused local | | `ui/pages/batch-sell/pages/review/hooks/useBatchSellQuotesFetching.ts` | `CaipAssetType` import | unused local | | `ui/pages/batch-sell/pages/review/utils/buildQuoteRequest.test.ts` | `ASSET_ID` | unused local | | `ui/ducks/batch-sell/selectors.test.ts` | `MOCK_SOLANA_ACCOUNT`, `ALL_NETWORKS`, `MOCK_SOLANA_NETWORK` | unused local (`MOCK_SOLANA_NETWORK` is a cascade: its only reader was `ALL_NETWORKS`) | Every removed item was proven with a whole-repo whole-word search. Other `MOCK_SOLANA_ACCOUNT` hits are a different export in `test/data/bridge/mock-bridge-store.ts`. Other `*_ASSET_ID` names in the selector test are different locals. `hasAnyEnabledAsset` and `hasAtLeastOneQuoteAvailable` remain used by the review page. Checked against the diffs of all 562 open PRs: none edit these files. Declaration blame is June–July 2026, outside the 60-day window, and these files last changed before the 30-day window. No user-facing behavior change. Checks passed: `yarn lint:tsc`, eslint on the touched files, and `yarn test:unit --coverage=false` for `ui/ducks/batch-sell` plus the touched review tests (96 tests, no snapshot updates). Docs/comments updated: none ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **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 Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Import and test-fixture deletions only; batch-sell logic and UI props are unchanged. > > **Overview** > Dead-code cleanup in the batch-sell review flow and selector tests so **`tsc --noUnusedLocals`** stays clean. No runtime or UI behavior changes. > > **Review flow:** Drops unused imports from **`total-received-modal.tsx`** (`useMemo`, `hasAnyEnabledAsset`, `hasAtLeastOneQuoteAvailable`); the modal still uses **`anyEnabledAsset`** and **`atLeastOneQuoteAvailable`** from props. **`useBatchSellAggregateValidation`** and **`useBatchSellQuotesFetching`** lose unused **`BigNumber`**, **`getNativeAssetForChainId`**, and **`CaipAssetType`** imports. **`buildQuoteRequest.test.ts`** removes an unused **`ASSET_ID`** constant. > > **Tests:** **`selectors.test.ts`** removes unused Solana fixtures (**`MOCK_SOLANA_ACCOUNT`**, **`MOCK_SOLANA_NETWORK`**, **`ALL_NETWORKS`**) that nothing referenced after other test setup. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0fe01f8. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
## **Description** Removes two unused imports reported by `tsc --noUnusedLocals`. `infuraProjectId` remains the live constant in `shared/constants/network.ts`; only the unused import in the multichain network selectors is removed. `ProductType` remains used by subscription hooks; only the unused import in `ui/selectors/subscription/subscription.ts` is removed. Owner set: none (no CODEOWNERS match for any touched file). | path | removed (file / symbol / class) | why dead | | --- | --- | --- | | `ui/selectors/multichain/networks.ts` | `infuraProjectId` import | unused local | | `ui/selectors/subscription/subscription.ts` | `ProductType` import | unused local | Whole-repo whole-word search: remaining `infuraProjectId` hits are the live constant, its callers, and docs/fixtures. Remaining `ProductType` hits are other files that import the type themselves. Open PRs mention `infuraProjectId` in unrelated diffs; none edit these two files, and none mention `ProductType`. `infuraProjectId` import blame is 2026-03-02 (file last changed 2026-08-17). `ProductType` import blame is 2025-09-24 (file last changed 2026-06-12). No user-facing behavior change. Checks passed: `yarn lint:tsc`, eslint on the touched files, and `yarn test:unit --coverage=false` for `ui/selectors/multichain/networks.test.ts` and `ui/selectors/subscription/subscription.test.ts` with no snapshot updates. Docs/comments updated: none ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **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 Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Import-only cleanup with no runtime or type surface changes beyond satisfying the compiler. > > **Overview** > Removes **unused imports** flagged by `tsc --noUnusedLocals` in two selector modules, with no logic or export changes. > > In `ui/selectors/multichain/networks.ts`, the **`infuraProjectId`** import from shared network constants is dropped; the file still uses **`CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP`**, and **`infuraProjectId`** remains defined and used elsewhere in the repo. > > In `ui/selectors/subscription/subscription.ts`, the unused **`ProductType`** import from `@metamask/subscription-controller` is removed; subscription selectors still rely on **`PRODUCT_TYPES`**, **`Subscription`**, and related types. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 46b2290. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
## **Description** Removes an unused type import from the IndexedDB storage adapter test. `tsc --noUnusedLocals` reports TS6192: every binding in that import (`StorageAdapter`, `StorageGetResult`) is unused. The value import of `STORAGE_KEY_PREFIX` from the same package stays. Owner set: none (no CODEOWNERS match). | path | removed (file / symbol / class) | why dead | | --- | --- | --- | | `shared/lib/stores/indexeddb-storage-adapter.test.ts` | `StorageAdapter`, `StorageGetResult` type import | unused local | Whole-repo whole-word search: other `StorageAdapter` and `StorageGetResult` hits are the live types in the adapter and its callers, not this test import. No open PR edits this file. Import blame and the file's last change are both 2026-08-20, outside the 60-day and 30-day windows. No user-facing behavior change. Checks passed: `yarn lint:tsc`, eslint on the touched file, and `yarn test:unit --coverage=false shared/lib/stores/indexeddb-storage-adapter.test.ts` with no snapshot updates. Docs/comments updated: none ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **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 Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Test-only import cleanup with no production or behavioral changes. > > **Overview** > Removes an unused `import type` of **`StorageAdapter`** and **`StorageGetResult`** from **`indexeddb-storage-adapter.test.ts`**, fixing **`tsc --noUnusedLocals`** (TS6192). The value import of **`STORAGE_KEY_PREFIX`** is unchanged; tests and runtime behavior are unaffected. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 2dbef62. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
## **Description** Removes unused imports in three `ui/pages` files. This branch was pushed on 2026-11-04 and still has no pull request. The diff still applies cleanly onto current `main`. Owner set: none (no CODEOWNERS match for any touched file). | path | removed (file / symbol / class) | why dead | | --- | --- | --- | | `ui/pages/networks/networks-page-list.tsx` | `NetworkConfiguration` import | unused local | | `ui/pages/unlock-page/reset-password-modal.tsx` | `useContext` import | unused local | | `ui/pages/multi-srp/import-srp/import-srp.tsx` | `useEffect`, `MetaMaskReduxDispatch` imports | unused local | No user-facing behavior change. Docs/comments updated: none ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **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 Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Import-only cleanup with no logic, auth, or data-path changes. > > **Overview** > Removes dead import lines in three `ui/pages` modules with **no runtime or UI changes**. > > In **`import-srp.tsx`**, drops unused **`useEffect`** from the React import and the unused **`MetaMaskReduxDispatch`** type. In **`networks-page-list.tsx`**, removes the unused **`NetworkConfiguration`** type from `@metamask/network-controller` (the file still uses **`AddNetworkFields`** and **`MultichainNetworkConfiguration`**). In **`reset-password-modal.tsx`**, trims unused **`useContext`** from the React import. > > This is housekeeping aligned with proactive dead-code cleanup; behavior of import SRP, networks list, and reset-password flows is unchanged. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3362ef9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
…47608) <!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Shield subscription E2E tests sometimes click Get started while the Shield entry modal is still sliding up. The click misses, the modal stays open, and the test times out waiting for the Shield plan page. **Flake type:** Race Conditions with React Re-renders **Root cause:** - The test opens Settings, then Transaction Shield, which opens the Shield entry modal. - The modal slides up for about 400ms, and a large animation canvas loads inside it while the buttons are still moving. - The test sees the modal and clicks Get started about 95ms later. - The click hits while the button is still moving, so it misses. - The modal stays open on top of Settings. - The test then waits for the Shield plan page and times out after 10 seconds. - The same miss fails the monthly crypto subscription, the annual card subscription, and the settings back-button test. - The navigation tests also click Back before the Shield plan page has finished opening, so Back is pressed while the wallet is still on the modal. **Solution:** - Get started and Skip now wait until the button can be clicked and has stopped moving, then click and wait for the button to disappear, so the click lands after the slide-up animation. - The navigation tests wait until the Shield plan page is loaded before clicking Back, so Back is only pressed once that page is on screen. Slack: https://consensys.slack.com/archives/CTQAGKY5V/p1793775998824649?thread_ts=1793693705.182669&cid=CTQAGKY5V ## **Changelog** CHANGELOG entry: null <!-- ## **Related issues** Fixes: --> ## **Manual testing steps** 1. Start a test build with `yarn start:test`. 2. Run the Shield subscription spec: ```bash SELENIUM_BROWSER=chrome yarn test:e2e:single test/e2e/tests/shield/shield-plan-subscription.spec.ts --browser=chrome ``` 3. Confirm these cases pass: - Shield Settings Subscription, monthly plan, crypto payment - Shield Settings Subscription, annual plan, card payment - Navigation test that returns to Settings when Back is clicked ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** CI failure screenshot (`should subscribe to the shield plan from the settings > shield - monthly plan`, `should subscribe to the shield plan from the settings > shield - annual plan`, and `should shield-plan page redirect to settings page when user clicks back button`): Shows the Settings page in the background (`Preferences`, `Notifications`, `Security and privacy`, `Privacy`, `Backup and security`, `Transaction Shield`) with the `"Introducing Transaction Shield"` modal (`[data-testid="shield-entry-modal"]`) still open on top of Settings. Inside the modal body, the heading, subtitle, and 252px Rive shield illustration fill almost the entire modal height (`395px`), leaving only a ~2px white sliver of the `"Start 14-day free trial"` button (`[data-testid="shield-entry-modal-get-started-button"]`) visible at the very bottom edge because the click fired while the modal and Rive canvas were still animating/mounting and missed the button. ### **After** No product UI change. Get started and Skip wait until the button is clickable and has stopped moving before clicking and waiting for it to disappear, and the navigation tests wait for the Shield plan page to load before clicking Back. ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Overview** > Unable to generate summary. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 0820e93. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor <cursoragent@cursor.com>
## **Description** After a non-EVM network (e.g. Solana, Tron) is selected on the Home page, the Send network list only showed non-EVM networks. Send builds its network list from tokens that were loaded by the Home network filter, so EVM networks had no loaded assets. This change loads the selected account group's assets across all configured networks when the Send assets hook mounts, so the Send network list shows the full set of networks regardless of the Home filter. ## **Changelog** CHANGELOG entry: Fixed a bug where the Send network list only showed non-EVM networks after a non-EVM network was selected on the Home page ## **Related issues** Fixes: #47384 ## **Manual testing steps** 1. Go to Home and select a non-EVM network (e.g. Solana) in the network filter. 2. Switch to another account. 3. Click Send. 4. Open the network dropdown in the Send flow. 5. Verify the full list of networks is shown, including EVM networks such as Ethereum Mainnet. ## **Screenshots/Recordings** ### **Before** N/A ### **After** https://github.com/user-attachments/assets/80789ab6-ddad-4d88-b304-7c651432b8da ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Overview** > Unable to generate summary. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 1c6daf2. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor <cursoragent@cursor.com>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Adds money deposit deeplink, to achieve parity with mobile <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: add money deposit deeplink ## **Related issues** Fixes: n/a ## **Manual testing steps** 1. Run the extension 2. Visit https://link.metamask.io/money-account-deposit in the browser 3. You should see the deposit modal ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** n/a <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/1ea57d1b-eecd-4070-aad2-ae50865448de <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Introduces a new entry into the Money deposit confirmation flow and changes navigation/history behavior for that path, though eligibility checks and failure fallbacks mirror existing Money patterns. > > **Overview** > Adds **`https://link.metamask.io/money-account-deposit`** for extension parity with mobile. The new deep link maps to **`/money-home/deposit`**, a bridge page that waits for Money account availability, starts a deposit, and **replaces** itself with the deposit confirmation so back returns to **Money home**; ineligible users or failed setup go to wallet home. > > Supporting changes: **`useMoneyAccountDeposit.initiateDeposit`** now resolves **`true`/`false`**, accepts **`replaceConfirmation`** and **`goBackTo`**, and ignores duplicate in-flight calls; **`navigateToTransaction`** supports **`replace`** for history. The path is on the interstitial-protected list and includes locale copy for the link title. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8c2e98f. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Version Bump After Release This PR bumps the main branch version from 13.57.0 to 13.58.0 after cutting the release branch. ### Why this is needed: - **Nightly builds**: Each nightly build needs to be one minor version ahead of the current release candidate - **Version conflicts**: Prevents conflicts between nightlies and release candidates - **Platform alignment**: Maintains version alignment between MetaMask mobile and extension - **Update systems**: Ensures nightlies are accepted by app stores and browser update systems ### What changed: - Version bumped from `13.57.0` to `13.58.0` - Platform: `extension` - Files updated by `set-semvar-version.sh` script ### Next steps: This PR should be **manually reviewed and merged by the release manager** to maintain proper version flow. ### Related: - Release version: 13.57.0 - Release branch: release/13.57.0 - Platform: extension - Test mode: false --- *This PR was automatically created by the `create-platform-release-pr.sh` script.* Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
## **Description** This pull request introduces several improvements and new utilities to the Bitcoin end-to-end (E2E) test suite, focusing on more robust and flexible Bitcoin transaction testing. The most significant changes include new helper functions for sending and confirming Bitcoin transactions, enhanced activity tab assertions, and refactoring of the Bitcoin node seeder for improved block mining and address management. **E2E Bitcoin transaction flow enhancements:** * Added `landOnBitcoinSendScreen`, `confirmBitcoinSendAndAssertPending`, and `waitForBitcoinSendConfirmation` helper functions to streamline and clarify Bitcoin send E2E flows, including robust balance checks and confirmation waits. [[1]](diffhunk://#diff-12faa4bbc8672b24b5b1ab66785152b91f63b431785307f7b261e88e2e8efe49R4-R42) [[2]](diffhunk://#diff-12faa4bbc8672b24b5b1ab66785152b91f63b431785307f7b261e88e2e8efe49R84-R143) **Activity tab and transaction status assertions:** * Enhanced the `ActivityTab` page object with methods to wait for transactions with a specific amount and status, improving reliability of transaction state assertions in tests. [[1]](diffhunk://#diff-af5a4e69660c3aecba247b96e1878009cdb4158dee534de0bfa486aee226a17aR81-R83) [[2]](diffhunk://#diff-af5a4e69660c3aecba247b96e1878009cdb4158dee534de0bfa486aee226a17aR511-R570) **Bitcoin node seeder improvements:** * Refactored `BitcoinNode` to add a `mineBlocks` method for mining blocks to a fresh address, centralized address generation via a new `getNewAddress` helper, and removed unused P2P port configuration. [[1]](diffhunk://#diff-e17aad52c59176635dd97c1e03cf95e92c340dd99f249e9b58038760a0c5533eL41) [[2]](diffhunk://#diff-e17aad52c59176635dd97c1e03cf95e92c340dd99f249e9b58038760a0c5533eR362-R376) [[3]](diffhunk://#diff-e17aad52c59176635dd97c1e03cf95e92c340dd99f249e9b58038760a0c5533eL632-R646) [[4]](diffhunk://#diff-e17aad52c59176635dd97c1e03cf95e92c340dd99f249e9b58038760a0c5533eR675-R678) [[5]](diffhunk://#diff-e17aad52c59176635dd97c1e03cf95e92c340dd99f249e9b58038760a0c5533eL774-R788) [[6]](diffhunk://#diff-e17aad52c59176635dd97c1e03cf95e92c340dd99f249e9b58038760a0c5533eL793-R807) **Test and assertion robustness:** * Improved assertions on the Bitcoin review transaction page to check for the exact send amount using a stricter selector and value comparison. [[1]](diffhunk://#diff-479d4f36276fc7f5132be843d652bcba71848d95c8c7ba330c8eb49860c13e61R1) [[2]](diffhunk://#diff-479d4f36276fc7f5132be843d652bcba71848d95c8c7ba330c8eb49860c13e61L69-R73) * Added error checking for invalid value errors in the send page, making negative test cases clearer and more maintainable. [[1]](diffhunk://#diff-23828c5e64c661f3108743386dec1d663d909fafaff393d01548c25e6d6e754cR69-R72) [[2]](diffhunk://#diff-23828c5e64c661f3108743386dec1d663d909fafaff393d01548c25e6d6e754cR250-R254) **Test coverage and fixtures:** * Introduced a comprehensive test suite for `withBitcoinFixtures`, covering fixture forwarding, node options, static mocks, error propagation, and custom hooks. * Added a unit test for the new `mineBlocks` method in the Bitcoin node helper tests. * Added a `refreshPage` utility to the home page object to ensure UI state is reliably updated after network or balance changes. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: WPN-2136 ## **Manual testing steps** 1. Build and load the extension, then unlock the test wallet. 2. Select Bitcoin and open the Send flow. 3. Enter a valid recipient without an amount, continue, and verify that a transaction error is shown and Continue becomes disabled. 4. Enter the available BTC balance minus the displayed network fee and verify that the transaction can be reviewed and submitted. 5. Send `0.5 BTC` and open Activity. 6. Verify that the activity entry displays `-0.5 BTC`, initially shows Pending, and changes to Confirmed after the transaction is mined. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are confined to E2E test helpers, mocks, and page objects; production wallet or send logic is not modified. > > **Overview** > Expands Bitcoin send E2E coverage by splitting the old monolithic send specs into focused scenarios under `tests/send/bitcoin/` (invalid address, empty amount, over-balance, review amounts, max send, partial send with on-chain confirmation). Those specs share a new **`withBitcoinFixtures`** wrapper that starts anvil plus an optional regtest `BitcoinNode`, wires `proxyBitcoinBlockchainCalls` or static `mockInitialFullScan`, and registers the usual price/token mocks. > > **Test infrastructure changes:** Esplora **`POST /tx`** now returns the real witness-stripped txid (with unit tests in `bitcoin-esplora.test.ts`); **`BitcoinNode.mineBlocks`** and shared **`getNewAddress`** support confirming sends in E2E; regtest bitcoind drops P2P port allocation and runs with **`-listen=0`**. Page objects gain **`HomePage.refreshPage`**, **`SendPage.checkInvalidValueError`**, stricter snap review amount matching via XPath, and **`ActivityTab.checkWaitForTransactionStatusByAmount`** for rows identified by amount. The shared **`broadcastBitcoinSend`** flow file is removed in favor of inline steps (activity spec updated). Jest coverage documents **`withBitcoinFixtures`** behavior and **`mineBlocks`** RPC usage. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 3d62499. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…of Extension risk-management failures (#47473) ## **Description** TP/SL and close could act on a position the provider no longer had. The trader then got a generic failure ("Failed to update TP/SL / Order could not be placed", or "No position found for {asset}" on older controllers) and was left on a dead form. Root cause: 1. In modify or close mode, order entry never checked that the position still existed. A missing position fell through to `perpsPlaceOrder`. 2. The controller's `POSITION_NOT_FOUND` rejection was shown as a generic error, and positions were not refreshed. 3. Positions seeded from the controller cache (written only while the WebSocket is down) looked live. They suppressed the REST fallback, and the market page offered Close and TP/SL on them. Fix: - `PerpsDataChannel` gains `seedData` / `isSeeded`. A seed shows at once but does not count as hydrated, so the 3s REST fallback still replaces it. `usePerpsLivePositions` exposes `isSeeded`. - The market page disables the auto-close row and the Modify and Close CTAs while positions are seeded. Order entry keeps submit disabled in modify/close mode until live positions arrive. - A missing position on submit, or a `POSITION_NOT_FOUND` result from order entry, the TP/SL modal or the close modal, now shows "This position is already closed". It also refetches positions and leaves the form. The three surfaces share this through `usePerpsPositionAlreadyClosed`. HIP-3 `xyz:` markets go through the same path. - `refreshPositions` (`skipCache`) drops its response if the positions cache was cleared while it was in flight (account switch, network change or reset), so one account's positions never land in another's view. ## **Changelog** CHANGELOG entry: Fixed TP/SL and close on a perps position that had already closed: the trader is now told it is closed instead of seeing a generic failure ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-4009 ## **Manual testing steps** 1. On Hyperliquid testnet, open a small BTC long and open its market page. 2. Open Modify > Add exposure, so the trade form is showing. 3. Close the position elsewhere (another client or the API), then press the form's submit button. 4. Expect the "This position is already closed" toast and a refreshed market view with Long/Short offered, not "Order could not be placed". 5. Repeat on `xyz:GOLD`. 6. On a live position, set TP/SL from the Auto close row and confirm it saves, then close it from Close and confirm "Position closed". ## **Screenshots/Recordings** <details> <summary>Full evidence gallery and publication receipt</summary> <table> <tr><td align="center" valign="top" width="50%"><strong>The BTC position is listed on Perps home</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/ca5280f47f9575dfcbd7973780bcb57b26ef41324966efddec136b6d2f2c24e4-1.webp?sha=adb3009bc8d5c951" alt="The BTC position is listed on Perps home" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>Close is offered on the BTC position once live data confirms it</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/80b137559d7dd786723a47895dadc66702da5eb69e81b44927db6563f364f808-1.webp?sha=ed85d9098f8cb807" alt="Close is offered on the BTC position once live data confirms it" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>BTC position with Close and Modify enabled after live hydration</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac2-btc-controls-live.png?sha=8ee630e5d84849d1" alt="BTC position with Close and Modify enabled after live hydration" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>The BTC take-profit and stop-loss form is ready</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/33f0ce99acd2ca8eab6b2afe96f2aa6ce87a85fc2c065449e3043b87db6d535a-1.webp?sha=48e3ada81f5c4101" alt="The BTC take-profit and stop-loss form is ready" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>Saving the BTC auto-close prices is allowed</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/de9830cb0eb584e8964f55fe19b61bb6be8d319c55b8437473745ac9d9efae65-1.webp?sha=b9904b3124fec45b" alt="Saving the BTC auto-close prices is allowed" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>The BTC take-profit and stop-loss update succeeds</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/03d820ce44a122edb0ebbc2bf3fe876b99f558f6a44c5e89ac02b4031ea527af-1.webp?sha=0b805dd7a190a0c2" alt="The BTC take-profit and stop-loss update succeeds" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The BTC position shows the new take-profit price</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/4cc1dfdf7adf4144df252fe77a98286c6ce57297f0d40e3dc960e6176d4551b9-1.webp?sha=896b799014e9095b" alt="The BTC position shows the new take-profit price" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>BTC position with the TP/SL update applied</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac1-btc-tpsl-updated.png?sha=eb8859c3c3e41925" alt="BTC position with the TP/SL update applied" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The BTC update confirmation clears so the position actions are reachable</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/5fb8cc7b3845843dee6a91a9741e7786d2edea660e781eeb971e3fa3ea6e91b5-1.webp?sha=9e69fcc3303a6c1b" alt="The BTC update confirmation clears so the position actions are reachable" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>The BTC close form is ready to submit</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/cc4cf034af993053d3a464b8f6827d717621aeb53576eda26671502e447834e5-1.webp?sha=aab69762ab7ccd9b" alt="The BTC close form is ready to submit" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The BTC close succeeds and the trader is told the position closed</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/958ad777b2fc677a0d69229c977db6ceb36c3cc498429ad0800d931739147826-1.webp?sha=ad549560f92a9b0e" alt="The BTC close succeeds and the trader is told the position closed" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>BTC closed from its Close control</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac1-btc-closed.png?sha=96994524f0429c19" alt="BTC closed from its Close control" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The new BTC position is listed on Perps home</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/6369615649c50c363505194fe629851dec17c36b19014a886b930f43ffee037e-1.webp?sha=8e155f19ae2539a9" alt="The new BTC position is listed on Perps home" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>Modify is offered on the new BTC position</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/8dcad1f50225a426b29a2e70d802ca702ee690f6d5bf4f1d41b889b6ebedc3b1-1.webp?sha=81f65879771f3b92" alt="Modify is offered on the new BTC position" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>Show the BTC position options so the trade form can be opened</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/c09029b5d68c7a4c558d43d045be390ba2d768e4bf770c560b7c6e4adf359be8-1.webp?sha=566adde8b2998113" alt="Show the BTC position options so the trade form can be opened" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>The BTC position form is ready to submit</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/c83c12aea2f63ab6295de71806a9549d1895b38b3e987816533a219a4f105038-1.webp?sha=8e14c8d0c653888a" alt="The BTC position form is ready to submit" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The BTC trade form is still open after its position closed elsewhere</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/946d2b66a1e9646739f25c218453161fe9138870ea1be222f69245000ec5e106-1.webp?sha=498b71c5b8e05564" alt="The BTC trade form is still open after its position closed elsewhere" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>BTC trade form still open after the position closed elsewhere</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac3-btc-form-offered.png?sha=b83c0feaac527982" alt="BTC trade form still open after the position closed elsewhere" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The trader is told the BTC position is already closed</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/3d413f39420227f9af1cd2448d83c143d70efd157c0a65c1a92b97418ae2a8c7-1.webp?sha=e773f0b37b2caa25" alt="The trader is told the BTC position is already closed" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>BTC: already-closed message instead of a generic order failure</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac3-btc-already-closed.png?sha=07948b251ab92f57" alt="BTC: already-closed message instead of a generic order failure" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The BTC market view refreshes with no position and offers a new trade</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/f35a920f25d35c6987a668b4eee59e601d4210f6ddb35a19362a1813e85f46fc-1.webp?sha=05514b3bd4c0b249" alt="The BTC market view refreshes with no position and offers a new trade" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>No generic order failure is shown for the closed BTC position</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/26b386d6feedb68fac981b1821e776ae6d40988e6f94313a9f153313646ed6c0-1.webp?sha=289d8beda3309d21" alt="No generic order failure is shown for the closed BTC position" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>BTC market view after the refresh, with Long and Short offered</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac3-btc-view-refreshed.png?sha=cea1238068ad410c" alt="BTC market view after the refresh, with Long and Short offered" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>The xyz:NVDA position is listed on Perps home</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/8d3ded6394b2ecfb826fc6450bfdf4a0e7b5d2e2a7157e7ec10f94e4886112a7-1.webp?sha=f119571cd6a6b76b" alt="The xyz:NVDA position is listed on Perps home" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>Close is offered on the xyz:NVDA position once live data confirms it</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/387feaeb1550bc622dfc2045f16eb0df432bd768c154664a60689508149914bf-1.webp?sha=91f15652be9a18dd" alt="Close is offered on the xyz:NVDA position once live data confirms it" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>xyz:NVDA position with Close and Modify enabled after live hydration</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac2-nvda-controls-live.png?sha=b9e69896f1893a86" alt="xyz:NVDA position with Close and Modify enabled after live hydration" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The xyz:NVDA take-profit and stop-loss form is ready</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/2a35a014868c7ae36baf2852b1cde76c443120cb16bf3e89a8559783ddf05f6c-1.webp?sha=5c795a4135d1fe8e" alt="The xyz:NVDA take-profit and stop-loss form is ready" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>Saving the xyz:NVDA auto-close prices is allowed</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/5b6d962b0ff136c33ff0ffbcf77fbd02a2d66bd785c2bb028523f729251e3888-1.webp?sha=a013e6423a69d328" alt="Saving the xyz:NVDA auto-close prices is allowed" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The xyz:NVDA take-profit and stop-loss update succeeds</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/f8939eea4a993540b5f706c6b16dd3069d984ba9e52a63682d1890add190a507-1.webp?sha=c2f7082225ea5be2" alt="The xyz:NVDA take-profit and stop-loss update succeeds" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>The xyz:NVDA position shows the new take-profit price</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/7252855054c812a18759aa3d4d418d254a71b60eb85131051a3b9701dd05a0fd-1.webp?sha=c2f7082225ea5be2" alt="The xyz:NVDA position shows the new take-profit price" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>xyz:NVDA position with the TP/SL update applied</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac1-nvda-tpsl-updated.png?sha=81518eceac87944d" alt="xyz:NVDA position with the TP/SL update applied" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>The xyz:NVDA update confirmation clears so the position actions are reachable</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/c57b89fffc878e6fdc5a45c93d3a5642a1b71e3c9b20de779593a46152bb443e-1.webp?sha=724a504a764cd145" alt="The xyz:NVDA update confirmation clears so the position actions are reachable" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>Show the xyz:NVDA position options so the trade form can be opened</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/b0871fd4bf78c732aa167f439cbb5a30e9465e0fb0f51e05f073aaa286175891-1.webp?sha=2a5615e789716abb" alt="Show the xyz:NVDA position options so the trade form can be opened" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>The xyz:NVDA position form is ready to submit</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/254c93ef1dc992574a66d979996295a776d013ad6ada509547835692eff4bbba-1.webp?sha=20922bd02175b876" alt="The xyz:NVDA position form is ready to submit" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The xyz:NVDA trade form is still open after its position closed elsewhere</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/faf2b9ebda6405793a02152dec34f1ede9ea2ed1b05b12baffc40a28fa52f137-1.webp?sha=7e48ba36650579a8" alt="The xyz:NVDA trade form is still open after its position closed elsewhere" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>xyz:NVDA trade form still open after the position closed elsewhere</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac4-nvda-form-offered.png?sha=8379ad7fe85dfe81" alt="xyz:NVDA trade form still open after the position closed elsewhere" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The trader is told the xyz:NVDA position is already closed</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/5eb3993d7412eb9e238318755a701a4b86a7994b7aa110f75f5b8abbe326e33b-1.webp?sha=f3a068d8a0a91ab5" alt="The trader is told the xyz:NVDA position is already closed" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>xyz:NVDA: already-closed message instead of a generic order failure</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac4-nvda-already-closed.png?sha=8c2605c5774bb61c" alt="xyz:NVDA: already-closed message instead of a generic order failure" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>The xyz:NVDA market view refreshes with no position and offers a new trade</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/7430ef7fd2ab7cd4182bd622c558f810025addb3d1f3d36bd5d656a8d619d362-1.webp?sha=92d365d97efa050a" alt="The xyz:NVDA market view refreshes with no position and offers a new trade" width="320" /><br/><sub>Unassigned capture.</sub></td><td align="center" valign="top" width="50%"><strong>No generic order failure is shown for the closed xyz:NVDA position</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/stills/453c73f79d9e815752da038977304361ec0e140da2bfde365a6f19a5c387f52b-1.webp?sha=6d734c6abfe9e5b8" alt="No generic order failure is shown for the closed xyz:NVDA position" width="320" /><br/><sub>Unassigned capture.</sub></td></tr> <tr><td align="center" valign="top" width="50%"><strong>xyz:NVDA market view after the refresh, with Long and Short offered</strong><br/><img src="https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/evidence-ac4-nvda-view-refreshed.png?sha=dd0f3ed98478925d" alt="xyz:NVDA market view after the refresh, with Long and Short offered" width="320" /><br/><sub>Unassigned capture.</sub></td><td></td></tr> </table> - **Recipe run video**: [recipe-run.mp4](https://raw.githubusercontent.com/abretonc7s/mm-extension-farm-artifacts/main/fixes/47473-evidence/6a492a25-263d-432d-9f57-9b10d0f3a822/recipe-runs/139905e6-cedb-4737-802c-325752dd6163/videos/recipe-run.mp4?sha=f699350842c57f9d) <!-- farmslot-publication-receipt:start --> <!-- farmslot-publication-receipt:end --> </details> ## **Validation Recipe** <details><summary>recipe.json (95 nodes — TAT-4009: TP/SL and close on a position that already closed)</summary> ```json { "$schema": "https://farmslot.io/schemas/recipe-v1.schema.json", "title": "TAT-4009: TP/SL and close on a position that already closed", "paramsSchema": { "type": "object", "additionalProperties": false, "properties": { "notional": { "type": "string", "default": "12", "description": "USD size of each 1x testnet position." }, "cdp_port": { "type": "number", "default": 7661, "description": "Slot CDP port used by the external-close helper." } } }, "proofTargets": [ { "id": "AC-1", "claim": "[TAT-4009] TP/SL and close actions operate against live position state: if the user can see a position, the client can act on it." }, { "id": "AC-2", "claim": "[TAT-4009] Position state is hydrated, or the TP/SL and close controls are disabled, before those actions are offered.", "proofMode": "review" }, { "id": "AC-3", "claim": "[TAT-4009] If a position closed between render and submit, the user is told it is already closed and the view refreshes, instead of \"No position found for {asset}\"." }, { "id": "AC-4", "claim": "[TAT-4009] HIP-3 xyz: markets resolve position state the same way main-dex markets do." } ], "workflow": { "entry": "setup-unlock", "teardown": "teardown-close-btc", "nodes": { "setup-unlock": { "action": "metamask.wallet.ensure_unlocked", "intent": "Unlock the fixture wallet", "next": "setup-testnet" }, "setup-testnet": { "action": "metamask.perps.start_state", "network": "testnet", "page": false, "positions": false, "orders": false, "intent": "Select and verify Hyperliquid testnet", "next": "setup-btc-flat" }, "setup-btc-flat": { "action": "metamask.perps.assert_positions", "market": "BTC", "state": "none", "intent": "Start with no BTC position so the run owns the one it opens", "next": "setup-btc-open" }, "setup-btc-open": { "action": "metamask.perps.place_order", "market": "BTC", "side": "long", "amount": "{{params.notional}}", "leverage": 1, "order_type": "market", "provider": "hyperliquid", "network": "testnet", "intent": "Open one small 1x long BTC testnet position", "next": "setup-btc-open-assert" }, "setup-btc-open-assert": { "action": "metamask.perps.assert_positions", "market": "BTC", "state": "open", "side": "long", "intent": "Confirm the BTC long is live before using its controls", "next": "setup-btc-perps-home" }, "setup-btc-perps-home": { "action": "ui.navigate", "hash": "#/perps-home", "intent": "Show Perps home with the open BTC position", "next": "setup-btc-position-card" }, "setup-btc-position-card": { "action": "ui.wait_for", "test_id": "position-card-BTC", "timeout_ms": 20000, "intent": "The BTC position is listed on Perps home", "next": "setup-btc-open-position" }, "setup-btc-open-position": { "action": "ui.press", "test_id": "position-card-BTC", "intent": "The trader opens the BTC position from Perps home", "next": "ac2-btc-controls-live" }, "ac2-btc-controls-live": { "action": "ui.wait_for", "selector": "[data-testid=\"perps-close-cta-button\"]:not([disabled])", "timeout_ms": 20000, "intent": "Close is offered on the BTC position once live data confirms it", "next": "ac2-btc-controls-live-capture" }, "ac2-btc-controls-live-capture": { "action": "ui.screenshot", "label": "BTC position with Close and Modify enabled after live hydration", "path": "evidence-ac2-btc-controls-live.png", "intent": "Record the live BTC position with its controls enabled", "next": "ac1-btc-open-tpsl" }, "ac1-btc-open-tpsl": { "action": "ui.press", "test_id": "perps-auto-close-row", "intent": "The trader opens auto-close for the live BTC position", "next": "ac1-btc-tpsl-form" }, "ac1-btc-tpsl-form": { "action": "ui.wait_for", "test_id": "perps-update-tpsl-tp-price-input", "timeout_ms": 10000, "intent": "The BTC take-profit and stop-loss form is ready", "next": "ac1-btc-set-tp" }, "ac1-btc-set-tp": { "action": "ui.set_input", "test_id": "perps-update-tpsl-tp-price-input", "value": "120000", "intent": "The trader enters a BTC take-profit price", "next": "ac1-btc-set-sl" }, "ac1-btc-set-sl": { "action": "ui.set_input", "test_id": "perps-update-tpsl-sl-price-input", "value": "40000", "intent": "The trader enters a BTC stop-loss price", "next": "ac1-btc-save-ready" }, "ac1-btc-save-ready": { "action": "ui.wait_for", "selector": "[data-testid=\"perps-update-tpsl-modal-submit\"]:not([disabled])", "timeout_ms": 10000, "intent": "Saving the BTC auto-close prices is allowed", "next": "ac1-btc-save" }, "ac1-btc-save": { "action": "ui.press", "test_id": "perps-update-tpsl-modal-submit", "intent": "The trader saves the BTC auto-close prices", "next": "ac1-btc-tpsl-updated" }, "ac1-btc-tpsl-updated": { "action": "ui.wait_for", "text": "TP/SL updated successfully", "timeout_ms": 30000, "proves": [ "AC-1" ], "intent": "The BTC take-profit and stop-loss update succeeds", "next": "ac1-btc-tp-shown" }, "ac1-btc-tp-shown": { "action": "ui.wait_for", "test_id": "perps-auto-close-tp-value", "text": "120,000", "text_match": "contains", "timeout_ms": 15000, "proves": [ "AC-1" ], "intent": "The BTC position shows the new take-profit price", "next": "ac1-btc-tpsl-capture" }, "ac1-btc-tpsl-capture": { "action": "ui.screenshot", "label": "BTC position with the TP/SL update applied", "path": "evidence-ac1-btc-tpsl-updated.png", "intent": "Record the BTC position after its TP/SL update", "next": "setup-btc-toast-gone" }, "setup-btc-toast-gone": { "action": "ui.wait_for", "text": "TP/SL updated successfully", "visible": false, "timeout_ms": 15000, "intent": "The BTC update confirmation clears so the position actions are reachable", "next": "ac1-btc-close-scroll" }, "ac1-btc-close-scroll": { "action": "ui.scroll", "selector": "body", "delta_y": -600, "intent": "The BTC page sits at its top so the fixed Close bar is not cut off", "next": "ac1-btc-close-open" }, "ac1-btc-close-open": { "action": "ui.press", "test_id": "perps-close-cta-button", "intent": "The trader opens Close for the live BTC position", "next": "ac1-btc-close-ready" }, "ac1-btc-close-ready": { "action": "ui.wait_for", "selector": "[data-testid=\"perps-close-position-modal-submit\"]:not([disabled])", "timeout_ms": 15000, "intent": "The BTC close form is ready to submit", "next": "ac1-btc-hud-top" }, "ac1-btc-hud-top": { "action": "app.hud", "display": { "position": "top" }, "intent": "Keep the run caption clear of the BTC toast at the bottom of the screen", "next": "ac1-btc-close-submit" }, "ac1-btc-close-submit": { "action": "ui.press", "test_id": "perps-close-position-modal-submit", "intent": "The trader closes the live BTC position", "next": "ac1-btc-closed" }, "ac1-btc-closed": { "action": "ui.wait_for", "text": "Position closed", "timeout_ms": 30000, "proves": [ "AC-1" ], "intent": "The BTC close succeeds and the trader is told the position closed", "next": "ac1-btc-closed-capture" }, "ac1-btc-closed-capture": { "action": "ui.screenshot", "label": "BTC closed from its Close control", "path": "evidence-ac1-btc-closed.png", "intent": "Record the successful BTC close", "next": "ac1-btc-hud-bottom" }, "ac1-btc-hud-bottom": { "action": "app.hud", "display": { "position": "bottom" }, "intent": "Return the run caption to the bottom of the screen", "next": "ac1-btc-closed-venue" }, "ac1-btc-closed-venue": { "action": "metamask.perps.assert_positions", "market": "BTC", "state": "none", "intent": "The venue no longer holds the BTC position the trader closed", "next": "setup-btc-reopen" }, "setup-btc-reopen": { "action": "metamask.perps.place_order", "market": "BTC", "side": "long", "amount": "{{params.notional}}", "leverage": 1, "order_type": "market", "provider": "hyperliquid", "network": "testnet", "intent": "Open a fresh 1x long BTC testnet position for the already-closed journey", "next": "setup-btc-reopen-assert" }, "setup-btc-reopen-assert": { "action": "metamask.perps.assert_positions", "market": "BTC", "state": "open", "side": "long", "intent": "Confirm the new BTC long is live", "next": "setup-btc-reopen-home" }, "setup-btc-reopen-home": { "action": "ui.navigate", "hash": "#/perps-home", "intent": "Show Perps home with the new BTC position", "next": "setup-btc-reopen-card" }, "setup-btc-reopen-card": { "action": "ui.wait_for", "test_id": "position-card-BTC", "timeout_ms": 20000, "intent": "The new BTC position is listed on Perps home", "next": "setup-btc-reopen-position" }, "setup-btc-reopen-position": { "action": "ui.press", "test_id": "position-card-BTC", "intent": "The trader opens the new BTC position from Perps home", "next": "setup-btc-modify-ready" }, "setup-btc-modify-ready": { "action": "ui.wait_for", "selector": "[data-testid=\"perps-modify-cta-button\"]:not([disabled])", "timeout_ms": 20000, "intent": "Modify is offered on the new BTC position", "next": "setup-btc-modify-menu" }, "setup-btc-modify-menu": { "action": "ui.press", "test_id": "perps-modify-cta-button", "timeout_ms": 20000, "intent": "Open the Modify menu for the BTC position", "next": "setup-btc-modify-menu-open" }, "setup-btc-modify-menu-open": { "action": "ui.wait_for", "selector": "[data-testid=\"perps-modify-menu-add-exposure\"]", "timeout_ms": 10000, "intent": "Show the BTC position options so the trade form can be opened", "next": "setup-btc-add-exposure" }, "setup-btc-add-exposure": { "action": "ui.press", "test_id": "perps-modify-menu-add-exposure", "intent": "Open the BTC trade form that edits TP/SL or adds to the position", "next": "setup-btc-form" }, "setup-btc-form": { "action": "ui.wait_for", "selector": "[data-testid=\"submit-order-button\"]:not([disabled])", "timeout_ms": 20000, "intent": "The BTC position form is ready to submit", "next": "setup-btc-external-close" }, "setup-btc-external-close": { "action": "command", "timeout_ms": 60000, "intent": "Close the BTC position from outside the open form, as another surface or a trigger fill would", "next": "setup-btc-external-close-assert" }, "setup-btc-external-close-assert": { "action": "assert_output", "source": "setup-btc-external-close", "contains": "\"closed\":true", "intent": "Require the external close to report the BTC position gone", "next": "setup-btc-gone" }, "setup-btc-gone": { "action": "metamask.perps.assert_positions", "market": "BTC", "state": "none", "intent": "Confirm the venue no longer holds a BTC position", "next": "ac3-btc-form-offered" }, "ac3-btc-form-offered": { "action": "ui.wait_for", "selector": "[data-testid=\"submit-order-button\"]:not([disabled])", "timeout_ms": 20000, "intent": "The BTC trade form is still open after its position closed elsewhere", "next": "ac3-btc-submit-scroll" }, "ac3-btc-submit-scroll": { "action": "ui.scroll", "selector": "body", "delta_y": -600, "intent": "The BTC form sits at its top so the fixed Modify Position button is not cut off", "next": "ac3-btc-form-capture" }, "ac3-btc-form-capture": { "action": "ui.screenshot", "label": "BTC trade form still open after the position closed elsewhere", "path": "evidence-ac3-btc-form-offered.png", "intent": "Record the BTC form the trader is about to submit", "next": "ac3-btc-hud-top" }, "ac3-btc-hud-top": { "action": "app.hud", "display": { "position": "top" }, "intent": "Keep the run caption clear of the BTC toast at the bottom of the screen", "next": "ac3-btc-press" }, "ac3-btc-press": { "action": "ui.press", "test_id": "submit-order-button", "intent": "The trader submits the BTC form for a position that no longer exists", "next": "ac3-btc-already-closed" }, "ac3-btc-already-closed": { "action": "ui.wait_for", "text": "This position is already closed", "timeout_ms": 15000, "proves": [ "AC-3" ], "intent": "The trader is told the BTC position is already closed", "next": "ac3-btc-already-closed-capture" }, "ac3-btc-already-closed-capture": { "action": "ui.screenshot", "label": "BTC: already-closed message instead of a generic order failure", "path": "evidence-ac3-btc-already-closed.png", "intent": "Record the BTC already-closed message", "next": "ac3-btc-hud-bottom" }, "ac3-btc-hud-bottom": { "action": "app.hud", "display": { "position": "bottom" }, "intent": "Return the run caption to the bottom of the screen", "next": "ac3-btc-view-refreshed" }, "ac3-btc-view-refreshed": { "action": "ui.wait_for", "test_id": "perps-long-cta-button", "timeout_ms": 15000, "proves": [ "AC-3" ], "intent": "The BTC market view refreshes with no position and offers a new trade", "next": "ac3-btc-no-generic-failure" }, "ac3-btc-no-generic-failure": { "action": "ui.wait_for", "text": "could not be placed", "visible": false, "timeout_ms": 5000, "proves": [ "AC-3" ], "intent": "No generic order failure is shown for the closed BTC position", "next": "ac3-btc-view-refreshed-capture" }, "ac3-btc-view-refreshed-capture": { "action": "ui.screenshot", "label": "BTC market view after the refresh, with Long and Short offered", "path": "evidence-ac3-btc-view-refreshed.png", "intent": "Record the refreshed BTC market view", "next": "setup-gold-flat" }, "setup-gold-flat": { "action": "metamask.perps.assert_positions", "market": "xyz:GOLD", "state": "none", "intent": "Start with no xyz:GOLD position so the run owns the one it opens", "next": "setup-gold-open" }, "setup-gold-open": { "action": "metamask.perps.place_order", "market": "xyz:GOLD", "side": "long", "amount": "{{params.notional}}", "leverage": 1, "order_type": "market", "provider": "hyperliquid", "network": "testnet", "intent": "Open one small 1x long xyz:GOLD testnet position", "next": "setup-gold-open-assert" }, "setup-gold-open-assert": { "action": "metamask.perps.assert_positions", "market": "xyz:GOLD", "state": "open", "side": "long", "intent": "Confirm the xyz:GOLD long is live before using its controls", "next": "setup-gold-perps-home" }, "setup-gold-perps-home": { "action": "ui.navigate", "hash": "#/perps-home", "intent": "Show Perps home with the open xyz:GOLD position", "next": "setup-gold-position-card" }, "setup-gold-position-card": { "action": "ui.wait_for", "test_id": "position-card-xyz:GOLD", "timeout_ms": 20000, "intent": "The xyz:GOLD position is listed on Perps home", "next": "setup-gold-open-position" }, "setup-gold-open-position": { "action": "ui.press", "test_id": "position-card-xyz:GOLD", "intent": "The trader opens the xyz:GOLD position from Perps home", "next": "ac2-gold-controls-live" }, "ac2-gold-controls-live": { "action": "ui.wait_for", "selector": "[data-testid=\"perps-close-cta-button\"]:not([disabled])", "timeout_ms": 20000, "proves": [ "AC-4" ], "intent": "Close is offered on the xyz:GOLD position once live data confirms it", "next": "ac2-gold-controls-live-capture" }, "ac2-gold-controls-live-capture": { "action": "ui.screenshot", "label": "xyz:GOLD position with Close and Modify enabled after live hydration", "path": "evidence-ac2-gold-controls-live.png", "intent": "Record the live xyz:GOLD position with its controls enabled", "next": "ac1-gold-open-tpsl" }, "ac1-gold-open-tpsl": { "action": "ui.press", "test_id": "perps-auto-close-row", "intent": "The trader opens auto-close for the live xyz:GOLD position", "next": "ac1-gold-tpsl-form" }, "ac1-gold-tpsl-form": { "action": "ui.wait_for", "test_id": "perps-update-tpsl-tp-price-input", "timeout_ms": 10000, "intent": "The xyz:GOLD take-profit and stop-loss form is ready", "next": "ac1-gold-set-tp" }, "ac1-gold-set-tp": { "action": "ui.set_input", "test_id": "perps-update-tpsl-tp-price-input", "value": "6000", "intent": "The trader enters a xyz:GOLD take-profit price", "next": "ac1-gold-set-sl" }, "ac1-gold-set-sl": { "action": "ui.set_input", "test_id": "perps-update-tpsl-sl-price-input", "value": "2000", "intent": "The trader enters a xyz:GOLD stop-loss price", "next": "ac1-gold-save-ready" }, "ac1-gold-save-ready": { "action": "ui.wait_for", "selector": "[data-testid=\"perps-update-tpsl-modal-submit\"]:not([disabled])", "timeout_ms": 10000, "intent": "Saving the xyz:GOLD auto-close prices is allowed", "next": "ac1-gold-save" }, "ac1-gold-save": { "action": "ui.press", "test_id": "perps-update-tpsl-modal-submit", "intent": "The trader saves the xyz:GOLD auto-close prices", "next": "ac1-gold-tpsl-updated" }, "ac1-gold-tpsl-updated": { "action": "ui.wait_for", "text": "TP/SL updated successfully", "timeout_ms": 30000, "proves": [ "AC-1", "AC-4" ], "intent": "The xyz:GOLD take-profit and stop-loss update succeeds", "next": "ac1-gold-tp-shown" }, "ac1-gold-tp-shown": { "action": "ui.wait_for", "test_id": "perps-auto-close-tp-value", "text": "6,000", "text_match": "contains", "timeout_ms": 15000, "proves": [ "AC-1", "AC-4" ], "intent": "The xyz:GOLD position shows the new take-profit price", "next": "ac1-gold-tpsl-capture" }, "ac1-gold-tpsl-capture": { "action": "ui.screenshot", "label": "xyz:GOLD position with the TP/SL update applied", "path": "evidence-ac1-gold-tpsl-updated.png", "intent": "Record the xyz:GOLD position after its TP/SL update", "next": "setup-gold-toast-gone" }, "setup-gold-toast-gone": { "action": "ui.wait_for", "text": "TP/SL updated successfully", "visible": false, "timeout_ms": 15000, "intent": "The xyz:GOLD update confirmation clears so the position actions are reachable", "next": "setup-gold-modify-scroll" }, "setup-gold-modify-scroll": { "action": "ui.scroll", "selector": "body", "delta_y": -600, "intent": "The xyz:GOLD page sits at its top so the fixed Modify bar is not cut off", "next": "setup-gold-modify-menu" }, "setup-gold-modify-menu": { "action": "ui.press", "test_id": "perps-modify-cta-button", "timeout_ms": 20000, "intent": "Open the Modify menu for the xyz:GOLD position", "next": "setup-gold-modify-menu-open" }, "setup-gold-modify-menu-open": { "action": "ui.wait_for", "selector": "[data-testid=\"perps-modify-menu-add-exposure\"]", "timeout_ms": 10000, "intent": "Show the xyz:GOLD position options so the trade form can be opened", "next": "setup-gold-add-exposure" }, "setup-gold-add-exposure": { "action": "ui.press", "test_id": "perps-modify-menu-add-exposure", "intent": "Open the xyz:GOLD trade form that edits TP/SL or adds to the position", "next": "setup-gold-form" }, "setup-gold-form": { "action": "ui.wait_for", "selector": "[data-testid=\"submit-order-button\"]:not([disabled])", "timeout_ms": 20000, "intent": "The xyz:GOLD position form is ready to submit", "next": "setup-gold-external-close" }, "setup-gold-external-close": { "action": "command", "timeout_ms": 60000, "intent": "Close the xyz:GOLD position from outside the open form, as another surface or a trigger fill would", "next": "setup-gold-external-close-assert" }, "setup-gold-external-close-assert": { "action": "assert_output", "source": "setup-gold-external-close", "contains": "\"closed\":true", "intent": "Require the external close to report the xyz:GOLD position gone", "next": "setup-gold-gone" }, "setup-gold-gone": { "action": "metamask.perps.assert_positions", "market": "xyz:GOLD", "state": "none", "intent": "Confirm the venue no longer holds a xyz:GOLD position", "next": "ac4-gold-form-offered" }, "ac4-gold-form-offered": { "action": "ui.wait_for", "selector": "[data-testid=\"submit-order-button\"]:not([disabled])", "timeout_ms": 20000, "intent": "The xyz:GOLD trade form is still open after its position closed elsewhere", "next": "ac4-gold-submit-scroll" }, "ac4-gold-submit-scroll": { "action": "ui.scroll", "selector": "body", "delta_y": -600, "intent": "The xyz:GOLD form sits at its top so the fixed Modify Position button is not cut off", "next": "ac4-gold-form-capture" }, "ac4-gold-form-capture": { "action": "ui.screenshot", "label": "xyz:GOLD trade form still open after the position closed elsewhere", "path": "evidence-ac4-gold-form-offered.png", "intent": "Record the xyz:GOLD form the trader is about to submit", "next": "ac4-gold-hud-top" }, "ac4-gold-hud-top": { "action": "app.hud", "display": { "position": "top" }, "intent": "Keep the run caption clear of the xyz:GOLD toast at the bottom of the screen", "next": "ac4-gold-press" }, "ac4-gold-press": { "action": "ui.press", "test_id": "submit-order-button", "intent": "The trader submits the xyz:GOLD form for a position that no longer exists", "next": "ac4-gold-already-closed" }, "ac4-gold-already-closed": { "action": "ui.wait_for", "text": "This position is already closed", "timeout_ms": 15000, "proves": [ "AC-3", "AC-4" ], "intent": "The trader is told the xyz:GOLD position is already closed", "next": "ac4-gold-already-closed-capture" }, "ac4-gold-already-closed-capture": { "action": "ui.screenshot", "label": "xyz:GOLD: already-closed message instead of a generic order failure", "path": "evidence-ac4-gold-already-closed.png", "intent": "Record the xyz:GOLD already-closed message", "next": "ac4-gold-hud-bottom" }, "ac4-gold-hud-bottom": { "action": "app.hud", "display": { "position": "bottom" }, "intent": "Return the run caption to the bottom of the screen", "next": "ac4-gold-view-refreshed" }, "ac4-gold-view-refreshed": { "action": "ui.wait_for", "test_id": "perps-long-cta-button", "timeout_ms": 15000, "proves": [ "AC-3", "AC-4" ], "intent": "The xyz:GOLD market view refreshes with no position and offers a new trade", "next": "ac4-gold-no-generic-failure" }, "ac4-gold-no-generic-failure": { "action": "ui.wait_for", "text": "could not be placed", "visible": false, "timeout_ms": 5000, "proves": [ "AC-3", "AC-4" ], "intent": "No generic order failure is shown for the closed xyz:GOLD position", "next": "ac4-gold-view-refreshed-capture" }, "ac4-gold-view-refreshed-capture": { "action": "ui.screenshot", "label": "xyz:GOLD market view after the refresh, with Long and Short offered", "path": "evidence-ac4-gold-view-refreshed.png", "intent": "Record the refreshed xyz:GOLD market view", "next": "done" }, "done": { "action": "end", "status": "pass" }, "teardown-close-btc": { "action": "command", "allow_failure": true, "timeout_ms": 60000, "intent": "Close a BTC position this run left open, if any", "next": "teardown-close-gold" }, "teardown-close-gold": { "action": "command", "allow_failure": true, "timeout_ms": 60000, "intent": "Close an xyz:GOLD position this run left open, if any", "next": "teardown-assert" }, "teardown-assert": { "action": "metamask.perps.teardown_state", "network": "testnet", "markets": [ "BTC", "xyz:GOLD" ], "positions": { "state": "none" }, "orders": { "state": "none" }, "page": false, "intent": "Assert the run left no BTC or xyz:GOLD positions or orders", "next": "teardown-done" }, "teardown-done": { "action": "end", "status": "pass" } } } } ``` </details> ## **Validation Logs** Run: 2c84b92c-fc27-4d70-ba4d-6e2559c9f7b0 Runner: @metamask/recipe-runner Runner revision: unknown Recipe digest: sha256:f16ce6d15170eafe21fa991ee98d89568f7786795d5115ba14cfab0d4e24b88d <details><summary>Full output (95/95 passed, pass)</summary> ``` # MetaMask Recipe Run Status: pass Duration: 90s Nodes: 95/95 passed ## Side findings - REVIEW 1 distinct application warning/error event(s) (non-blocking; expanded below and stored in diagnostics.json) ## Steps - PASS setup-unlock (metamask.wallet.ensure_unlocked, 321ms): proof=extension-unlocked-state - PASS setup-testnet (metamask.perps.start_state, 468ms): action=metamask.perps.start_state, phase=start_state - PASS setup-btc-flat (metamask.perps.assert_positions, 316ms): matching=0 - PASS setup-btc-open (metamask.perps.place_order, 5.6s): matching=1 - PASS setup-btc-open-assert (metamask.perps.assert_positions, 335ms): matching=1 - PASS setup-btc-perps-home (ui.navigate, 391ms): proof=ui-navigation - PASS setup-btc-position-card (ui.wait_for, 1.0s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps-home, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS setup-btc-open-position (ui.press, 1.1s): clicked=true, selector=[data-testid="position-card-BTC"], [data-test-id="position-card-BTC"], [data-test="position-card-BTC"], tagName=BUTTON, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps-home - PASS ac2-btc-controls-live (ui.wait_for, 1.1s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac2-btc-controls-live-capture (ui.screenshot, 351ms): path=evidence-ac2-btc-controls-live.png - PASS ac1-btc-open-tpsl (ui.press, 1.1s): clicked=true, selector=[data-testid="perps-auto-close-row"], [data-test-id="perps-auto-close-row"], [data-test="perps-auto-close-row"], tagName=DIV, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS ac1-btc-tpsl-form (ui.wait_for, 1.2s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac1-btc-set-tp (ui.set_input, 622ms): set=true, selector=[data-testid="perps-update-tpsl-tp-price-input"], [data-test-id="perps-update-tpsl-tp-price-input"], [data-test="perps-update-tpsl-tp-price-input"], tagName=INPUT, previousLength=0, retainedLength=6 - PASS ac1-btc-set-sl (ui.set_input, 684ms): set=true, selector=[data-testid="perps-update-tpsl-sl-price-input"], [data-test-id="perps-update-tpsl-sl-price-input"], [data-test="perps-update-tpsl-sl-price-input"], tagName=INPUT, previousLength=0, retainedLength=5 - PASS ac1-btc-save-ready (ui.wait_for, 1.4s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac1-btc-save (ui.press, 605ms): clicked=true, selector=[data-testid="perps-update-tpsl-modal-submit"], [data-test-id="perps-update-tpsl-modal-submit"], [data-test="perps-update-tpsl-modal-submit"], tagName=BUTTON, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS ac1-btc-tpsl-updated (ui.wait_for, 1.9s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac1-btc-tp-shown (ui.wait_for, 988ms): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac1-btc-tpsl-capture (ui.screenshot, 269ms): path=evidence-ac1-btc-tpsl-updated.png - PASS setup-btc-toast-gone (ui.wait_for, 1.6s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac1-btc-close-scroll (ui.scroll, 500ms): scrolled=true, mode=relative, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F - PASS ac1-btc-close-open (ui.press, 913ms): clicked=true, selector=[data-testid="perps-close-cta-button"], [data-test-id="perps-close-cta-button"], [data-test="perps-close-cta-button"], tagName=BUTTON, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS ac1-btc-close-ready (ui.wait_for, 1.3s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac1-btc-hud-top (app.hud, 33ms): hud=true, status=running, nodeId=ac1-btc-hud-top, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS ac1-btc-close-submit (ui.press, 507ms): clicked=true, selector=[data-testid="perps-close-position-modal-submit"], [data-test-id="perps-close-position-modal-submit"], [data-test="perps-close-position-modal-submit"], tagName=BUTTON, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS ac1-btc-closed (ui.wait_for, 1.6s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac1-btc-closed-capture (ui.screenshot, 253ms): path=evidence-ac1-btc-closed.png - PASS ac1-btc-hud-bottom (app.hud, 33ms): hud=true, status=running, nodeId=ac1-btc-hud-bottom, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS ac1-btc-closed-venue (metamask.perps.assert_positions, 471ms): matching=0 - PASS setup-btc-reopen (metamask.perps.place_order, 6.3s): matching=1 - PASS setup-btc-reopen-assert (metamask.perps.assert_positions, 409ms): matching=1 - PASS setup-btc-reopen-home (ui.navigate, 649ms): proof=ui-navigation - PASS setup-btc-reopen-card (ui.wait_for, 1.1s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps-home, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS setup-btc-reopen-position (ui.press, 639ms): clicked=true, selector=[data-testid="position-card-BTC"], [data-test-id="position-card-BTC"], [data-test="position-card-BTC"], tagName=BUTTON, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps-home - PASS setup-btc-modify-ready (ui.wait_for, 896ms): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS setup-btc-modify-menu (ui.press, 802ms): clicked=true, selector=[data-testid="perps-modify-cta-button"], [data-test-id="perps-modify-cta-button"], [data-test="perps-modify-cta-button"], tagName=BUTTON, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS setup-btc-modify-menu-open (ui.wait_for, 740ms): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS setup-btc-add-exposure (ui.press, 575ms): clicked=true, selector=[data-testid="perps-modify-menu-add-exposure"], [data-test-id="perps-modify-menu-add-exposure"], [data-test="perps-modify-menu-add-exposure"], tagName=DIV, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS setup-btc-form (ui.wait_for, 921ms): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/trade/BTC?direction=long&mode=modify, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS setup-btc-external-close (command, 1.5s): exitCode=0, stdout={"closed":true,"symbol":"BTC","sizeBefore":"0.00016","orderId":"63961715606","filledSize":"0.00016","error":null} - PASS setup-btc-external-close-assert (assert_output, 95ms): source=setup-btc-external-close, stream=stdout, contains="closed":true - PASS setup-btc-gone (metamask.perps.assert_positions, 298ms): matching=0 - PASS ac3-btc-form-offered (ui.wait_for, 1.1s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/trade/BTC?direction=long&mode=modify, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac3-btc-submit-scroll (ui.scroll, 621ms): scrolled=true, mode=relative, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/trade/BTC?direction=long&mode=modify, cdpTargetId=B82312332D681B81BC207168E106A09F - PASS ac3-btc-form-capture (ui.screenshot, 247ms): path=evidence-ac3-btc-form-offered.png - PASS ac3-btc-hud-top (app.hud, 34ms): hud=true, status=running, nodeId=ac3-btc-hud-top, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/trade/BTC?direction=long&mode=modify - PASS ac3-btc-press (ui.press, 590ms): clicked=true, selector=[data-testid="submit-order-button"], [data-test-id="submit-order-button"], [data-test="submit-order-button"], tagName=BUTTON, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/trade/BTC?direction=long&mode=modify - PASS ac3-btc-already-closed (ui.wait_for, 742ms): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac3-btc-already-closed-capture (ui.screenshot, 239ms): path=evidence-ac3-btc-already-closed.png - PASS ac3-btc-hud-bottom (app.hud, 33ms): hud=true, status=running, nodeId=ac3-btc-hud-bottom, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC - PASS ac3-btc-view-refreshed (ui.wait_for, 937ms): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac3-btc-no-generic-failure (ui.wait_for, 1.1s): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/BTC, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS ac3-btc-view-refreshed-capture (ui.screenshot, 241ms): path=evidence-ac3-btc-view-refreshed.png - PASS setup-gold-flat (metamask.perps.assert_positions, 302ms): matching=0 - PASS setup-gold-open (metamask.perps.place_order, 8.5s): matching=1 - PASS setup-gold-open-assert (metamask.perps.assert_positions, 295ms): matching=1 - PASS setup-gold-perps-home (ui.navigate, 352ms): proof=ui-navigation - PASS setup-gold-position-card (ui.wait_for, 736ms): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps-home, cdpTargetId=B82312332D681B81BC207168E106A09F, runtimeSessionId=0c4a3144-41d5-4c7a-8a19-a0abc2f937f9 - PASS setup-gold-open-position (ui.press, 749ms): clicked=true, selector=[data-testid="position-card-xyz:GOLD"], [data-test-id="position-card-xyz:GOLD"], [data-test="position-card-xyz:GOLD"], tagName=BUTTON, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps-home - PASS ac2-gold-controls-live (ui.wait_for, 965ms): matched=true, cdpPort=7661, targetUrl=chrome-extension://hebhblbkkdabgoldnojllkipeoacjioc/home.html#/perps/market/xyz%3AGOLD, cdpTarge…
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
Alternative to a workaround that makes Back treat history index 0 as "no
previous page." This PR removes the history replace that created this
problem in the first place.
Swap read `from`, `to`, and `amount` from the URL, then deleted them
with `navigate({ replace: true })`. A replace keeps the history index
and assigns a new location key, so a popup that opened directly on Swap
no longer looked like a direct open, and Back left the extension.
The query stays on the URL. Each reader already asks for its own key
(`field`, `isFromTransactionShield`), so the leftover deep-link keys do
not affect them. The same search is applied once per mount, so opening
the token picker and coming back does not overwrite edits.
A full remount of Swap on that same URL applies the deep link again.
## **Changelog**
CHANGELOG entry: Fixed the Back button leaving the extension when Swap
was opened from a link
## **Related issues**
Fixes:
## **Manual testing steps**
1. Open the X cashtag widget and use its Swap action so the popup opens
on Swap.
2. Click Back. The popup should go to Home and stay open.
<!--
## **Screenshots/Recordings**
### **Before**
### **After**
-->
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Changes popup history and deep-link prefill timing (params stay in the
URL; a full Swap remount can re-apply them), which is user-facing but
limited to bridge navigation.
>
> **Overview**
> Fixes **Back** closing the extension when Swap opens from a deep link
by removing the **`replace: true`** navigation that stripped `from`,
`to`, and `amount` from the URL after prefill.
>
> **`useBridgeNavigation`** drops **`resetSearchParams`** and its tests.
**`usePrefillFromSearchQuery`** still reads those query keys into bridge
state but leaves the URL unchanged, using an **`appliedSearch`** ref so
each search string is applied once per mount (avoiding re-prefill when
returning from the token picker). Tests now expect the query string to
remain instead of being cleared.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c47fcd1. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description** Removing the local-only "Converted to mUSD" activity treatment. This labeling is inconsistent and causes confusion when the same transaction is viewed on another instance. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** 1. Run the extension with mUSD conversion enabled 2. Complete an mUSD conversion 3. Open Activity and confirm there is **no** "Converted to mUSD" row 4. After the transfer is indexed, confirm the row matches on-chain reality <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). ## **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_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes how mUSD conversion txs appear in Activity (hidden from list) and removes dedicated details/toasts; verify no code still expects those entries or i18n keys. > > **Overview** > **Removes the local “convert to mUSD” activity experience** so conversions no longer get a synthetic “Converted to mUSD” row, detail screen, or repeat CTA. > > `TransactionType.musdConversion` is **added to `EXCLUDED_TRANSACTION_TYPES`**, so those txs are omitted from unified activity lists. Related UI is deleted (`ConvertDetails`, `ConvertAgainButton`, `convert` branches in headers, row content, and template loader). **Toast handling** for convert activities and early-pending wiring for `musdConversion` are removed; **activity selectors** no longer enrich mUSD conversions with pay-controller source token data. > > **i18n** drops `convertAgain` and the mUSD conversion toast strings across locales; an **eslint suppression** for the removed button file is deleted. Tests for convert toasts are removed accordingly. > > This aligns with the stated goal: avoid inconsistent labeling vs other clients and on-chain views. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 9b4bcc1. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
## **Description** MM Pay requests to the Intents API did not identify which client they came from, so the server could not tell Extension traffic apart from Mobile traffic. [MetaMask/core#11259](MetaMask/core#11259) added an optional `clientId` option to `TransactionPayController`, which is forwarded as the `X-Client-Id` header on Intents API requests. That option is deliberately optional, so it ships as a **no-op until each client opts in**. This PR is the Extension side of that opt-in. `main` already resolves `@metamask/transaction-pay-controller` at `^31.0.0` (which includes the `clientId` option and header coverage for both the `server` and Relay strategies). This PR does **not** bump the dependency. **Change:** pass `clientId: TransactionPayClientId.Extension` when constructing `TransactionPayController`, so Intents / Relay API requests send `X-Client-Id: extension`. Unit test updated to assert the new constructor argument. Diff is two files only: - `app/scripts/messenger-client-init/transaction-pay-controller-init.ts` - `app/scripts/messenger-client-init/transaction-pay-controller-init.test.ts` ## **Changelog** CHANGELOG entry: null <!-- Not end-user-facing: adds a request header used for server-side traffic attribution. No UI or user-visible behaviour changes. --> ## **Related issues** Fixes: [CONF-2191](https://consensyssoftware.atlassian.net/browse/CONF-2191) Depends on: [MetaMask/core#11259](MetaMask/core#11259) (merged; `clientId` option) and [MetaMask/core#11282](MetaMask/core#11282) (merged; extends the header to the Relay API). Both are already in the `^31.0.0` line that `main` resolves. ## **Manual testing steps** The client ID change is only observable in outbound network requests — there is no UI surface. 1. Build and run the extension with a wallet that has a funded balance. 2. Open the background service worker DevTools (`chrome://extensions` → MetaMask → "service worker") and select the **Network** tab. 3. Start an MM Pay flow that routes through the Intents API (`https://intents.api.cx.metamask.io`) — e.g. a deposit where the payment token differs from the token required by the transaction, so a cross-token quote is needed. 4. Find the request to `intents.api.cx.metamask.io/quote` and inspect its **Request Headers**. 5. Verify `X-Client-Id: extension` is present. 6. Continue through to submitting the transaction and verify the same header is present on `/submit` and on the `/status` polling requests. 7. Repeat with a flow that uses the **Relay** strategy and verify the same header is present on its `/quote`, `/execute` and `/status` requests. 8. Verify the pay flow itself still completes normally — quoting, submission and status polling should be unchanged aside from the added header. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. [CONF-2191]: https://consensyssoftware.atlassian.net/browse/CONF-2191?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Single constructor option for request-header attribution; pay flow behavior on the extension side is unchanged aside from inherited controller-package fixes from the dependency bump described in the PR. > > **Overview** > Extension MM Pay now **opts in** to client attribution by passing **`clientId: TransactionPayClientId.Extension`** when wiring up `TransactionPayController` in `transaction-pay-controller-init.ts`. That value is forwarded by the controller as the **`X-Client-Id: extension`** header on Intents (and Relay) API traffic so the backend can distinguish Extension from Mobile. > > The init unit test was updated to assert the new constructor argument alongside the existing callbacks. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 71feea7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Simplify the bottom nav conditional logic. Use declarative layouts instead of custom helpers Prep work for wide layout <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches global routing/layout composition for many authenticated screens, which can regress scroll behavior or chrome visibility if route groupings are wrong. > > **Overview** > **Conditionally rendered shell UI is replaced with route-declarative layouts**, removing `useBottomNavBar`, `isMainNavRoute`, and their tests. > > **`MainLayout` always mounts `AppHeader`, scroll shell, outlet, and `BottomNavBar`**, so tab routes keep a consistent frame without runtime toggles. > > **A new `ContentLayout` wraps secondary Money flows** (`MONEY_*` beyond home) in a scrollable main region **without the bottom nav/header chrome**. > > **`Home` drops duplicate header rendering and split scroll behaviors**, standardizing on the sticky `DappConnectionControlBar` pattern for all home states. > > **`AppHeaderUnlockedContent` always disables the account picker on cross-chain swap paths**, since that flow no longer shares the bottom-nav shell. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 7cf1438. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…ker modal class selectors (#47677) ## **Description** Removes unused class selectors from three `ui/components/multichain` stylesheets. Owner set: `@MetaMask/core-extension-ux`. No component, HTML file, test, snapshot, story, or e2e selector applies these classes, and no stylesheet `@extend`s them. The carousel's `CSSTransition`s use only the `card` and `next-card` prefixes, so nothing generates `empty-state-exit*`. `mm-carousel` is not rendered by this repo or by any `@metamask/*` dependency. The `modal-tab__wrapper` rule in the asset picker modal is still applied and is kept. | path | removed | why dead | | --- | --- | --- | | `ui/components/multichain/carousel/index.scss` | `.empty-state-exit`, `.empty-state-exit-active` | unused class selector (no matching transition prefix) | | `ui/components/multichain/carousel/index.scss` | `.mm-carousel`, `.mm-carousel--single-slide` | unused class selector | | `ui/components/multichain/product-tour-popover/index.scss` | `.multichain-product-tour-menu__permissions-page-tour`, `__button` | unused class selector | | `ui/components/multichain/asset-picker-amount/asset-picker-modal/index.scss` | `.asset-picker-modal__autodetect` | unused class selector | | `ui/components/multichain/asset-picker-amount/asset-picker-modal/index.scss` | `.asset-picker-modal .modal-tab__main-view`, `__loading`, `__fetching` | unused class selector | No user-facing behavior change. Checks: `yarn lint:styles`, Sass compile of each file, `yarn test:unit --coverage=false` on the three component directories (no snapshot updates). No JS/TS changed, so `yarn lint:tsc` and ESLint were not needed. Docs/comments updated: none ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **Before** N/A — no UI change ### **After** N/A — no UI change ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Stylesheet-only deletion of unreachable selectors; no logic, routing, or user-facing behavior changes. > > **Overview** > Removes **dead SCSS** from three multichain UI stylesheets with **no JS/TS or markup changes**, so runtime behavior and layout for still-used rules (e.g. `modal-tab__wrapper` in the asset picker modal) stay the same. > > In **asset-picker-modal**, drops `asset-picker-modal__autodetect` and unused `.modal-tab` blocks (`__main-view`, `__loading`, `__fetching`). In **carousel**, removes legacy `mm-carousel` height rules and unused `empty-state-exit*` transition classes that nothing in the repo applies. In **product-tour-popover**, removes permissions-page positioning overrides and `__button` hover/active styles that no component references. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 87a3b56. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
…amount styles (#47673) ## **Description** Removes the unused `NFTInput` component (with its unit test and snapshot), the unused `asset-picker-amount` barrel and constants files, and the `asset-picker-amount` stylesheet, none of which production code can reach. Owner set: `@MetaMask/core-extension-ux`. `AssetPickerAmount` itself was removed earlier. What remained of the folder root was a barrel nobody imports, a constant nobody imports (`currency-input.js` has its own local `LARGE_SYMBOL_LENGTH`), an `NFTInput` component used only by its own test, and a stylesheet whose classes (`asset-picker-amount`, `__balance`, `__input`, `__input-nft`, `__input__swap`, `__max-clear`) are no longer applied by any component, test, snapshot, story, or e2e selector. `asset-picker-modal/` is untouched. | path | removed | why dead | | --- | --- | --- | | `ui/components/multichain/asset-picker-amount/nft-input/nft-input.tsx` | file (`NFTInput`) | only own test | | `ui/components/multichain/asset-picker-amount/nft-input/nft-input.test.tsx` | file | cascade from `NFTInput` | | `ui/components/multichain/asset-picker-amount/nft-input/__snapshots__/nft-input.test.tsx.snap` | file | cascade from `NFTInput` | | `ui/components/multichain/asset-picker-amount/nft-input/index.ts` | file | unused barrel | | `ui/components/multichain/asset-picker-amount/index.ts` | file | unused barrel | | `ui/components/multichain/asset-picker-amount/constants.tsx` | file (`LARGE_SYMBOL_LENGTH`) | zero refs | | `ui/components/multichain/asset-picker-amount/index.scss` | file (6 classes) | unused class selectors | | `ui/components/multichain/multichain-components.scss` | `@import 'asset-picker-amount'` | cascade from `index.scss` | No user-facing behavior change. Checks: `yarn lint:tsc`, `yarn test:unit --coverage=false ui/components/multichain/asset-picker-amount` (no snapshot updates), `yarn lint:styles`. ESLint had no remaining changed JS/TS files to lint. Docs/comments updated: none ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **Before** N/A — no UI change ### **After** N/A — no UI change ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Deletes unused files and a stylesheet import with no remaining references in production code. > > **Overview** > Removes leftover **asset-picker-amount** folder code after the main `AssetPickerAmount` UI was deleted earlier: the unused root barrel, `LARGE_SYMBOL_LENGTH` constant, and the `index.scss` rules that no component still applies. > > Also deletes **NFTInput** and its unit test/snapshot/barrel, which were only referenced by that test. **`asset-picker-modal/`** stays in place; `multichain-components.scss` drops the `@import 'asset-picker-amount'` line while still importing the modal styles. > > No intended user-facing or runtime behavior change—unreachable code cleanup only. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 8e88136. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** After submitting any swap or bridge, users were sent back to the Home page. They now stay in Swaps, with the token pair kept and the amount cleared so the submitted quote can't be resubmitted. Each submit path is handled where it happens: - **Software wallets** (`useSubmitBridgeTransaction`): there's no navigation. On success the amount is cleared and the user stays on the Swaps page. A failed submit leaves the page and amount untouched. - **Hardware wallets** (`useHwSwapNavigation`): the signing page is opened on top of Swaps. After signing, the hook clears the amount, resets the bridge controller and goes back one history entry. The reset must happen before going back, because the remounted Swaps page restores the amount from the controller's active quote. The token pair is unaffected, since it lives in the Redux bridge slice rather than the controller. Transaction Shield: - Swaps opened from Transaction Shield return to Transaction Shield after submitting, for both software and hardware wallets. - This is a fix for hardware wallets. On `main` they went Home, because the signing page's URL dropped the `isFromTransactionShield` param. `navigateToHwSigningPage` now carries that param over, so post-signing navigation returns to Shield. Unchanged behaviour: - Hardware wallet sends (`sendBundle`) still go Home. - If the hardware wallet signing page is the first history entry, it falls back to Home as before. - Post-trade toasts (EVM and Solana) are unaffected. Analytics side effect: - No metrics code changed, but which `Input Changed` events fire changes for users who leave Swaps with Back after submitting. Back resets the bridge controller, which it always has. When Swaps is reopened, the source token is already the default (native), so a `chain_source` event fires instead of `token_source`. The e2e expectation in `test/e2e/tests/bridge/constants.ts` (`resetPage`) is updated to match. Test changes: - Unit tests for both hooks now expect users to stay in Swaps and check that the amount is cleared. They also cover: hardware wallet sends going Home; Transaction Shield returns for both software and hardware wallets; a failed submit keeping the amount; and the hardware wallet controller reset happening before navigating back. - The swap and bridge e2e tests assumed users land on Home after submitting. A new `goBackAfterSubmit()` page-object step waits for the amount to clear, which confirms the new behaviour, then presses Back to reach Home before the Activity checks. It is called from the shared `verifySubmittedSwapTransaction` flow and from the specs that submit directly: gasless, bridge failure cases, BTC, Solana, smart transactions and Ledger. The "View activity" clicks and `clickViewActivity` were removed because that status page is no longer shown. ## **Changelog** CHANGELOG entry: Users now stay on the Swaps page after submitting a swap or bridge, instead of being sent to the Home page ## **Related issues** Fixes: [SWAPS-5212](https://consensyssoftware.atlassian.net/browse/SWAPS-5212) ## **Manual testing steps** 1. Run the extension and open the popup. 2. Start a swap on an EVM network (e.g. Mainnet or Linea), enter an amount, and submit. 3. Verify you stay on the Swaps page, the same token pair is selected, and the amount is empty. 4. Verify the "Transaction submitted" toast appears and changes to "Transaction confirmed". 5. Press Back and verify you leave Swaps (no duplicate Swaps entry). 6. Repeat steps 2–5 with a Solana swap. 7. Repeat steps 2–5 with a Ledger account, signing on the device. 8. With the Ledger account, send a token and verify you land on the Home page after signing. 9. Open Swaps from Transaction Shield, submit a swap, and verify you are returned to Transaction Shield. 10. Repeat step 9 with the Ledger account and verify you are returned to Transaction Shield after signing. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. [SWAPS-5212]: https://consensyssoftware.atlassian.net/browse/SWAPS-5212?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Touches core swap submission navigation for software and hardware wallets plus Transaction Shield routing, so regressions could strand users on wrong screens; mitigated by broad unit/e2e updates but still warrants careful QA. > > **Overview** > **Navigation + submission flow tweaks** > - Software swap/bridge submissions now avoid bouncing to Home unless the flow originated from Transaction Shield; successful submits stay on Swaps while clearing the source amount, failed submits leave the page untouched, and Transaction Shield launches still replace-route back to Shield. > - `navigateToHwSigningPage` threads the `isFromTransactionShield` query param through hardware wallet signing URLs, and hardware-wallet post-signing navigation differentiates send-bundle, Shield, and standard histories (resetting the bridge controller or popping history as needed while clearing amounts). > > **Tests & tooling** > - Page-object helpers add `goBackAfterSubmit` and update bridge/swap e2e suites (gasless, BTC, Solana, smart transactions, ledger, negative cases, shared flows) to wait for a cleared amount before backing out, assert smart-tx toasts, refresh analytics expectations, and drop the obsolete “View activity” path. > - Unit tests expand for `useBridgeNavigation`, `useSubmitBridgeTransaction`, and `useHwSwapNavigation` to cover the new navigation matrix. > > This is a behavior change across swap submission UX and hardware-wallet routing; mostly covered by updated unit/e2e tests but regression risk remains if any edge navigation path is missing coverage. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c79cf8d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Removes unused class selectors from `ui/pages/settings/index.scss`. Owner set: `@MetaMask/core-extension-ux`. No component, HTML file, test, snapshot, story, or e2e selector applies these classes, and no stylesheet `@extend`s them. `.settings-page__content-item` itself is still applied and is kept, along with its `.dialog` child rule. | path | removed | why dead | | --- | --- | --- | | `ui/pages/settings/index.scss` | `.settings-page__back-button` (incl. RTL rule) | unused class selector | | `ui/pages/settings/index.scss` | `.settings-page__content-item--without-height`, `--disabled` | unused class selector | | `ui/pages/settings/index.scss` | `.settings-page__content-item__title`, `__identicon`, `__description` | unused class selector | No user-facing behavior change. Checks: `yarn lint:styles`, Sass compile of the file, `yarn test:unit --coverage=false ui/pages/settings` (no snapshot updates). No JS/TS changed, so `yarn lint:tsc` and ESLint were not needed. Docs/comments updated: none ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **Before** N/A — no UI change ### **After** N/A — no UI change ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Stylesheet-only deletion of unused selectors; no JS/TS or markup changes. > > **Overview** > Removes **dead SCSS** from `ui/pages/settings/index.scss` with no runtime or visual impact. > > Deleted selectors include `.settings-page__back-button` (including its RTL margin/rotation rules), unused `.settings-page__content-item` modifiers (`--without-height`, `--disabled`), and nested BEM blocks (`__title`, `__identicon`, `__description`). **Kept** rules for `.settings-page__content-item` itself and its `.dialog` child spacing. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 104690b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
## **Description** Removes unused class selectors from `ui/pages/home/index.scss`. Owner set: `@MetaMask/core-extension-ux`. No component, HTML file, test, snapshot, story, or e2e selector applies these classes, and no stylesheet `@extend`s them. The tooltip theme rule is also dead: no `Tooltip` passes a `home__subheader-link--tooltip` theme, so react-tippy never adds `home__subheader-link--tooltip-theme`. The `.tippy-tooltip-content` and `.arrow-regular` rules nested under it go with it. Live siblings (`home__connected-status-popover`, `home__new-network-notification`, and `home__new-tokens-imported-notification` with `-title`, `-message`, `-icon`) are kept. | path | removed | why dead | | --- | --- | --- | | `ui/pages/home/index.scss` | `.home__connected-status-popover-bg`, `.home__connected-status-popover-bg-container` | unused class selector | | `ui/pages/home/index.scss` | `.home__new-network-notification-icon`, `.home__new-network-notification-close` | unused class selector | | `ui/pages/home/index.scss` | `.home__error-message` | unused class selector | | `ui/pages/home/index.scss` | `.home__new-tokens-imported-notification-close` | unused class selector | | `ui/pages/home/index.scss` | `.home__new-network-added` (+ `__check-circle`, `__switch-to-button`) | unused class selector | | `ui/pages/home/index.scss` | `.home__subheader-link` (+ `--tooltip-content*`, `--tooltip-theme`, `--text`) | unused class selector | No user-facing behavior change. Checks: `yarn lint:styles`, Sass compile of the file, `yarn test:unit --coverage=false ui/pages/home` (no snapshot updates). No JS/TS changed, so `yarn lint:tsc` and ESLint were not needed. Docs/comments updated: none ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **Before** N/A — no UI change ### **After** N/A — no UI change ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > CSS-only deletion of unreachable selectors; no JS/TS or markup changes. > > **Overview** > Removes **dead SCSS** from `ui/pages/home/index.scss`—roughly 150 lines of class rules that nothing in the extension references (no JSX/HTML, tests, or `@extend`). > > Dropped blocks include connected-status popover background wrappers, notification icon/close variants, `home__error-message`, the “new network added” success panel styles, and the full `home__subheader-link` tooltip theme subtree. **Still styled** are the live pieces called out in the PR: `home__connected-status-popover`, the flex layout on `home__new-network-notification`, and `home__new-tokens-imported-notification` with `-title`, `-message`, and `-icon`. > > **No user-facing or runtime change**—stylesheet size and maintenance surface only. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f19a568. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
## **Description** Bumps `@metamask/assets-controller` from `^20.2.2` to `^20.2.3`, published from the core release MetaMask/core#11326. The mobile app already took this version in MetaMask/metamask-mobile#39028. `20.2.3` is a patch release. Verified by diffing the published tarballs (20.2.2 vs 20.2.3): the only `dist/` change flips six state-metadata flags — `assetsInfo`, `assetsBalance`, `assetsPrice`, `customAssets`, `assetPreferences` and `selectedCurrency` go from `includeInStateLogs: false` to `true` ([core#11319](MetaMask/core#11319)), so asset state is included in state logs and support can investigate asset issues. Confirmed in the installed package: `node_modules/@metamask/assets-controller/dist/AssetsController.js` sets `includeInStateLogs: true` on all six fields. The `persist`, `includeInDebugSnapshot` and `usedInUi` flags are unchanged. No extension source change is needed. The extension's state logs are built from the flat background state (`memStore.getFlatState()` → UI redux `state.metamask` → downloaded state logs), and these six fields already flow through that path — UI selectors read them from `state.metamask` today — so the extension already surfaces this asset state in its logs, and the metadata flip does not change what the extension logs. The flag matters for metadata-driven clients such as mobile, which started honoring `includeInStateLogs` in MetaMask/metamask-mobile#38227 and can now drop its temporary yarn patch. Core notes this restores the pre-8.18 state-log contents and exposes nothing new. The only other change in the release is the package's `@metamask/assets-controllers` range moving from `^113.1.1` to `^113.2.0`. Extension main already depends on `@metamask/assets-controllers` `^113.2.0` directly (resolved to 113.2.0 in the lockfile), so `package.json` needs only this one bump, and Yarn resolves a single `@metamask/assets-controller@20.2.3` entry in `yarn.lock` (deduped per `yarn lint:lockfile:dedupe`). LavaMoat policies were regenerated with `yarn lavamoat:auto`: no drift, since the bump adds no new packages to the resolution. `attribution.txt` is untouched (the attributions check runs on release branches only). ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: N/A — dependency bump with no linked issue. Core release: MetaMask/core#11326. Sibling mobile bump: MetaMask/metamask-mobile#39028. Follow-up to #47609. ## **Manual testing steps** 1. Build and load this branch, then unlock a wallet that holds tokens on Ethereum Mainnet. 2. Open the home asset list and confirm symbols, balances, and fiat prices still appear. 3. In Settings → Privacy → Download state logs, confirm the downloaded JSON still includes asset state (e.g. `assetsInfo`, `assetsPrice`) and the wallet works normally. <!-- ## **Screenshots/Recordings** ### **Before** ### **After** --> ## **Adversarial review (adverse)** Final verdict (round 1/3): SHIP-WITH-CAVEATS (3/3 ship, 0/3 block) Findings: 0 critical · 2 warning · 4 info. Fixed: none (no code changes). Declined: - Balances entering shareable state logs: no change in extension state-log contents — the six fields already flow into the extension's flat-state logs today, and core#11319 states this exposes nothing new (it restores pre-8.18 mobile contents). - State-log redaction ignoring controller metadata / `includeInStateLogs` having no runtime consumer in the extension: accurate but pre-existing architecture (marked TODO in `state-utils.ts`), out of scope for a patch dependency bump; honoring the flag would be a feature change that alters state-log contents. - LavaMoat policies not regenerated: false premise — `yarn lavamoat:auto` was run and produced no diff (no new packages). - `bump:` commit type instead of `chore:`: kept `chore:` per the direct precedents #47609/#47489. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Lockfile and patch-version dependency bump only; no extension logic changes, typical supply-chain exposure for any npm upgrade. > > **Overview** > **Bumps** `@metamask/assets-controller` from `^20.2.2` to **`^20.2.3`** in `package.json` and refreshes **`yarn.lock`**. > > The lockfile now resolves **`@metamask/assets-controller@20.2.3`** and aligns that package’s **`@metamask/assets-controllers`** dependency with **`^113.2.0`** (matching what the extension already declared), with updated checksums and a tidier dedupe entry for `assets-controllers`. > > No application source changes: this is a dependency-only patch bump (published change is mainly controller metadata such as `includeInStateLogs` for asset-related state fields). > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 4640fa7. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** Updates `phishing-warning` to 6.0.0 with several minor fixes. <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: phishing-warning changelog https://github.com/MetaMask/phishing-warning/releases/tag/v6.0.0 ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/PSAFE-782?xpis=eyJicmlkZ2UiOiJxdWlja0ZpbmQiLCJpZCI6IjE3OTM5MTM0OTAyNjgiLCJzb3VyY2UiOiJqaXJhLXNvZnR3YXJlIn0%3D ## **Manual testing steps** 1. Navigate to `metamask.org` (fake MetaMask website) 2. Observe phishing warning page ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **After** <img width="959" height="720" alt="image" src="https://github.com/user-attachments/assets/1c3ab634-d3d0-43e2-917b-2496ef985fd1" /> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Medium Risk** > Changes the user-facing phishing block/warning experience via a major package bump and new default hosted page version, though extension logic is unchanged. > > **Overview** > Bumps the dev dependency **`@metamask/phishing-warning`** from **5.1.0** to **6.0.0** and refreshes **`yarn.lock`**. There are **no extension source changes**—only the dependency pin and lockfile. > > The new release pulls in **`@metamask/design-tokens` ^8.0.0** (resolved to **8.7.0**) instead of the prior **7.x** line used by v5. Because the build already sets the default phishing warning page URL from **`@metamask/phishing-warning/package.json`**, production builds will target **`https://metamask.github.io/phishing-warning/v6.0.0/`** unless **`PHISHING_WARNING_PAGE_URL`** is overridden; e2e still serves the package **`dist`** from **`node_modules`**. > > Reviewers should treat this as adopting **v6’s warning-page UI/behavior** from the upstream package (the PR screenshot reflects that visual update) and confirm the hosted **v6.0.0** page is available where needed. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 509255b. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** In a previous PR I added a scuttling exception for `Window` that only applies in tests. It [seems to be used by ChromeDriver](https://chromium.googlesource.com/chromium/src/+/refs/tags/137.0.7151.119/chrome/test/chromedriver/js/call_function.js#77) and randomly crashes tests. Unfortunately we also run tests on non-test builds where this is now a problem. Since we already disable scuttling of `window` this doesn't seem like it adds much risk. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Extends an existing pattern (lowercase `window` is already excepted); only broadens scuttling exceptions slightly, with no auth or data-path changes. > > **Overview** > **LavaMoat scuttling:** `Window` (the constructor) is added to the shared `getScuttleGlobalThisExceptions` list so it is **not scuttled in production and test builds**, not only when `args.test` is true. > > The test-only exception list no longer includes `Window` (it stays only for `ret_nodes`, `browser`, `chrome`, `indexedDB`), avoiding duplication and fixing failures when e2e or ChromeDriver touch `Window` on non-test webpack runs. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit db42c52. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…rel files (#47674) ## **Description** Removes five `@MetaMask/core-extension-ux` files that nothing in the repo imports: the `PermissionsHeader` component, the `useNewRPC` hook, and three barrel `index.ts` files whose components are imported directly from their own modules. Owner set: `@MetaMask/core-extension-ux`. | path | removed | why dead | | --- | --- | --- | | `ui/components/multichain/permissions-header/permissions-header.tsx` | file (`PermissionsHeader`) | zero refs | | `ui/components/multichain/network-manager/hooks/useNewRPC.ts` | file (`useNewRPC`) | zero refs | | `ui/components/multichain/global-menu/index.ts` | file | unused barrel | | `ui/components/multichain/funding-method-modal/index.ts` | file | unused barrel | | `ui/pages/settings/backup-and-sync-tab/index.ts` | file | unused barrel | `GlobalMenuList`, `FundingMethodModal`, and the backup and sync settings tab are still live; callers import them from `global-menu-list`, `funding-method-modal`, and `backup-and-sync-tab` directly. The `PermissionsHeader` file uses no locale key that isn't used elsewhere. No user-facing behavior change. Checks: `yarn lint:tsc`, `yarn test:unit --coverage=false` on the touched directories (no snapshot updates). ESLint had no remaining changed JS/TS files to lint. Docs/comments updated: none ## **Changelog** CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **Before** N/A — no UI change ### **After** N/A — no UI change ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Deletes unreachable code only; live features remain wired through direct imports with no functional changes. > > **Overview** > Removes dead multichain UI code with **no import references** in the extension: the **`PermissionsHeader`** component, the **`useNewRPC`** network-form hook, and three unused **`index.ts` barrel re-exports** (`funding-method-modal`, `global-menu`, `settings/backup-and-sync-tab`). > > **`FundingMethodModal`**, **`GlobalMenuList`**, and the backup-and-sync settings tab stay in place; existing callers already import them from their concrete module files rather than these barrels. **No user-facing behavior change**—cleanup only. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 92634ed. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
## **Description** Removes the unused `Hex` type import from the Hyperliquid deposit constants. `CaipAssetType` stays. Reported by `tsc --noUnusedLocals` (TS6196). Owner set: none (no CODEOWNERS match). | path | removed (file / symbol / class) | why dead | | --- | --- | --- | | `app/scripts/lib/hyperliquid-deposit/constants.ts` | `Hex` type import | unused local | Whole-repo whole-word search: other `Hex` hits are unrelated identifiers (the `@metamask/utils` type and local variables). No open PR edits this file. Import blame and the file's last change are both 2026-09-03, outside the 60-day and 30-day windows. No user-facing behavior change. Checks passed: `yarn lint:tsc`, eslint on the touched file, and `yarn test:unit --coverage=false app/scripts/lib/hyperliquid-deposit` with no snapshot updates. Docs/comments updated: none ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **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 Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Dead import removal only; constants and Hyperliquid deposit behavior are unchanged. > > **Overview** > Removes the unused **`Hex`** type from the `@metamask/utils` import in Hyperliquid deposit **`constants.ts`**, leaving **`CaipAssetType`** unchanged. This is a TypeScript **`noUnusedLocals`** cleanup with no runtime or user-facing impact. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f5e3476. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
## **Description** Removes the unused `BoxBackgroundColor` import from the shared tabs component. The other design-system imports in that statement (`Box`, `BoxFlexDirection`, `BoxJustifyContent`, `twMerge`) are still used. Reported by `tsc --noUnusedLocals`. Owner set: none (no CODEOWNERS match). `ui/components/ui/` is a reusable building block, so the 180-day window applies. The import line was last touched on 2025-09-18. The file changed on 2026-10-08 in unrelated lines (the tab layout), not this import. | path | removed (file / symbol / class) | why dead | | --- | --- | --- | | `ui/components/ui/tabs/tabs.tsx` | `BoxBackgroundColor` import | unused local | Whole-repo whole-word search: other `BoxBackgroundColor` hits are components that import and apply the prop themselves. Open PRs mention that design-system export in other files; none edit `ui/components/ui/tabs/tabs.tsx`. No user-facing behavior change. Checks passed: `yarn lint:tsc`, eslint on the touched file, and `yarn test:unit --coverage=false ui/components/ui/tabs` with no snapshot updates. Docs/comments updated: none ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null ## **Related issues** Refs: proactive dead-code cleanup (extension counterpart of metamask-mobile#37948) ## **Manual testing steps** N/A — deletes unreachable code. There is no user-facing behavior to click through. ## **Screenshots/Recordings** N/A — no UI change ### **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 Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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 - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Single-line import removal with no runtime or UI behavior change. > > **Overview** > Removes the unused **`BoxBackgroundColor`** import from the shared **`Tabs`** component in `tabs.tsx`. Remaining design-system imports (`Box`, `BoxFlexDirection`, `BoxJustifyContent`, `twMerge`) are unchanged and still drive layout and styling. > > This is dead-code cleanup flagged by **`tsc --noUnusedLocals`**; tab behavior, animations, and keyboard handling are untouched. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 87f5669. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## **Description**
Audit of every `.scss` file under `ui/pages/onboarding-flow/` (7 files),
removing CSS that nothing references. **No visual change intended.**
Net: 84 lines deleted, 0 added, 7 files touched; no file became empty,
so no `@import` lines changed. No routes, deep-link handlers or
URL-reachable screens were touched.
**Method:** for every compiled class name I searched the whole repo
(`ui/`, `test/` incl. e2e page objects/specs, `shared/`, `app/`,
snapshots), both the full BEM name and its fragments (e.g. `__weak`,
`welcome--banner`, `quiz-word`, `create-password__${`), and reviewed
every `classnames()` / template-string `className` in
`ui/pages/onboarding-flow`. I also compiled
`ui/pages/onboarding-flow/index.scss` with Sass before and after: the
CSS diff consists **only** of deletions of the rules below; every
surviving rule is byte-identical.
### Removed selectors (with evidence)
| Selector (file) | Evidence it's unused |
| --- | --- |
| `.onboarding-flow__x-button__icon` (`index.scss`) | 0 references to
`x-button` anywhere outside this SCSS |
| `.welcome-container__wordmark-container`, `--complete`
(`welcome/index.scss`) | 0 refs; the wordmark uses
`riv-animation__wordmark-container*`
(`metamask-wordmark-animation.tsx`). `.welcome-container` itself is kept
(used) |
| `.welcome-login__mascot--image` (`welcome/index.scss`) | 0 refs to
`welcome-login__mascot` or `mascot--` |
| `@keyframes fadeInUp` (`welcome/index.scss`) | No `animation:
fadeInUp` anywhere in `ui/`/`app/`/`shared/` (only `fadeInUpSmooth`,
which is kept). The sole other hit is an unrelated third-party test-dapp
CSS mock |
| `.onboarding-app-header__dropdown--welcome--banner` (+ nested
`.dropdown__select`, `.dropdown__icon-caret-down`)
(`onboarding-app-header/index.scss`) | 0 refs; component only applies
`__dropdown--welcome--login`. Leftover of the welcome banner removed in
#47561 |
| `.recovery-phrase__chips .mm-text-field.mm-text-field--quiz-word` (+
nested `.mm-input`) (`recovery-phrase/index.scss`) | `TextField` never
emits `--quiz-word` (it only emits `--size-*`, `--focused`, `--error`,
`--disabled`, `--truncate`); `recovery-phrase-chips.tsx` passes no such
class. Only `data-quiz-words` attribute exists |
| `.recovery-phrase__chips .mm-text-field.mm-text-field--target-index`
(dropped from a selector list) (`recovery-phrase/index.scss`) | Never
emitted; target index styling is applied via inline `style` in
`recovery-phrase-chips.tsx` |
| `.privacy-settings__network` (`privacy-settings/index.scss`) | 0 refs
|
| `.onboarding-metametrics__checkbox-label` (`metametrics/index.scss`) |
0 refs (`metametrics.tsx` uses `__checkbox` and `__user-control` only) |
| `.onboarding-metametrics__terms` (+ nested `a`)
(`metametrics/index.scss`) | 0 refs to `onboarding-metametrics__terms` |
| `.create-password__weak`, `__average`, `__strong`
(`create-password/index.scss`) | 0 refs, no `create-password__${…}`
construction anywhere |
No image/font assets were referenced by the removed rules (none of these
files contain `url(...)`), and none of the files define local SCSS
variables/mixins.
### Kept, uncertain
- `.recovery-phrase__chips
.mm-text-field:not(.mm-text-field--quiz-word)`: `--quiz-word` is never
emitted, but the `:not()` makes this rule match **every**
`.mm-text-field` in the chips, so it's live. Simplifying it would change
specificity, so I left it as is.
- `.recovery-phrase__chips .mm-text-field.mm-text-field--focused`:
`--focused` is emitted by `TextField`, but only when `!disabled`, and
the chips' `TextField`s are `disabled`. Kept because it's a real runtime
modifier.
- `.privacy-settings .hidden`: applied via `classnames('detail-view', {
hidden: !showDetail && hiddenClass })`. Generic name, kept.
- Element selectors (`.onboarding-metametrics p/ul`,
`.privacy-settings__header a`, `.privacy-settings__settings a`): can't
be reliably attributed by grep, so I kept them.
- Generic class selectors `.privacy-settings
.container/.list-view/.detail-view/.show-detail/.show-list/.categories-item`:
all referenced in `privacy-settings.tsx`. Kept.
## **Changelog**
CHANGELOG entry: null
## **Related issues**
Follow-up to #47561
## **Manual testing steps**
1. Build and run the extension (`yarn start`), then start a fresh
onboarding.
2. On the welcome screen, verify the wordmark/fox animations, the login
options sheet (social icons, "or" divider, plain buttons) and the
language dropdown look unchanged.
3. Create a new wallet: verify the create-password screen (link text)
looks unchanged.
4. On the Secret Recovery Phrase screen, verify the blurred chips, "tap
to reveal", and the confirm/quiz step chips look unchanged.
5. Verify the MetaMetrics screen (checkbox, user-control image, lists)
and Privacy settings (list/detail slide, customizable network rows) look
unchanged.
## **Screenshots/Recordings**
No visual regressions
| Screen | Before | After |
| --- | --- | --- |
| Welcome | <img width="360" alt="Welcome before"
src="https://github.com/user-attachments/assets/55ed134f-e5b3-441b-ba05-f463aca86e94">
| <img width="360" alt="Welcome after"
src="https://github.com/user-attachments/assets/845be362-fd55-44d5-af1b-bea54bf8e215">
|
| Create password | <img width="360" alt="Create password before"
src="https://github.com/user-attachments/assets/956a36ff-ba86-4bb2-92b1-8933eb21e1d6">
| <img width="360" alt="Create password after"
src="https://github.com/user-attachments/assets/2fce72c5-3ad0-4c28-b693-7c82fca6bd58">
|
| Secret Recovery Phrase | <img width="360" alt="SRP before"
src="https://github.com/user-attachments/assets/c13eff82-6c31-4000-a32a-7d1691532a99">
| <img width="360" alt="SRP after"
src="https://github.com/user-attachments/assets/7944f494-f565-4dfa-a474-4513072c9915">
|
| SRP confirm / quiz | <img width="360" alt="SRP confirm before"
src="https://github.com/user-attachments/assets/95398497-cea0-4b7b-8f74-3932cf09970b">
| <img width="360" alt="SRP confirm after"
src="https://github.com/user-attachments/assets/127f34b5-f7be-43d9-b859-a2ede8f4ab35">
|
| MetaMetrics | <img width="360" alt="MetaMetrics before"
src="https://github.com/user-attachments/assets/ee68c3ba-afd9-43c2-8b81-a6cf487987a5">
| <img width="360" alt="MetaMetrics after"
src="https://github.com/user-attachments/assets/fa19e379-31b9-469e-a218-475d7dff2545">
|
| Privacy settings | <img width="360" alt="Privacy settings before"
src="https://github.com/user-attachments/assets/c9e949a2-a831-4f7d-80e3-dfdec44c9d1f">
| <img width="360" alt="Privacy settings after"
src="https://github.com/user-attachments/assets/584af70d-a68d-4cd9-a130-96e5d2250d99">
|
## **Pre-merge author checklist**
- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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-eddea86a-79b5-5447-9878-3b5b1435ee5f?cursor_ref=pr_footer&cursor_cta=open_in_web"><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-eddea86a-79b5-5447-9878-3b5b1435ee5f&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><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>
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Stylesheet-only deletions with no route or logic changes; risk is
limited to a missed reference causing a subtle styling regression on
onboarding screens.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3ac1120. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
…g non-blocking in custom token import (#47983) - fix(assets): make mainnet-address warning non-blocking in custom token import cp-13.58.0 (#47928) ## **Description** Fixes a defect that prevented importing PulseChain (chain id 369 / `0x171`) ERC-20 tokens through the custom token import form. PulseChain is a fork of Ethereum Mainnet state, so every Mainnet token contract exists at the same address on PulseChain — which makes the extension's mainnet-address check fire for nearly every legitimate token there. ### Problem — Custom token import: blocking "Mainnet token" warning Entering any address that matches a known Ethereum Mainnet token while on a non-Mainnet network showed *"This address matches a known Ethereum Mainnet token address…"* and disabled import entirely. On PulseChain this fires for nearly every legitimate token. **Root cause:** the custom token import page (introduced in ef8fed1 / #42574, replacing the old `ImportTokensModal` deleted in a93e640 / #43712) treated the mainnet-address match as a blocking error: `handleAddressChange` early-returned after `setWarning(t('mainnetToken'))` (also suppressing on-chain autofill), and `isValid` gated submission on `!warning`. The old modal showed the same warning but **excluded it from its error gate** (`hasError()`), so import stayed possible. Stale community PR #31864 had flagged this exact PulseChain scenario but targets the deleted file. **Fix:** the warning is now non-blocking and the on-chain lookup continues, so symbol/decimals autofill from the selected network (on a fork chain the contract at that address is real and answers correctly). The warning banner still renders to caution users who are genuinely on the wrong network. Compared to the old modal (which cleared/hid symbol+decimals under the warning), autofill gives the user real on-chain data to review before submitting. **dApp `wallet_watchAsset` path:** verified working on current builds; the reported `Unauthorized` was not reproducible (see investigation). ## **Changelog** CHANGELOG entry: Fixed a bug that blocked custom token imports on chains that forked Ethereum Mainnet (such as PulseChain) whenever the token address matched a known Ethereum Mainnet token ## **Related issues** Fixes: [ASSETS-4371](https://consensyssoftware.atlassian.net/browse/ASSETS-4371) (Jira) ## **Manual testing steps** **Setup:** run a dev/test build, then add PulseChain as a custom network (RPC `https://rpc.pulsechain.com`, chain id `369`, ticker `PLS`) and select it. Use a wallet funded on PulseChain, or any wallet — a zero balance is fine. **Custom token import path:** 1. On the home screen, open the token list options (⋯) → *Manage tokens* → *Add a custom token*. 2. Enter a known Mainnet token address, e.g. DAI `0x6B175474E89094C44Da98b954EedeAC495271d0F` or USDC `0xA0b86991C6218b36C1D19D4a2e9EB0cE3606eB48`. 3. Verify the yellow "This address matches a known Ethereum Mainnet token address…" warning appears. 4. Verify symbol and decimals still autofill from PulseChain (e.g. USDC → symbol `USDC`, decimals `6`) and that the import button is **enabled**. 5. Submit and verify the token appears in the token list on PulseChain. 6. Repeat on Ethereum Mainnet with the same address and verify no warning shows. ### Automated E2E coverage New and extended Selenium E2E coverage (local Anvil chain `0x539`, MV3 test build, [1391a9c](1391a9cf5dd)). Both specs were run on **two builds**: `origin/main` (fix reverted, tests kept) and this branch — same spec files, same commands. | Test | `origin/main` | This branch | | --- | --- | --- | | `import-custom-token-mainnet-address.spec.ts` — mainnet warning shown, import button enabled, token listed | ❌ **Fails**: warning renders, then `TimeoutError: Waiting for element to be located By(css selector, [data-testid="custom-token-import-submit-button"]:not([disabled])) — Wait timed out after 10033ms` (import stays blocked — this is the bug) | ✅ **Passes 3/3**: warning renders, import enabled, token imported and listed as `100 DAI` | | `watch-asset-call-add-token.spec.ts` (new mainnet-listed-address case) — dapp `wallet_watchAsset` approved, token added | ✅ **Passes 2/2** (all 4 cases in the spec green) | ✅ **Passes 3/3** (all 4 cases green) | Exact commands (identical on both builds; `yarn build:test` rebuilt per tree): ```sh yarn test:e2e:single test/e2e/tests/tokens/import-custom-token-mainnet-address.spec.ts --browser=chrome yarn test:e2e:single test/e2e/tests/tokens/watch-asset-call-add-token.spec.ts --browser=chrome ``` On the `origin/main` run, the branch's spec files were overlaid unmodified before building (`git checkout origin/main` then `git checkout fm/assets-4371-pulsechain-tokens -- <spec/helper/page-object files>`), so main was tested against the exact same tests with only the product fix absent. - **`test/e2e/tests/tokens/import-custom-token-mainnet-address.spec.ts`** (new): deploys the test ERC-20 with DAI metadata and moves its code + storage — including the mapping-derived balance entry — to the Mainnet DAI address with `anvil_setCode`/`anvil_setStorageAt`, so a *real* contract lives at a `STATIC_MAINNET_TOKEN_LIST` address on a non-Mainnet network. That is the exact PulseChain situation (a fork chain reusing Mainnet addresses). Asserts: (a) the mainnet warning is displayed, (b) the import button is **enabled**, (c) the token (`100 DAI`) is listed after import. - Fails on `origin/main`: after the warning renders, the spec times out waiting for `[data-testid="custom-token-import-submit-button"]:not([disabled])` — import stays blocked. - Passes on this branch: 3/3 local runs. - **`test/e2e/tests/tokens/watch-asset-call-add-token.spec.ts`** (new case): the same Mainnet-listed address offered through `wallet_watchAsset` from the test dapp on the non-Mainnet local chain; after approval the token is added (`100 DAI`). This case **also passes on `origin/main`** (2/2 runs) — kept as regression coverage, and it confirms the mainnet-address check is **not** what breaks the dApp watchAsset path; the reported dApp failure was not reproducible on current builds. - Page-object additions in `custom-token-import-page.ts` (`enterTokenAddress`, `submitTokenImport`, `checkMainnetAddressWarningIsDisplayed`, `checkImportButtonIsEnabled`); the chain setup lives in `test/e2e/tests/tokens/mainnet-listed-token.helpers.ts`. Each spec was run 3× locally with no flakes. ## **Screenshots/Recordings** Before (origin/main) vs. after (this branch) — live runs on real PulseChain RPC (chain 369) with the DAI Mainnet address (`0x6B17...1d0F`), a real contract on PulseChain: | Before (main): Save disabled | 1. Address entered | 2. Warning + autofill, Save enabled | 3. Added toast | 4. Home token list | | --- | --- | --- | --- | --- | | <img src="https://github.com/user-attachments/assets/8961ba7c-15dc-4af0-8a36-7df0343a67fd" width="220" alt="origin/main: custom token import on PulseChain with DAI address, warning shown, Save disabled"> | <img src="https://github.com/user-attachments/assets/693e9eae-d9e3-48eb-a412-16716b18f66c" width="220" alt="Custom token import form on PulseChain with the DAI address typed"> | <img src="https://github.com/user-attachments/assets/2142cb69-d4dc-4e6c-8d7c-68e92e341fcd" width="220" alt="Mainnet warning shown plus DAI symbol and 18 decimals autofilled, Save enabled"> | <img src="https://github.com/user-attachments/assets/bbb80a15-b11b-4776-a8e4-bcc4c63f25cc" width="220" alt="Success toast: USDC was successfully added, DAI and USDC listed on PulseChain"> | <img src="https://github.com/user-attachments/assets/3fb5bf75-af15-41f9-a522-a3a7254a8a77" width="220" alt="Home tokens tab on PulseChain listing PLS, DAI, and USDC"> | Evidence from the full E2E run on a local MV3 test build (`mm` CLI): - **Import form**: with the USDC Mainnet address pasted on PulseChain, the Mainnet-address warning is shown **and** symbol/decimals autofill from the chain (`USDC` / `6`), with the submit button enabled. ### **Video walkthrough** https://github.com/user-attachments/assets/a2385674-9d46-4ce8-8ec1-b0f2fadfabae > 🤖 AI-generated walkthrough — script, animation, and voice made by an agent ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and MetaMask Extension Coding Standards - [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 format if applicable - [x] I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors. ## **Adversarial review (adverse)** The change was reviewed with a three-round multi-perspective adversarial review loop (auditor / adversary / pragmatist, cross-examination, deterministic synthesis). Round 1: **SHIP-WITH-CAVEATS** (0 critical · 6 warning · 6 info, 3/3 ship). Round 2: **SHIP-WITH-CAVEATS** (0 critical · 6 warning · 7 info). Round 3: **SHIP-WITH-CAVEATS** (0 critical · 6 warning · 7 info; 2 conditional + 1 approve). No critical or blocking findings in any round; rounds 2 and 3 converged on the same trade-off discussion. **Scope note:** rounds 1–3 reviewed a superset of this diff that also decoupled the dApp `wallet_watchAsset` persist; that change was **removed at review** ([2645a3a](2645a3a9c71)) as unproven against the user-reported failure. Findings and dispositions are kept for the record: **Addressed in code:** - *Dropping `!warning` unblocks every future warning, not just the mainnet one* (consensus, round 1) → applied in rounds 1–3 as a rename to a dedicated `mainnetWarning` state; **reverted during human review** ([534cdbb](534cdbb50eb)) to keep the diff minimal — the original `warning` state/prop names are kept and blocking conditions continue to use the error states that still gate submission. - *Rejection path's only observable behavior (Sentry) untested* (consensus, round 1) → `captureException` was mocked and asserted in the controller test — *change removed at review* ([2645a3a](2645a3a9c71)). - *Test data mislabeled DAI as symbol 'APE'* (round 1) → the test now stubs DAI-accurate on-chain metadata, and additionally asserts the warning clears when the address changes to a non-mainnet token and reappears for the mainnet one. - *Failure report lacks context / hard to group* (rounds 2–3) → `{ extra: { assetId, chainId } }` was added so triage could correlate failures without attaching account or origin identifiers; **reverted during human review** ([534cdbb](534cdbb50eb)) to shrink the diff, and the whole change was then **removed at review** ([2645a3a](2645a3a9c71)). **Answered with source evidence (no change needed):** - *"Asset may be absent from state right after the promise resolves"* (rounds 2–3, on the removed change) → `AssetsController.addCustomAsset` persists `customAssets`/`assetsInfo`/zero-balance **synchronously, before its first `await`** (the account refresh). The persist therefore completes during the call itself, before `handleWatchAssetRequest` resolves; the token is in state and renderable at that point. The only resolve-without-persist path is a synchronous throw before the state update — pre-validated inputs (`toAssetId` construction, decimals bounds) make that a narrow unexpected-error window, and it is reported to Sentry. - *"Failures leave no local trace / Sentry is consent-gated"* (rounds 2–3, on the removed change) → `shared/lib/sentry` `captureException` unconditionally `console.error`s the exception locally (the Sentry *upload* is the consent-gated part), so a service-worker console breadcrumb always exists. - *"Stale async address lookup can set the mainnet warning for a different address"* (round 2) → the handler bumps an `addressLookupRef` and checks `isLatestLookup()` **after the awaited chain probe and before every validation branch**, including the mainnet-warning one; stale lookups return early. - *"Autofill on fork chains lets attackers spoof trusted mainnet identities"* (rounds 1–3, repeatedly challenged by co-reviewers) → autofill metadata comes from the **selected network's contract**, not the mainnet list; on any custom network a user could already import an arbitrary contract with a typed symbol, and fiat-value lookups in the wallet are keyed by chain-scoped asset ids, not bare addresses. The warning banner still displays. **Accepted as documented trade-offs / follow-ups:** - *(removed change)* The fire-and-forget decoupling changed `wallet_watchAsset`'s resolution semantics from "pipeline finished" to "approved and persisted; enrichment continues in the background". A bounded-timeout alternative was considered and rejected: it would add arbitrary latency to healthy chains and still swallow the failure after the timeout. EIP-747's boolean result indicates the request was handled — a dApp cannot rely on balance data being present in any case, since enrichment timing was always chain-dependent. - The underlying fragility (no per-request timeout in the custom-network RPC client; `addCustomAsset` coupling persist with a full account refresh; no data-source support for chains like 369) was the working hypothesis behind the removed change; the dApp path was verified working on current builds and the reported failure was not reproducible. - The advisory banner's copy (`mainnetToken` message) still reads as cautionary advice and may deserve a copy pass for the now-advisory context. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > UI validation tweak on custom token import with unit and E2E coverage; no auth, payments, or persistence logic changes beyond allowing submit when only the advisory warning is set. > > **Overview** > On **custom token import**, an address that matches a known Ethereum Mainnet token on a **non-Mainnet** network (e.g. PulseChain) no longer blocks submission. The yellow mainnet warning still shows, but validation continues so symbol/decimals autofill from the selected chain runs and the import button can stay enabled when other checks pass. > > **Product change** in `custom-token-import.tsx`: after setting the mainnet warning, `handleAddressChange` no longer early-returns, and `isValid` no longer requires `!warning`. > > **Tests**: unit cases for warning on/off-network and enabled submit; E2E that deploys an ERC-20 at the Mainnet DAI address on a local chain (fork-style setup), asserts warning + enabled import + listed balance; page-object helpers; an extra `wallet_watchAsset` E2E case for the same address pattern. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 382a2a3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> [ASSETS-4371]: https://consensyssoftware.atlassian.net/browse/ASSETS-4371?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ [9f80e4c](9f80e4c) [ASSETS-4371]: https://consensyssoftware.atlassian.net/browse/ASSETS-4371?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ Co-authored-by: Prithpal Sooriya <prithpal.sooriya@gmail.com>
…t pay-token balances as strings (#47981) - fix(confirmations): compare Money Account pay-token balances as strings (#47932) ## **Description** `useAutomaticMoneyAccountPayToken` decides whether to default Pay with to the Money Account by comparing its balance (a `bignumber.js` value) with the highest token fiat balance and the minimum required balance. Those two values are plain JS numbers, and `bignumber.js` 4 throws `gt() number type has more than 15 significant digits` when it is given a number with more than 15 significant digits. Fiat balances are computed in floating point and often have more, so opening a Pay confirmation (for example a Perps deposit) with such a token balance crashed the confirmation. This passes both values to `BigNumber` as strings, which `bignumber.js` accepts at any precision, and adds a test with a 16-digit fiat balance (it fails without the fix). ## **Changelog** CHANGELOG entry: Fixed a crash when opening a MetaMask Pay confirmation with a token balance that has many decimal places ## **Related issues** Follow-up to #47836. ## **Manual testing steps** 1. Use an account with a Money Account balance and a token whose fiat balance has more than 15 significant digits (most non-round balances). 2. Open Perps → Add funds. 3. Before: the confirmation crashes with "gt() number type has more than 15 significant digits". After: it opens, and Pay with defaults as before. ## **Screenshots/Recordings** ### **Before** The confirmation shows "MetaMask encountered an error" with `BigNumber Error: gt() number type has more than 15 significant digits`. ### **After** The Perps deposit confirmation opens and quotes. ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/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-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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_SUMMARY --> --- > [!NOTE] > **Low Risk** > Small, localized fix in pay-token auto-selection logic with a regression test; no auth, payment execution, or broad API changes. > > **Overview** > Fixes a **MetaMask Pay confirmation crash** when token fiat balances exceed JavaScript’s ~15 significant-digit limit passed into `bignumber.js` `gt()` / `gte()`. > > In **`useAutomaticMoneyAccountPayToken`**, the highest token fiat balance and minimum required balance are now coerced with **`String(...)`** before **`BigNumber`** comparison (Money Account withdrawable balance was already a BigNumber). Selection behavior is unchanged; only the comparison path is safe for high-precision fiat values. > > Adds a hook test with a **16-digit** token fiat balance to ensure **`shouldSelect`** still works without throwing. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 65878f0. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> [deb08d6](deb08d6) Co-authored-by: Pedro Figueiredo <pedro.figueiredo@consensys.net>
Builds ready [990941d]
⚡ Performance Benchmarks (Total: 🟢 6 pass · 🟡 4 warn · 🔴 3 fail)
Bundle Size Diffs
Cherry-picks (3 commits)
Changelog (147 commits since v13.57.0)
AI Test Plan
Cherry-Pick Scenarios (2)High Risk Scenarios (1)1. Transaction Confirmations — Money Account pay-token balance checksRisk Level: HIGH Why This Matters: Cherry-pick 47981 fixes precision issues by comparing Money Account pay-token balances as strings; a mistake here can incorrectly block valid transactions or allow overspending. Test Steps:
Medium Risk Scenarios (1)1. Token Management — Custom token import mainnet-address warning behaviorRisk Level: MEDIUM Why This Matters: Cherry-pick 47983 fixes the custom token import flow to warn but not block when a Mainnet address is used on other networks; regressions could either block legitimate imports or allow silent, unsafe imports without proper warning. Test Steps:
Release Scenarios (9)High Risk Scenarios (4)1. State Migrations — Basic functionality consolidation (Migration 235)Risk Level: HIGH Why This Matters: A faulty migration can silently alter user privacy defaults or break token/NFT detection, causing loss of trust or missing assets. Test Steps:
2. State Migrations — Preserve previous ON state (Migration 235)Risk Level: HIGH Why This Matters: Incorrect defaulting after migration could unexpectedly disable features users rely on, or expose privacy risks if flipped the wrong way. Test Steps:
3. Security & Privacy — Social-login wallet restriction on Basic functionalityRisk Level: HIGH Why This Matters: If social-login wallets can disable Basic functionality, users may enter unsupported states leading to broken UX or loss of key features. Test Steps:
4. Token Management — Asset list control bar refactor: Manage tokens (hide/unhide)Risk Level: HIGH Why This Matters: A major UI refactor can regress token visibility management, confusing users or hiding important assets unintentionally. Test Steps:
Medium Risk Scenarios (5)1. Token Management — Asset list control bar refactor: Search/filterRisk Level: MEDIUM Why This Matters: Search/filter regressions can make it hard to find assets, especially across networks and for zero-balance tokens. Test Steps:
2. Token/DeFi Actions — Asset list control bar: DeFi options menuRisk Level: MEDIUM Why This Matters: Misrouted DeFi actions can cause failed transactions, wrong network usage, or user funds at risk. Test Steps:
3. Network Management — Test network visibility and switching (init refactors)Risk Level: MEDIUM Why This Matters: Refactors around network initialization can break chain availability or cause asset lists to desync across networks. Test Steps:
4. Analytics/Telemetry — MetaMetrics consent and persistenceRisk Level: MEDIUM Why This Matters: Changes to analytics controllers can lead to incorrect consent states or runtime errors that impact core flows. Test Steps:
5. On/Off Ramp — Buy flow entry points (ramps integration changes)Risk Level: MEDIUM Why This Matters: Ramps integration regressions can strand users in broken purchase flows or present wrong chain/asset combinations. Test Steps:
Teams Sign-off StatusSigned off: None yet Awaiting sign-off (7): Generated by AI Test Plan Analyzer (gpt-5) at 2026-11-16T16:17:19.431Z AI generated test plan (JSON): test-plan-13.58.0.json |
🚀 v13.58.0 Testing & Release Quality Process
Hi Team,
As part of our new MetaMask Release Quality Process, here’s a quick overview of the key processes, testing strategies, and milestones to ensure a smooth and high-quality deployment.
📋 Key Processes
Testing Strategy
Conduct regression and exploratory testing for your functional areas, including automated and manual tests for critical workflows.
Focus on exploratory testing across the wallet, prioritize high-impact areas, and triage any Sentry errors found during testing.
Validate new functionalities and provide feedback to support release monitoring.
GitHub Signoff
Issue Resolution
Cherry-Picking Criteria
🗓️ Timeline and Milestones
✅ Signoff Checklist
Each team is responsible for signing off via GitHub. Use the checkbox below to track signoff completion:
Team sign-off checklist
This process is a major step forward in ensuring release stability and quality. Let’s stay aligned and make this release a success! 🚀
Feel free to reach out if you have questions or need clarification.
Many thanks in advance
Reference