[pull] main from MetaMask:main#349
Merged
Merged
Conversation
…rpsPositionData cp-7.59.0 (#22305) - fix(perps): prevent infinite loop in usePerpsPositionData cp-7.59.0 (#22257) ## **Description** This PR fixes a bug in the Perps candle subscription system where the refresh interval was being continuously cleared and re-established, causing excessive logging and inefficient resource usage. **What is the reason for the change?** - `candleData` was in the dependency array of the candle refresh interval effect in `usePerpsPositionData.ts` - This created a self-triggering loop: the effect updates `candleData` → triggers re-run → clears interval → creates new interval → repeats - The result was continuous logging of "Cleared candle refresh interval" and "Setting up candle refresh every..." messages - This caused unnecessary interval teardown/recreation on every candle data update (potentially multiple times per second) **What is the improvement/solution?** - Removed `candleData` from the dependency array of the interval effect (line 230 in `usePerpsPositionData.ts`) - Removed duplicate `initializationState` dependency (already covered by `isControllerInitialized`) - Added explanatory comment and ESLint disable directive to document why `candleData` is intentionally excluded - The interval now only resets when configuration actually changes (interval period, duration, etc.), not on every data update ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: Infinite loop in candle subscription causing excessive logging ## **Manual testing steps** ```gherkin Feature: Candle Subscription Refresh Behavior Scenario: user observes stable candle refresh intervals Given user is on Perps position details screen And developer console is visible When user selects a time interval (e.g., "1h") Then user should see "Setting up candle refresh every 3600 seconds for 1h" ONCE And user should NOT see continuous "Cleared candle refresh interval" messages When user waits for 5 seconds Then user should NOT see any new interval setup messages When user changes the time interval to "3m" Then user should see "Cleared candle refresh interval" ONCE And user should see "Setting up candle refresh every 180 seconds for 3m" ONCE Scenario: user verifies candles still update correctly Given user is on Perps position details screen And user has selected any time interval When user observes the price chart Then the live candle should update in real-time as prices change And historical candles should remain stable When the interval period completes (e.g., after 3 minutes for 3m interval) Then a new candle should appear And the chart should refresh with updated historical data ``` ## **Screenshots/Recordings** N/A - Internal logging fix ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable (all existing tests pass) - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. --- ## **Additional Context** ### Root Cause Analysis The bug was in the `useEffect` at lines 161-234 of `usePerpsPositionData.ts`: **Problem Chain:** 1. Effect depends on `candleData` (line 228 in original code) 2. Effect's interval callback calls `setCandleData()` (lines 207-216) 3. Separate effect merges live candles into `candleData` (lines 300-336) 4. Every `candleData` update triggers the interval effect to re-run 5. Re-run clears old interval and creates new one 6. New data from interval or live candle merge triggers step 4 again ### Technical Details **Changed File:** - `app/components/UI/Perps/hooks/usePerpsPositionData.ts` **Changes Made:** 1. Removed `candleData` from dependency array (line 230) 2. Removed duplicate `initializationState` from dependency array (line 232) 3. Added explanatory comment (lines 227-228) 4. Added `eslint-disable-next-line react-hooks/exhaustive-deps` (line 229) **Test Results:** - ✅ All 38 tests in `usePerpsPositionData.test.ts` pass - ✅ No functional changes to candle fetching or display - ✅ Interval still refreshes at correct intervals - ✅ Live candles still merge correctly ### Why ESLint Disable is Necessary The ESLint rule `react-hooks/exhaustive-deps` flags `candleData` as missing from dependencies. However: - Including `candleData` would recreate the bug - The effect doesn't depend on previous `candleData` values - It only needs to re-run when interval configuration changes - This is a legitimate case for disabling the rule with proper documentation ### Impact **Components Affected:** - `PerpsMarketDetailsView.tsx` (main consumer) - `usePerpsMarketStats.ts` (secondary consumer) **Performance Improvement:** - Before: Interval cleared/created multiple times per second - After: Interval cleared/created only on configuration changes - Reduction: ~99% fewer interval operations **User Impact:** - No visible changes to end users - Chart behavior remains identical - Reduced console noise for developers - Improved performance and memory usage <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Prevents infinite interval re-creation by removing `candleData` (and duplicate `initializationState`) from the refresh effect deps and documenting with comments/ESLint disable. > > - **Perps Hook (`usePerpsPositionData.ts`)**: > - **Interval Effect Stability**: > - Remove `candleData` from dependency array to avoid infinite interval reset loop. > - Remove redundant `initializationState` dependency (covered by `isControllerInitialized`). > - Add explanatory comments and `eslint-disable-next-line react-hooks/exhaustive-deps` for intentional dep exclusion. > - Effect now depends on `isLoadingHistory`, `selectedInterval`, `fetchHistoricalCandles`, and `isControllerInitialized` only. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 53119ff. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [f817b25](f817b25) Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com>
…dation in send flow (#22262) - fix: cp-7.59.0 Fix minimum BTC amount validation in send flow (#22245) <!-- 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** <!-- 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? --> This PR aims to fix BTC amount validation in send flow. As we will implement `onAmountInput` validations - this is a temporary fix to handle it in the client code. In near future this validation will be handled in snap repository. ## **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: #22204 ## **Manual testing steps** 1. Go send flow 2. Pick BTC 3. Try sending lower than 0.0001 4. You shouldn't be able to proceed to recipient page ## **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** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Enforces a 0.0001 BTC minimum in `useAmountValidation` with Bitcoin-aware logic and updates tests accordingly. > > - **Hooks**: > - `useAmountValidation` > - Add Bitcoin-specific minimum amount check (`0.0001 BTC`) using `BigNumber` and `useSendType`. > - Return `send.invalid_value` when below threshold; update memo deps. > - **Tests**: > - `useAmountValidation.test.ts` > - Mock `useSendType` and add cases for below/at/above Bitcoin minimum. > - Keep existing validations for numeric input and balance checks. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit ce11a3e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [f3cfb8c](f3cfb8c) Co-authored-by: OGPoyraz <omergoktugpoyraz@gmail.com>
…7.59.0 (#22315) - fix: re order migrations 105, 106, 107 cp-7.59.0 (#22276) <!-- 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** Re-order migrations 105, 106, 107 Removal of migration 104 redux-persist slicing. No longer needed <!-- 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: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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] > Revamps migrations: 104 now resets PhishingController cache, 105 removes RatesController, 106 clears PPOM MMKV (moved from 107), drops 107, and updates migration inflate/deflate thresholds to >106/≥106 with aligned tests. > > - **Migrations**: > - **104**: Resets `PhishingController.urlScanCache`; validates state and reports errors via Sentry. > - **105**: Removes `RatesController` from `engine.backgroundState`; preserves other controllers. > - **106**: Cleans PPOM MMKV storage (`PPOMDB`) by clearing keys when present; returns state unchanged otherwise. > - Removes migration `107` and its tests (PPOM cleanup logic moved to `106`). > - **Migration Orchestration** (`app/store/migrations/index.ts`): > - Adjusts inflate/deflate gating to `> 106` and `>= 106` respectively. > - Updates tests to reflect new thresholds, error handling, and concise descriptions. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 804ea05. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Aslau Mario-Daniel <marioaslau@gmail.com> [2a5d2de](2a5d2de) Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com> Co-authored-by: Aslau Mario-Daniel <marioaslau@gmail.com>
…et details page (#22303) - fix: cp-7.59.0 ensure that txs show on asset details page (#22285) <!-- 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** <!-- 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? --> Fixes an issue in which txs sometimes do not show on the details page for non-evm assets. ## **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: Fixed an issue in which txs sometimes do not show on the details page for non-evm assets. ## **Related issues** Fixes: #22251 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/d9a517d4-130b-42bc-9d5a-d216dff1d491 ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/d726164c-f231-402f-af58-f7ad67e810f6 ## **Pre-merge author checklist** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Switches Asset view to a new non-EVM transactions selector scoped to the selected account group, filters by chainId, and deprecates the old selector to ensure transactions appear on non-EVM asset pages. > > - **Asset View (`app/components/Views/Asset/index.js`)**: > - Replace `selectNonEvmTransactions` with `selectNonEvmTransactionsForSelectedAccountGroup`. > - Filter non-EVM transactions by `asset.chainId`; add lightweight caching via `cacheKey` and sort by `time`. > - **Selectors (`app/selectors/multichain/multichain.ts`)**: > - Deprecate `selectNonEvmTransactions` (annotated as deprecated/broken). > - Add `selectNonEvmTransactionsForSelectedAccountGroup` to aggregate and sort non-EVM transactions across accounts in the selected group. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0feb138. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [a80db11](a80db11) Co-authored-by: Bernardo Garces Chapero <bernardo.chapero@consensys.net>
…onEVM send flow (#22239) - fix: cp-7.59.0 Return empty contacts for nonEVM send flow (#22235) <!-- 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** <!-- 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? --> This PR early return empty contacts for nonEVM send flow contact recipients. BTC feature is getting released in this release hence there is no need for changelog. ## **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: #22205 ## **Manual testing steps** Contacts shouldn't appear for nonEVM send flow as it's EVM only. ## **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** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Return an empty contact list during non-EVM send flows and add tests to cover the behavior. > > - **Hooks**: > - Update `useContacts` to consume `isNonEvmSendType` from `useSendType` and early-return `[]` when true. > - Preserve EVM-only filtering logic for contacts in `useContacts`. > - **Tests**: > - Add test in `app/components/Views/confirmations/hooks/send/useContacts.test.ts` asserting empty results when `isNonEvmSendType` is true. > - Maintain existing tests for EVM filtering, deduplication, and edge cases. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit bf51938. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [c0d43ee](c0d43ee) Co-authored-by: OGPoyraz <omergoktugpoyraz@gmail.com>
… issues (#22268) - refactor(card): sonarcloud maintainability issues (#22221) <!-- 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** <!-- 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? --> This PR addresses several maintainability issues reported by SonarCloud: 🔗 [View related issues on SonarCloud](https://sonarcloud.io/project/issues?id=metamask-mobile&pullRequest=22058&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true) Additionally, it reverts a temporary workaround previously added for Android to prevent a crash occurring when users navigated through the KYC WebView. The root cause of the WebView crash has been resolved in a separate PR, making the temporary fix unnecessary. ## **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: Reverted temporary workaround for KYC WebView crash (issue resolved in upstream fix). ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Unifies KYC to in-app WebView, refactors asset selection and balance/allowance calculations, tightens onboarding routing, enhances SDK logging, and adds extensive tests. > > - **KYC/Onboarding**: > - Route: `OnboardingNavigator` now requires `user.countryOfNationality` before address; adds tests for new routing paths. > - Verify: `VerifyIdentity` always navigates to `CARD.ONBOARDING.WEBVIEW`; removes platform-specific browser logic; updates tests. > - **Asset Selection** (`AssetSelectionBottomSheet.tsx`): > - Extracts helpers for Linea chain filtering, network processing, token mapping/deduping, address resolution, and sorting. > - Filters by user location and optionally hides Solana; treats `Limited` as delegated for priority updates. > - Refactors list rendering via `renderBottomSheetContent`; preserves `allowanceState` when updating priority. > - **Balances/Allowances** (`useAssetBalances.tsx`): > - Adds helpers for balance source selection, Solana/EVM fiat calc, proportional fiat fallback, and asset building. > - Normalizes parsing/formatting and returns richer balance info; large test suite added covering edge cases. > - **Card Home** (`CardHome.tsx`): > - `enableCardAction` logs errors and shows toast; fetches token and opens selection when provisioned. > - Tests added for enable flow button states and interactions. > - **External Wallet/Priority Token**: > - `useGetCardExternalWalletDetails`: factors allowance-state calc; maps totals safely. > - `useGetPriorityCardToken`: minor robustness (nullish coalescing, warning flow); more tests. > - **SDK** (`CardSDK.ts`): > - Improves error logging/handling across wallet details and provisioning; minor code cleanup. > - **Types**: > - `UserResponse` adds `countryOfNationality`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1e1b50b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [a2bee21](a2bee21) Co-authored-by: Bruno Nascimento <brunonascimentodev@gmail.com>
…ork change cp-7.59.0 (#22332) - fix: btc account selection during btc network change cp-7.59.0 (#22328) <!-- 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** This PR fixes the issue when the user selects a BTC network, it would switch the user to the first multichain account. <!-- 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: Changing networks to btc does not switch the selected account. ## **Related issues** Fixes: #22236 (comment) ## **Manual testing steps** ```gherkin Feature: network switching Scenario: user wants to change the network filter Given the user is using a multichain account When user selected the btc network Then the account does not change. ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/ee43b688-8f64-4d16-bde9-b7efecef6cfe <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Eliminates Bitcoin-specific address switching in `selectPopularNetwork`, keeping BTC account handling only in `selectCustomNetwork` and updating tests accordingly. > > - **Hooks**: > - `app/components/hooks/useNetworkSelection/useNetworkSelection.ts` > - `selectPopularNetwork` no longer sets BTC selected address; now only enables the network and switches active network. > - Simplifies dependencies by removing Bitcoin-specific deps. > - **Tests**: > - `app/components/hooks/useNetworkSelection/useNetworkSelection.test.ts` > - Removes test asserting BTC address selection on `selectPopularNetwork`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e3dc193. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [87bfd92](87bfd92) Co-authored-by: Monte Lai <monte.lai@consensys.net>
…position calculation with funding fees and live data (#22333) - fix: cp-7.59.0 hotfix-7.58.2 update close position calculation with funding fees and live data (#22229) <!-- 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** Fixes bug where close position view showed incorrect receive amounts, sometimes displaying negative values when position value had dropped. Root causes: 1. Used stale position data from route params instead of live WebSocket updates 2. HyperLiquid's marginUsed already includes PnL, but code was double-counting 3. Recalculated PnL from prices, which missed accumulated funding fees 4. Timing mismatch between price updates and position updates Changes: - Add usePerpsLivePositions to subscribe to real-time position data - Use livePosition.marginUsed which already includes accumulated PnL and funding fees - Use livePosition.positionValue for fee calculations to keep margin and fees synchronized - Remove effectivePnL recalculation that missed funding fees - Round margin and fees separately before subtraction for transparent calculation - Update tests to reflect that marginUsed includes PnL from HyperLiquid Result: - Position card and close position view now show matching margin values - Funding fees correctly included in all calculations - No more incorrect negative receive amounts - Calculation transparency: displayed margin - displayed fees = displayed receive amount <!-- 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: https://consensyssoftware.atlassian.net/browse/TAT-1956 ## **Manual testing steps** ```gherkin Feature: Close Position Calculation with Funding Fees Scenario: Close position with accumulated funding fees shows correct receive amount Given I have an open position with the following details: | Coin | ETH | | Margin Used | $100 | | Unrealized PnL| -$5 | | Entry Price | $2000 | | Current Price | $2000 | When I navigate to the close position view And I view the close position summary Then the margin displayed should be "$100" And the receive amount should match "margin - fees" And the receive amount should be positive And the receive amount should not be negative or zero Scenario: Receive amount calculation matches visual breakdown Given I have an open position When I view the close position summary Then the displayed margin should be rounded to 2 decimals And the displayed fees should be rounded to 2 decimals And the receive amount should equal "rounded margin minus rounded fees" And the calculation should be transparent to the user ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/29289663-7b77-45f7-8ff6-c48917e1e21a <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Close Position view now uses live position data and computes receive amount as rounded marginUsed minus fees, syncing PnL/margin (incl. funding) and updating limit/fee logic and tests. > > - **Perps Close Position (UI/logic)**: > - Subscribe to `usePerpsLivePositions` and derive `livePosition` for real-time `marginUsed` and `unrealizedPnl` (includes funding fees). > - Rework calculations: > - `receiveAmount` = rounded `(closePercentage * marginUsed)` − rounded fees. > - `effectivePnL`: use live `pnl` for market orders; recompute only for limit price. > - `positionValue`/`closingValue` use current or limit price with correct deps. > - Back-calc `unrealizedPnlPercent` from `marginUsed - pnl`. > - Pass `livePosition` into `handleClosePosition`; include updated `receivedAmount`, `realizedPnl`, and price string. > - Keep USD input in sync without jumps; auto-open limit price sheet on limit; minor deps/rounding adjustments. > - **Tests**: > - Mock `usePerpsLivePositions`; update assertions to reflect `marginUsed` includes PnL and new receive formula. > - Add price update synchronization test and adjust PnL/receive expectations for market/limit scenarios. > - Update event/confirm handler expectations and various calculation paths (fees, partial closes, short/long, limit price variations). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e008a6a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com> [9186674](9186674) Co-authored-by: Nicholas Smith <nick.smith@consensys.net> Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com>
- chore: Suppress CI error (#22280) The purpose of this task is to fix the `yarn audi:ci` issues that popped up for `react-native-community/cli` packages due to a recent vulnerability related to bash commands being executed from within that package <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Suppress npm audit advisory 1109627 for @react-native-community/cli in `.yarnrc.yml` to unblock CI. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fc3962d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Luis Taniça <matallui@gmail.com> [dbfff5f](dbfff5f) Co-authored-by: Kylan Hurt <6249205+smilingkylan@users.noreply.github.com> Co-authored-by: Luis Taniça <matallui@gmail.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** This PR enables auto RC builds on pushes to the 7.59.0 release build. This release will be used to test the build number fixes to address duplicate build types due to automation race conditions. #21687 <!-- 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: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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 Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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] > Enables automatic RC builds on pushes to `release/7.59.0` and changes the build-version workflow commit message to skip Bitrise. > > - **CI/CD**: > - **Bitrise**: Add trigger for `push_branch: release/7.59.0` to run `pr_rc_rwy_pipeline` in `bitrise.yml`. > - **GitHub Actions**: Update commit message in `/.github/workflows/update-latest-build-version.yml` from `[skip ci]` to `[skip bitrise]` during version bump. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 48a3f4b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
…store for Android E2E & revert Expo Updates cp-7.59.0 (#22398) - fix: disable fingerprint, repack, cache restore for Android E2E & revert Expo Updates cp-7.59.0 (#22349) <!-- 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** - Disables fingerprinting and caching - Cache builds are hiding numerous errors in the system. This needs to be audited and reconfigured with both the @metamask-mobile-platform and DevOps team - Minor update to make sure test apks are generated for release builds - Caused due to a pipeline update failure masked by cache builds - Revert of Expo Updates #17431 - Causing Android build failure (Platform team will investigate) <!-- 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: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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 Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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] > Disables Android E2E fingerprinting/caching/repack in CI, adds default Android test APK paths, tunes Gradle settings, improves E2E build with retries/output validation, and bumps version. > > - **CI (GitHub Actions)**: > - Disable `fingerprint:generate`, cached APK restore, repack, and artifact caching in `/.github/workflows/build-android-e2e.yml`. > - Remove cache-hit conditionals so Gradle cache and build always run. > - **Android E2E Build**: > - `scripts/build.sh`: add `buildAndroidReleaseE2E <flavor>` using `android/gradle.properties.github`, retries with reduced parallelism on failure, and verifies `app`/`androidTest` APK outputs; route E2E builds for `main`/`flask` and legacy `releaseE2E` through this path. > - **Detox config**: > - Provide fallback `testBinaryPath` for `android.debug`, `android.release`, `android.flask.debug`, and `android.flask.release` in `/.detoxrc.js`. > - **Gradle settings (GitHub runners)**: > - `android/gradle.properties.github`: lower JVM heap to 16g, reduce workers to 6, disable VFS watch; update comments. > - **Version**: > - `package.json`: bump to `7.60.0`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2a5fc03. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: tommasini <tommasini15@gmail.com> [fbc08a6](fbc08a6) Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com> Co-authored-by: tommasini <tommasini15@gmail.com> Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
This reverts commit 0380d52. <!-- 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** <!-- 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: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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 Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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] > Disables Bitrise auto RC generation triggers and switches the bump workflow commit message to use [skip ci]. > > - **CI / Pipelines**: > - **Bitrise**: Disable auto RC generation by commenting out `trigger_map` entry for `release/*` -> `pr_rc_rwy_pipeline` in `bitrise.yml`. > - **GitHub Actions**: Update bump script commit message in `.github/workflows/update-latest-build-version.yml` from `[skip bitrise]` to `[skip ci]`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1c4cfe5. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…avigate to wallet home cp-7.59.0 (#22336) - fix: back arrow perps home should always navigate to wallet home cp-7.59.0 (#22288) ## **Description** The back arrow in `PerpsHomeScreen` was using `navigation.goBack()`, which would work correctly when navigating from Main wallet view → Perps Home → Main wallet view But when entering `PerpsHomeScreen` from another entry point, such as PerpsOnboarding, it would create a loop when navigating from Perps Tutorial → Perps Home (back arrow would return to tutorial) This PR fixes this by changing this to `navigateToWallet` which explicitly navigates to the wallet home screen as expected ## **Changelog** CHANGELOG entry: Fix navigation loop from PerpsHomeScreen ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1984 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Updates PerpsHome back button to explicitly navigate to wallet home and adjusts tests accordingly. > > - **UI**: > - Updates `app/components/UI/Perps/Views/PerpsHomeView/PerpsHomeView.tsx` to use `perpsNavigation.navigateToWallet` for the back action instead of `navigateBack`. > - **Tests**: > - Adjusts `PerpsHomeView.test.tsx` to mock `navigateToWallet` and assert it’s called when pressing the back button; clears related mocks in setup. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6357f90. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [e30bced](e30bced) Co-authored-by: Nick Gambino <35090461+gambinish@users.noreply.github.com> Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
… on token details in android (#22347) - fix: cp-7.59.0 fix crash when hiding token on token details in android (#22327) ## **Description** PR to fix undefined error when trying to hide a token from Asset details page. ## **Changelog** CHANGELOG entry: Fixed a bug that was causing app crash when trying to hide a token from asset details page. ## **Related issues** Fixes: #22325 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/c2eafdbd-2399-4294-b37b-7f04e8e5e00c ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/a6c9e115-9399-47ab-ae2b-3511db97cbff ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] 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-mobile/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] > Prevents crash on token hide by moving token resolution to a new container that safely finds the token and only renders when present. > > - **Asset Details refactor** > - Introduces `AssetDetailsContainer` to fetch the token from Redux (`selectAllTokens`) and pass it to `AssetDetails` via `props.token`. > - Uses `areAddressesEqual` to match `rawToken.address` with `address`. > - Adds a guard: returns `null` if token is not found, preventing undefined access. > - **Component changes** > - `AssetDetails` now receives `token` and directly reads `symbol`, `decimals`, `aggregators`. > - Removes in-component token lookup (`tokensByChain`, `portfolioToken`). > - Exports `AssetDetailsContainer` as default. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6b50a16. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: sahar-fehri <sahar.fehri@consensys.net> [d42d736](d42d736) Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net> Co-authored-by: sahar-fehri <sahar.fehri@consensys.net> Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
…roduction builds cp-7.59.0 (#22335) - fix: Toast component theme reactivity in production builds cp-7.59.0 (#22291) ## **Description** Fixed Toast component theme not updating when switching between light and dark mode in production builds (TestFlight). The issue only affected production builds while working correctly in development/simulator. ### Root Cause: The Toast component had an empty dependency array `[]` in its `useMemo` hook (line 69), which cached the initial theme styles and never updated when the theme changed. This was a remnant from when Toast used inverse/hardcoded theming. ### Solution: Updated the `useMemo` dependency array to properly track `[styles.base, animatedStyle]`, ensuring the component re-renders with correct theme colors when theme changes occur. ## **Changelog** CHANGELOG entry: Fixed Toast component not updating theme colors when switching between light and dark mode ## **Related issues** Fixes: Theme change issue in Toast component ## **Manual testing steps** ```gherkin Feature: Toast theme updates correctly Scenario: User switches device theme while Toast is visible Given the app is running with a visible Toast notification When user switches from light mode to dark mode (or vice versa) in device settings Then the Toast should update to match the new theme colors immediately Scenario: Toast appears with correct theme in production build Given the app is running in a TestFlight production build And user has dark mode enabled When a Toast notification appears Then the Toast displays with correct dark theme colors (not stuck in light theme) ``` ## **Screenshots/Recordings** ### **Before** Toast remained in previous theme colors when device theme was changed in production builds. https://github.com/user-attachments/assets/d96faa41-10c3-4777-baf0-cb33ec137309 ### **After** Toast correctly updates to match current theme in both development and production builds. https://github.com/user-attachments/assets/aea3a725-0aa1-4412-bd56-5bde79fbfbbd ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Adjusts `useMemo` dependencies for `baseStyle` in `Toast.tsx` to include `styles.base` and `animatedStyle`, ensuring reactive updates. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e5c8919. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [a659739](a659739) Co-authored-by: George Marshall <george.marshall@consensys.net> Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
…ort (#22340) - fix: cp-7.59.0 market list open interest sort (#22294) <!-- 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** ### Summary Fixes incorrect open interest calculation in the market list. Open interest was showing values in thousands instead of billions because the calculation wasn't converting raw contract units to USD by multiplying by the current price. ### Root Cause The transformMarketData() function used by the market list was parsing raw open interest values directly: // BEFORE (incorrect)const openInterest = assetCtx?.openInterest ? parseFloat(assetCtx.openInterest) : NaN; This treated open interest as USD when it's actually in contract units. For example, BTC with 1M open interest contracts at $50K should be $50B, but was showing as $1M. ### Solution Created a centralized calculateOpenInterestUSD() utility function that properly converts contract units to USD by multiplying by the current price: // AFTER (correct)const openInterest = calculateOpenInterestUSD( assetCtx?.openInterest, effectiveCurrentPrice,); This utility is now used consistently in: transformMarketData() - Initial REST API data transformation (market list) HyperLiquidSubscriptionService - WebSocket real-time updates (2 locations) ### Known Discrepancy (Not Addressed in This PR) There are two separate data sources for market data: Market List: Uses REST API snapshot via getMarketDataWithPrices() Data source: allMids prices from REST API Update frequency: Cached, refreshes periodically or on pull-to-refresh Use case: Browsing markets Market Statistics Card: Uses real-time WebSocket via subscribeToPrices() Data source: midPx || markPx from WebSocket Update frequency: Real-time, updates every ~1-2 seconds Use case: Viewing specific market details Impact: While both now use the same calculation logic (calculateOpenInterestUSD), the market list shows a snapshot while the statistics card shows live real-time values. This is by design to prevent scroll jumping and excessive re-renders in the list view. Users can pull-to-refresh to update the market list. ### Changes Made Created utility function: calculateOpenInterestUSD() in marketDataTransform.ts Updated market list: Uses utility in transformMarketData() Updated WebSocket service: Uses utility in HyperLiquidSubscriptionService (2 locations) <!-- 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: https://consensyssoftware.atlassian.net/browse/TAT-1972 ## **Manual testing steps** ```gherkin Scenario: Sorting preserves correct open interest calculation Given BTC has 1,000,000 contracts at $52,000 per contract And ETH has 5,000,000 contracts at $3,100 per contract When I sort markets by open interest Then BTC displays "$52.00B" and appears before ETH And ETH displays "$15.50B" and appears after BTC And the sorting uses the calculated USD values (contracts × price) And not the raw contract numbers Scenario: Switching from volume sort to open interest sort Given markets are currently sorted by "Volume" And the order is: SOL ($500M), BTC ($450M), ETH ($300M) When I change the sort to "Open Interest" Then markets reorder immediately And the new order is: BTC ($52.00B), ETH ($15.50B), SOL ($1.50B) And the sort dropdown shows "Open Interest" as selected ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="400" alt="image" src="https://github.com/user-attachments/assets/240a07c0-3a32-4e05-ae7e-6ec2ff026d92" /> <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Corrects open interest to USD (contracts × price) and applies it in market transform and WebSocket updates, with comprehensive tests. > > - **Utilities**: > - Add `calculateOpenInterestUSD` in `app/components/UI/Perps/utils/marketDataTransform.ts` to convert contract OI to USD. > - **Data Transform**: > - Update `transformMarketData` to use `calculateOpenInterestUSD` for `openInterest`. > - **WebSocket Subscriptions**: > - Update `app/components/UI/Perps/services/HyperLiquidSubscriptionService.ts` to compute `openInterest` via `calculateOpenInterestUSD` in `activeAssetCtx` and `assetCtxs` handlers. > - **Tests**: > - Expand `app/components/UI/Perps/utils/marketDataTransform.test.ts` with unit tests for `calculateOpenInterestUSD` and adjust expectations (e.g., BTC OI now `$52.00B`). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a106d00. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [aa15c73](aa15c73) Co-authored-by: Nicholas Smith <nick.smith@consensys.net> Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
…ents for social login users (#22359) - fix: metaMetrics not tracking events for social login users (#22259) <!-- 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** Bugfix: metaMetrics not tracking events for social login users Fix: #22296 <!-- 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: Bugfix: metaMetrics not tracking events for social login users ## **Related issues** Fixes: metaMetrics not tracking events for social login users(#22296) ## **Manual testing steps** ```gherkin Feature: track events for social login Scenario: New Google login wallet setup track "Wallet Setup Started" event Given app is a clean install And user is on the onboarding screen And user presses "Continue with Google/Apple" When user complete onboarding Then "Wallet Setup Started" event appears in Segment for this user ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** N/A ### **After** <img width="1296" height="821" alt="Screenshot 2025-11-07 at 1 18 15 PM" src="https://github.com/user-attachments/assets/1460f986-e010-43b7-aee8-fcc8e0d6fc1d" /> <img width="1204" height="183" alt="Screenshot 2025-11-07 at 1 18 40 PM" src="https://github.com/user-attachments/assets/750ada94-ce19-474b-b8b3-40453f6ecea0" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Use `isEnabled()` (includes social-login opt-in) instead of `enabled` to gate `addTraitsToUser`, `group`, and `trackEvent`. > > - **Analytics**: > - **`app/core/Analytics/MetaMetrics.ts`**: > - Replace direct `enabled` checks with `isEnabled()` in `addTraitsToUser`, `group`, and `trackEvent` to ensure events flow when social-login metrics are enabled. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8057117. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [bec56bc](bec56bc) Co-authored-by: Gaurav Goel <grvgoel19@gmail.com> Co-authored-by: João Loureiro <175489935+joaoloureirop@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**
feat: Remove stocks/commodities dropdown and fix FlashList gaps
Changes:
- Remove conditional stocks/commodities dropdown in market list view
- Set showStocksCommoditiesDropdown to false (always hidden)
- Add tests to verify dropdown is not shown regardless of market type
filter
- Fix FlashList layout gaps in market lists
- Add drawDistance={200} and removeClippedSubviews props to
PerpsMarketList
- Create marketListConfig.ts for FlashList configuration constants
- Prevents blank space gaps when searching or scrolling
- Fix pre-existing test failure
- Refactor "handles search with whitespace" test to use proper mocking
- Rename to "filters markets with whitespace-only query" for clarity
<!--
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: https://consensyssoftware.atlassian.net/browse/TAT-2041
Fixes: #22440
## **Manual testing steps**
```gherkin
feat: Remove stocks/commodities dropdown and fix FlashList gaps
Feature: Market List View Filtering
Scenario: Hide secondary dropdown in stocks tab
Given the market list view is displayed
When the user is on any market type tab
Then the stocks/commodities dropdown should not be visible
And the filter bar should only show the sort dropdown
Feature: FlashList Rendering
Scenario: Prevent layout gaps in market list
Given the market list uses FlashList for rendering
When markets are displayed in search or tab views
Then there should be no blank space gaps
And items should render 200px ahead of viewport
And clipped subviews should be removed for optimal layout
```
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<img width="399" alt="Simulator Screenshot - iPhone 17 Pro - 2025-11-10
at 18 23 47"
src="https://github.com/user-attachments/assets/18233ad3-992f-4a5e-bd14-9809ba23043c"
/>
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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]
> Hides the stocks/commodities dropdown in the market list and
configures FlashList (drawDistance, removeClippedSubviews) via new
constants to prevent layout gaps, with tests updated accordingly.
>
> - **UI**:
> - Force-hide stocks/commodities dropdown by setting
`showStocksCommoditiesDropdown={false}` in `PerpsMarketListView`.
> - **Performance/Rendering**:
> - Add `drawDistance={200}` and `removeClippedSubviews` to
`PerpsMarketList`’s `FlashList`.
> - Centralize list config in `constants/marketListConfig.ts`
(`PERPS_MARKET_LIST_CONSTANTS`).
> - **Tests**:
> - Add assertions that `stocks/commodities` dropdown is not rendered
(regardless of market filter).
> - Refactor whitespace-only search test using hook-based mocking and
rename for clarity.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
0eccafa. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=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** <!-- 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? --> This PR aims to update minimum BTC amount for send flow. As this is a new feature we will release - I will skip adding any changelog record. ## **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: #22337 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Lowers the Bitcoin minimum send amount validation to 0.000006 BTC and updates related tests. > > - **Validation**: > - Update `MINIMUM_BITCOIN_TRANSACTION_AMOUNT` to `0.000006` in `useAmountValidation.ts`. > - `isValidBitcoinAmount` now validates against the new threshold. > - **Tests**: > - Adjust BTC threshold cases in `useAmountValidation.test.ts` for below (`0.000005`) and at (`0.000006`) minimum values. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b0da6a3. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=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** Fix issue with incorrect network order & fees <!-- 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: fix incorrect network order and fees ## **Related issues** Fixes: #22314 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/907764f2-695e-4cda-bda8-eaee609fc562 <img width="420" height="913" alt="simulator_screenshot_AC60FBFE-5FB0-488D-97F1-9D16106F285E" src="https://github.com/user-attachments/assets/711c89d6-8284-4265-b253-37f13c0a583a" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Sorts destination networks by popularity with BTC included and standardizes network fee display to fiat, with updated tests and e2e adjustments. > > - **Bridge UI** > - **Network ordering**: Export and use `ChainPopularity` to sort destination networks; add BTC (`BtcScope.Mainnet`) and adjust rankings; fallback to `Infinity` for unknown chains. > - **Dest selector**: Apply popularity sort in `BridgeDestNetworkSelector` (excludes current chain unless Unified mode). > - **Snapshots/Tests**: Update snapshots to reflect new order; add test for popularity fallback. > - **Quote Data** > - **Fees**: Always format `networkFee` using fiat `valueInCurrency` (handles `<$0.01`, `$0`, and missing values as `-`); remove primary-currency/ticker-based formatting. > - **Unit Tests**: Update and expand tests to cover new fee formatting cases and edge conditions. > - **E2E** > - Adjust `swipeNetwork` to target updated ordering. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fc761a6. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Bryan Fullam <bryan.fullam@consensys.net>
<!-- 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** There was a flickering issue when changing the payment method on the buy screen or the region on the sell screen. To fix the payment method issue, we just needed to remove it from the handleRegionChange dependency array. To fix the region issue, we needed to store a reference to the previously selected region and use that to check whether an update was necessary. <!-- 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: #22313 ## **Manual testing steps** ```gherkin Feature: Buy flow - Change payment method Scenario: User changes the payment method during the Buy flow without UI flickering Given the user is on the asset details screen And a default payment method is selected When the user taps the "Buy" button And the bottom sheet appears And the user taps "Buy" again in the bottom sheet And the user taps "Payment Method" And the user selects a different payment method Then the selected payment method should update And the UI should transition smoothly with no flickering Feature: Sell flow - Change region Scenario: User changes the region during the Sell flow without UI flickering Given the user is on the asset details screen And a default region is selected When the user taps the "Buy" button And the bottom sheet appears And the user taps "Sell" in the bottom sheet And the user taps "Region" And the user selects a different region Then the selected region should update And the UI should transition smoothly with no flickering ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> payment method change issue: https://github.com/user-attachments/assets/53af19a7-72d3-41c3-968d-703949572049 region change issue: https://github.com/user-attachments/assets/cf85e687-a9ea-4606-a3e9-efbced95dc42 ### **After** <!-- [screenshots/recordings] --> payment method change fix: https://github.com/user-attachments/assets/2635c9fd-05dc-4a1f-83e2-c35723799290 region change fix: https://github.com/user-attachments/assets/4b103f2e-b6fc-4517-af21-6888c0b6995f ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Moves fiat-currency-on-region-change logic from BuildQuote to useFiatCurrencies with previous-region checks, and adds tests to validate behavior. > > - **Aggregator logic**: > - **`useFiatCurrencies`**: Adds `usePrevious(selectedRegion)` and effect to update `selectedFiatCurrencyId` when region changes only if using the default currency; queries new region default and updates selection. > - Maintains existing behaviors for selecting default currency and validating availability. > - **UI**: > - **`BuildQuote.tsx`**: Removes region-change fiat update effect and `setSelectedFiatCurrencyId` usage; relies on `useFiatCurrencies` for currency sync. > - **Tests**: > - **`useFiatCurrencies.test.ts`**: Adds tests for updating currency on region change when using default currency, and not updating when a custom currency is selected; includes `act` usage. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e902222. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…rmance optimizations in TabList cp-7.59.0 (#22458) - fix: PerpsMarketList navigation, and performance optimizations in TabList cp-7.59.0 (#22341) ## **Description** Navigating from a subsection in the PerpHomeScreen should navigate to the proper tab in the MarketList. This PR also introduces some performance optimizations in the horizontal scroll view by memoizing list items to reduce the memory footprint, leading to a snappier behavior. If we want further optimizations, we can remove swipe navigation, in favor of just pressing the tabs and leaning into lazy loading more. ## **Changelog** CHANGELOG entry: Fix PerpsMarketList navigation and improve performance on swipeable list view ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2039 ## **Manual testing steps** ```gherkin Feature: Perps Market List Tab Navigation Scenario: user navigates to Stocks tab from home screen Explore stocks and commodities section Given user is on the Perps home screen And the "Explore stocks and commodities" section is visible When user taps "See all" in the "Explore stocks and commodities" section Then user is navigated to the Perps market list screen And the "Stocks" tab is selected And stocks and commodities markets are displayed Scenario: user navigates to Crypto tab from home screen Explore crypto section Given user is on the Perps home screen And the "Explore crypto" section is visible When user taps "See all" in the "Explore crypto" section Then user is navigated to the Perps market list screen And the "Crypto" tab is selected And crypto markets are displayed Scenario: user switches tabs by tapping tab bar Given user is on the Perps market list screen And the "All" tab is currently selected And the market list is scrolled to the middle When user taps the "Crypto" tab Then the "Crypto" tab becomes active And only crypto markets are displayed And the market list is scrolled to the top And no performance lag is observed Scenario: user switches tabs by swiping Given user is on the Perps market list screen And the "All" tab is currently selected When user swipes left on the market list Then the "Crypto" tab becomes active And the tab bar indicator animates to "Crypto" And only crypto markets are displayed And the swipe gesture is smooth without stuttering Scenario: user swipes between multiple tabs quickly Given user is on the Perps market list screen And the "All" tab is currently selected When user swipes left to the "Crypto" tab And user swipes left again to the "Stocks" tab Then the "Stocks" tab becomes active And the tab bar indicator animates smoothly to "Stocks" And stocks and commodities markets are displayed And tab switching is instant without noticeable delay Scenario: user returns to previously viewed tab Given user is on the Perps market list screen And the "Crypto" tab is currently selected And user has previously viewed the "All" tab When user taps the "All" tab Then the "All" tab becomes active And all markets (crypto, stocks, and commodities) are displayed And the market list is scrolled to the top And no re-rendering delay is observed Scenario: user applies sub-filter on Stocks tab Given user is on the Perps market list screen And the "Stocks" tab is currently selected And both stocks and commodities are displayed When user taps the stocks/commodities filter dropdown And user selects "Stocks only" Then only equity markets are displayed And commodity markets are hidden And the filter updates instantly Scenario: user switches away from Stocks tab with active sub-filter Given user is on the Perps market list screen And the "Stocks" tab is currently selected And the sub-filter is set to "Stocks only" When user taps the "Crypto" tab And user taps back to the "Stocks" tab Then the "Stocks" tab becomes active And the sub-filter is reset to "All" And both stocks and commodities are displayed ``` ## **Screenshots/Recordings** https://github.com/user-attachments/assets/9b8c5278-018a-4a42-89b6-ef0cbd3b647a ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Fixes navigation to the correct market tab (including `stocks_and_commodities`) and refactors `PerpsMarketListView` for smoother swipe/tab sync with memoized row items. > > - **Navigation/Filtering**: > - `PerpsHomeView`: pass `marketType="stocks_and_commodities"` for Stocks & Commodities section. > - `PerpsMarketTypeSection`: add `stocks_and_commodities` type; "See All" navigates with `defaultMarketTypeFilter` matching section type. > - **Market List View (performance/UX)**: > - Replace per-tab filtering/components with unified `displayMarkets` (applies sub-filter only on `stocks_and_commodities`). > - Implement programmatic scroll guard with `isScrollingProgrammatically` to prevent tab/scroll feedback loops and sync active tab on swipe/press. > - Simplify tabs rendering: render list per tab using `displayMarkets`; remove `tabsToRender` and related logic. > - Update empty/error/loading and analytics conditions to use `displayMarkets`; fade-in tied to `displayMarkets.length`. > - **Components**: > - `PerpsMarketRowItem`: export `React.memo(...)` for row memoization; adjust tests to rerender with spread props. > - **Tests**: > - Update expectations for "See All" navigation to pass the specific `defaultMarketTypeFilter` and accommodate memoized row rerenders. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2fc991c. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com> Co-authored-by: Arthur Breton <arthur.breton@consensys.net> Co-authored-by: Nicholas Smith <nick.smith@consensys.net> Co-authored-by: dylanbutler1 <99672693+dylanbutler1@users.noreply.github.com> [9e5d761](9e5d761) Co-authored-by: Nick Gambino <35090461+gambinish@users.noreply.github.com> Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com> Co-authored-by: Arthur Breton <arthur.breton@consensys.net> Co-authored-by: Nicholas Smith <nick.smith@consensys.net> Co-authored-by: dylanbutler1 <99672693+dylanbutler1@users.noreply.github.com>
…e on state transition cp-7.59.0 (#22378) - fix: trigger rewards animation value update on state transition cp-7.59.0 (#22351) <!-- 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** **Problem** The rewards points animation was inconsistently displaying 0 in the UI despite estimatedPoints containing the correct value. This occurred when transitioning from Loading to Idle state because the animation effect only triggers when the value prop changes, not when the animation state changes. When Loading state set animatedValue to 0 and then transitioned to Idle with the same estimatedPoints value, the display remained stuck at 0. **Solution** Added synchronization logic in handleIdleState and handleRefreshFinishedState to ensure animatedValue is always updated to match the current value when entering these states. This guarantees the display correctly animates to the actual points value regardless of whether the value prop changed during state transitions. The fix resolves the race condition between animation state changes and value updates. <!-- 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: ## **Related issues** Fixes: #22364 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://github.com/user-attachments/assets/e435e3ba-ec00-4ef7-b63d-61ece252876a <!-- [screenshots/recordings] --> ### **After** https://github.com/user-attachments/assets/a7945403-e93a-43f9-adbc-f581ade567ff <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] 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-mobile/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] > Synchronizes `animatedValue` with the current points when entering `Idle` and `RefreshFinished` to avoid the display sticking at 0, and updates hook dependencies accordingly. > > - **Rewards animation hook (`useRewardsAnimation.ts`)**: > - Ensure `animatedValue` updates to the current value on entering `Idle` and `RefreshFinished` (via `withTiming`) so the displayed points are correct even if `value` didn’t change. > - Expand dependencies for `handleIdleState` and `handleRefreshFinishedState` callbacks to include `animatedValue`/`value`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d167ee4. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [2ae45e5](2ae45e5) Co-authored-by: Bryan Fullam <bryan.fullam@consensys.net> Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com>
…ent issue + undefined balances (#22737) - fix(card): cp-7.58.3 physical address consent issue + undefined balances (#22676) <!-- 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** <!-- 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? --> This PR hardens several Card flows: - Mailing-address consent now recreates or reuses onboarding consent defensively, mirroring the logic in the physical-address step. - useWrapWithCache, CardHome, and their test suites now treat cache errors and expired-card tokens consistently; the home screen shows a dedicated spinner while auth cleanup runs and only processes each auth error once. - Onboarding/Complete now calls navigation.dispatch(StackActions.replace(...)) (with updated tests) so we don’t stack duplicate routes after successful onboarding. - Card login path surfaces the new ACCOUNT_DISABLED error type with the correct localized messaging. - These fixes resolve missing-consent crashes, inconsistent priority-token balances, brittle token-expiration UX, and the lingering navigation issue after onboarding. ## **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: Improved MetaMask Card onboarding and home flows (defensive consent creation, consistent balance caching, robust expired-token handling, and navigation fixes). ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Strengthens Card onboarding and home flows with defensive consent creation/linking, robust auth error cleanup/navigation, corrected fiat balance formatting, improved cache/error handling, and SDK support for consent lookup plus ACCOUNT_DISABLED errors. > > - **Card UI/Navigation**: > - `CardHome`: Detects auth errors once, clears token/state, and replaces route to `Routes.CARD.WELCOME`; shows loading spinner during cleanup; loads data on first open. > - `Onboarding/Complete`: Uses `navigation.dispatch(StackActions.replace(...))` to go to HOME/AUTHENTICATION; resets onboarding state. > - **Onboarding Consent (Defensive)**: > - `PhysicalAddress`/`MailingAddress`: Reuse existing consent, create if missing, skip when already completed, link user post-registration, and clear `consentSetId` in Redux. > - **Hooks**: > - `useAssetBalances`: Handles `tokenRateUndefined`/loading sentinels, reformats raw fiat strings with currency detection, and falls back to token amounts; enriches raw values. > - `useWrapWithCache`: Returns `Error` objects (not booleans), avoids auto-refetch on error/while loading, and only caches non-null results. > - `useGetCardExternalWalletDetails`/`useGetDelegationSettings`: Include error objects; auto-fetch only when SDK/auth/settings ready. > - `useCardDetails`: Surfaces real errors; preserves warnings and polling behavior. > - `useCardProviderAuthentication`: Maps `ACCOUNT_DISABLED` to server message. > - **SDK/Types**: > - `CardSDK`: Adds `getConsentSetByOnboardingId`, maps disabled accounts to `ACCOUNT_DISABLED` error; various request/response hardening. > - `types`: Add `ACCOUNT_DISABLED`, `ConsentSet`/`GetOnboardingConsentResponse`. > - **Tests**: > - Extensive updates/additions across components and hooks to validate new consent logic, navigation replaces, fiat formatting, cache/error behavior, and SDK endpoints. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit eaef69b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [0828e98](0828e98) Co-authored-by: Bruno Nascimento <brunonascimentodev@gmail.com>
…wards row cp-7.59.0 (#22746) - fix: transition to BIP-44 selectors for rewards row cp-7.59.0 (#22742) <!-- 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** Fix issue where rewards calculations were broken for Solana by transitioning to BIP-44 compliant account selectors. <!-- 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: #22741 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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 Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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] > Updates rewards logic to use BIP-44 multichain account selectors and CAIP-formatted source chain/account, and aligns tests with new selector. > > - **Hooks** > - Update `useRewards` to use `selectSelectedInternalAccountByScope` and `getFormattedAddressFromInternalAccount` instead of legacy selected address/chain selectors. > - Derive `sourceChainId` via `formatChainIdToCaip` and pass it to CAIP-10 account formatting; replace `currentChainId` dependencies with `sourceChainId`. > - **Tests** > - Add mock for `selectSelectedInternalAccountByScope` in `QuoteDetailsCard.test.tsx` to supply Solana/EVM accounts for rewards logic. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 02cce43. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [2b82250](2b82250) Co-authored-by: Bryan Fullam <bryan.fullam@consensys.net>
…amount (#22793) - fix: cp-7.59.0 Fix layout of small devices in asset amount (#22703) <!-- 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** <!-- 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? --> After recent changes on keypad component keypad component was overflowing and not letting users to click "0" button. This PR aims to fix layout in send flow amount page. ## **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: #22702 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** https://github.com/user-attachments/assets/3396b9d5-1dab-45d5-aa77-489c4cef4e65 ### **After** Small devices: <img width="517" height="1019" alt="after 6" src="https://github.com/user-attachments/assets/f84a6a1d-3962-4e9b-8663-2c1b03d556fb" /> <img width="517" height="1019" alt="after2" src="https://github.com/user-attachments/assets/973a1ac6-2ae1-4404-8ccb-e35e46b23451" /> <img width="561" height="1063" alt="after 3" src="https://github.com/user-attachments/assets/86a8bd4c-6bce-4f84-9e62-a543cecaac71" /> Larger devices: <img width="559" height="1062" alt="after 5" src="https://github.com/user-attachments/assets/56c42edd-f46e-43c0-bb11-950f000312d0" /> <img width="559" height="1062" alt="after1" src="https://github.com/user-attachments/assets/7e682ab4-bd70-40a8-87ed-8f662816f8b4" /> <img width="515" height="1018" alt="after 4" src="https://github.com/user-attachments/assets/d3cb8197-b576-43d5-9c62-48ef1ccdbc1e" /> ## **Pre-merge author checklist** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Reworks the send amount screen layout by centering the top section, moving balance text above the keyboard, and removing NFT-specific spacing to prevent overflow on small devices. > > - **Send Amount UI**: > - Center `topSection` with `flex: 1`; remove extra vertical padding and NFT-specific margins. > - Replace `balanceSection` with `balanceText`; reposition balance display within `topSection` and add `marginTop`. > - Remove conditional `marginTop` from `inputSection`; keep dynamic font sizing via `getFontSizeForInputLength`. > - Remove `nftImageWrapper` top margin. > - **Logic/Props**: > - Simplify `useStyles` vars to only `contentLength`; drop `isNFT` from styles. > - **Structure**: > - Move `AmountKeyboard` to the bottom of the screen; remove redundant wrapper views. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 71cbdce. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [5cbee3a](5cbee3a) Co-authored-by: OGPoyraz <omergoktugpoyraz@gmail.com>
…n in live positions cp-7.59.0 (#22807) - fix(perps): use centralized ROE calculation in live positions cp-7.59.0 (#22791) <!-- 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** This PR refactors the Return on Equity (ROE) calculation logic in the usePerpsLivePositions hook to use the centralized calculateRoEForPrice utility function instead of the previous manual calculation. ## **Changelog** CHANGELOG entry: Fixed a bug where the PnL was showing incorrect values in the position card ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2080 Fixes #22790 ## **Manual testing steps** ```gherkin Feature: Live ROE calculation for Perps positions Scenario: user views live positions with updated ROE Given user has open perpetual positions And the positions are being streamed with live price updates When the market price changes Then the ROE percentage should update in real-time And the ROE should be calculated consistently with TP/SL ROE calculations And the ROE should properly reflect the position direction (long/short) And the ROE should account for the position's leverage ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** PnL on the list is not matching the PnL on the position card https://github.com/user-attachments/assets/72729f8d-080f-45a5-bcd0-ce3776f2efde ### **After** PnL in the position card is matching the PnL from the list <img width="1170" height="2532" alt="Simulator Screenshot - iPhone 16e - 2025-11-17 at 13 14 10" src="https://github.com/user-attachments/assets/bc82bdff-3579-4bc0-91f4-a6ceb8518b5e" /> <img width="1170" height="2532" alt="Simulator Screenshot - iPhone 16e - 2025-11-17 at 13 14 02" src="https://github.com/user-attachments/assets/4dd7c44b-8b58-4389-b083-0110e2af6007" /> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Reworks live PnL/ROE in `usePerpsLivePositions` to use centralized ROE with leverage and prefer `price` over `markPrice`, updating tests accordingly. > > - **Perps live positions**: > - Use `price` (fallback `markPrice`) for live PnL. > - Compute ROE via `calculateRoEForPrice`; derive direction from `size`; use `leverage` instead of `marginUsed`. > - Validate inputs (`entryPrice`, `size`, `currentPrice`) and return original position on invalid data. > - **Tests**: > - Update expectations to prefer `price` over `markPrice` (e.g., PnL 1000 vs 1500). > - Add case to compute PnL/ROE when `marginUsed` is NaN by using `leverage`. > - Adjust assertions for ROE/PnL consistency across long/short and price sources. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 1f82c64. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> [83230ef](83230ef) Co-authored-by: Michal Szorad <michal.szorad@consensys.net>
This PR updates the change log for 7.59.0. (Hotfix - no test plan generated.) --------- Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com> Co-authored-by: João Loureiro <175489935+joaoloureirop@users.noreply.github.com> Co-authored-by: sethkfman <setk.kaufman@consensys.net>
<!--
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**
<!--
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?
-->
hotfix release for 7.58.3
## **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**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **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 Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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.
# 🚀 v7.59.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 - **Developer Teams:** Conduct regression and exploratory testing for your functional areas, including automated and manual tests for critical workflows. - **QA Team:** Focus on exploratory testing across the wallet, prioritize high-impact areas, and triage any Sentry errors found during testing. - **Customer Success Team:** Validate new functionalities and provide feedback to support release monitoring. ### GitHub Signoff - Each team must **sign off on the Release Candidate (RC)** via GitHub by the end of the validation timeline (**Tuesday EOD PT**). - Ensure all tests outlined in the Testing Plan are executed, and any identified issues are addressed. ### Issue Resolution - **Resolve all Release Blockers** (Sev0 and Sev1) by **Tuesday EOD PT**. - For unresolved blockers, PRs may be reverted, or feature flags disabled to maintain release quality and timelines. ### Cherry-Picking Criteria - Only **critical fixes** meeting outlined criteria will be cherry-picked. - Developers must ensure these fixes are thoroughly reviewed, tested, and merged by **Tuesday EOD PT**. --- ## 🗓️ Timeline and Milestones 1. **Today (Friday):** Begin Release Candidate validation. 2. **Tuesday EOD PT:** Finalize RC with all fixes and cherry-picks. 3. **Wednesday:** Buffer day for final checks. 4. **Thursday:** Submit release to app stores and begin rollout to 1% of users. 5. **Monday:** Scale deployment to 10%. 6. **Tuesday:** Full rollout to 100%. --- ## ✅ Signoff Checklist Each team is responsible for signing off via GitHub. Use the checkbox below to track signoff completion: # Team sign-off checklist - [x] Accounts Framework - [x] Assets - [x] Bots Team - [x] Card - [x] Confirmations - [x] Core Platform - [x] Design System - [x] Earn - [x] Mobile Platform - [x] Mobile UX - [x] Network Enablement - [x] New Networks - [x] Perps - [x] Predict - [x] Product Safety - [x] Ramp - [x] Rewards - [x] Swaps and Bridge - [x] Transactions - [x] Wallet Integrations - [x] Web3Auth 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 - Testing plan sheet - https://docs.google.com/spreadsheets/d/1tsoodlAlyvEUpkkcNcbZ4PM9HuC9cEM80RZeoVv5OCQ/edit?gid=404070372#gid=404070372 <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is generating a summary for commit 06788b7. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…23086) ## **Description** This PR refactors the Perps home screen balance component to match the updated design specifications. The main changes consolidate button functionality into the balance card component and improve P&L display consistency. **Key improvements:** 1. Integrated "Add funds" and "Withdraw" buttons directly into the balance card (removed fixed footer) 2. Fixed P&L computation to use standard utilities and `returnOnEquity` for accurate percentage display 3. Updated empty state design with proper icon sizing and button styling 4. Ensured consistency with other Perps views (PerpsTabView, PerpsMarketDetailsView) ## **Changelog** CHANGELOG entry: Improved Perps home screen balance display and button placement ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1938 ## **Manual testing steps** ```gherkin Feature: Perps balance component improvements Scenario: user views empty state Given user has zero perps balance When user navigates to Perps home screen Then user sees centered icon, title, description, "Add funds" button, and "Learn more" button And both buttons are full width and properly styled Scenario: user views funded state Given user has non-zero perps balance When user navigates to Perps home screen Then user sees large balance display as primary info And user sees available balance as secondary info And "Withdraw" and "Add funds" buttons are displayed below balance Scenario: user views P&L with open positions Given user has at least one open position When user navigates to Perps home screen Then user sees unrealized P&L with percentage using returnOnEquity And P&L is colored green for positive, red for negative ``` ## **Screenshots/Recordings** ### **Before** - Buttons were in fixed footer at bottom of screen - P&L calculation used incorrect percentage (from totalBalance) - Empty state had inconsistent button styling ### **After** - Buttons integrated into balance card component - P&L uses standard formatPnl() and formatPercentage() with returnOnEquity - Empty state matches design with full-width buttons and proper spacing https://github.com/user-attachments/assets/d16a602f-1ab7-4bad-a406-d7caca8e8a5e ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Refactors Perps Home and balance card to new design with integrated actions, empty state, and P&L; introduces usePerpsHomeActions; updates tests, selectors, and locales. > > - **Perps Home (UI/logic)**: > - Switch screen analytics to `HOMESCREEN` type; integrate `useSafeAreaInsets`. > - Use `usePerpsHomeActions` and live account to drive Add/Withdraw and eligibility modal. > - Replace static spacer with dynamic bottom spacer; add fixed footer with `Withdraw`/`Add funds` when funded; avoid duplicate "Learn more" in nav. > - Pass `positions` and `showActionButtons={false}` to `PerpsMarketBalanceActions`. > - **PerpsMarketBalanceActions (UI/logic)**: > - Redesign balance card: large total balance, secondary available, optional colored P&L (`formatPnl` + `returnOnEquity`). > - New empty state with icon, title/description, primary `Add funds`, secondary `Learn more`. > - Centralize actions via `usePerpsHomeActions`; remove token avatar/badges; animate on `totalBalance` changes. > - Update skeletons and optional inline action buttons via `showActionButtons`. > - **New hook**: `usePerpsHomeActions` encapsulates eligibility checks, network ensure, confirmation navigation, and error handling; exported for direct import; comprehensive tests added. > - **Tests/Selectors**: > - Update unit tests for Home and BalanceActions; add hook tests; extend E2E selectors for balance texts, P&L, empty state, and home footer buttons. > - **i18n**: Add `perps.trade_perps`, description, and `available` copy. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 62d1423. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Nicholas Smith <nick.smith@consensys.net>
Migrates some GH workflows to reusable actions. follow-up PR of these: - MetaMask/github-tools#169 - MetaMask/github-tools#168 <!-- 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** <!-- 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: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Migrates CI workflows from reusable workflows to explicit action steps and adds manual dispatch triggers where applicable. > > - **Workflows**: > - **`check-pr-max-lines.yml`**: > - Replace reusable workflow with action `MetaMask/github-tools/.github/actions/pr-line-check@v1`. > - Add `runs-on: ubuntu-latest`; configure `max-lines` and `ignore-patterns`. > - **`flaky-test-report.yml`**: > - Replace reusable workflow with action `.../flaky-test-report@v1`. > - Add `workflow_dispatch`; set `runs-on`; pass `repository`, `workflow-id`, `github-token`, and Slack webhook. > - **`post-merge-validation.yml`**: > - Replace reusable workflow with action `.../post-merge-validation@v1`. > - Add `workflow_dispatch`; set `runs-on`; pass `repo`, `start-hour-utc`, `github-token`, and GCP creds. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit dc5e870. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.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** <!-- 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? --> This PR aims to fix address validation for Tron when it's manually typed or pasted. We don't need to put a changelog as Tron will be release by the `7.60.0` ## **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: ## **Related issues** Fixes: #23114 ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** Posted in the task ### **After** https://github.com/user-attachments/assets/38431fe2-2a23-4827-b5db-6d0460602fbd ## **Pre-merge author checklist** - [X] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [X] I've completed the PR template to the best of my ability - [X] I’ve included tests if applicable - [X] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [X] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Adds Tron address validation and integrates it into the send address validation flow with comprehensive tests. > > - **Send flow**: > - `useToAddressValidation`: integrates Tron via `isTronSendType` and `validateTronAddress`. > - **Validation utils**: > - `validateTronAddress` added to `utils/send-address-validations` using `isTronAddress`. > - **Multichain utils**: > - `isTronAddress` implemented (base58 decode, version byte check) in `core/Multichain/utils`. > - **Tests**: > - Add Tron cases to `useToAddressValidation.test.ts` and `send-address-validations.test.ts`. > - Add `isTronAddress` and Tron scenarios to `core/Multichain/test/utils.test.ts`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6a29d49. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=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** This PR updates `setSelectedAccount` to update the selected account group instead of only setting the selected internal account. <!-- 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: Imported SRP and hardware wallets will now have their first account selected. ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1218?atlOrigin=eyJpIjoiYjA4MjFiNDE4NjgzNDg5MTk1MzdhNzUyZWIwZDg5OGQiLCJwIjoiaiJ9 Fixes: #20844 ## **Manual testing steps** ```gherkin Feature: importing new srp Scenario: user imports a new srp Given has entered a valid srp in the import wallet screen. When user clicks import Then the srp is imported with its first account selected. ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** [mul-1218-after.webm](https://github.com/user-attachments/assets/b9cfb5e8-2e96-4f8e-9ab7-5120ee80b4b3) <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Ensure the most recently unlocked hardware account is set as the selected address for QR and Ledger imports, with tests covering selection, errors, and navigation. > > - **QR Hardware Connect (`app/components/Views/ConnectQRHardware`)** > - **Behavior**: After unlocking selected indices, capture the last added account and call `Engine.setSelectedAddress` with it. > - **Tests**: Add `ConnectQRHardware.test.tsx` covering multi/single account unlock, no-account case, error logging, and `navigation.pop(2)`. > - **Ledger (`app/core/Ledger`)** > - **Behavior**: After `unlockLedgerWalletAccount`, call `Engine.setSelectedAddress` with the unlocked address. > - **Tests**: Update `Ledger.test.ts` to assert selected address is set after unlock and mock `setSelectedAddress`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 6684e3a. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Ensure activity value matches withdraw amount for Predict withdraw transactions. Also remove minus sign from Perps and Predict deposit transactions. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23094 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After**  ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Removes the negative fiat prefix for Perps/Predict deposits and Predict withdraws, adds decode handling for Predict withdraw, and updates tests accordingly. > > - **Transaction decoding (`app/components/UI/TransactionElement/utils.js`)**: > - Adjust fiat sign for token transfers using `hasTransactionType` and `POSITIVE_TRANSFER_TRANSACTION_TYPES` (`perpsDeposit`, `predictDeposit`, `predictWithdraw`), removing the minus for these types. > - Include `transactions.tx_review_predict_withdraw` in the transfer decoding switch to use `decodeTransferTx` with the original action key. > - **Tests (`app/components/UI/TransactionElement/utils.test.js`)**: > - Add parameterized tests for `perpsDeposit`, `predictDeposit`, and `predictWithdraw` verifying positive fiat values and summaries. > - Minor setup: import additions and `beforeEach(jest.clearAllMocks)`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit e61b769. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Hide Perps deposit transactions in activity when filtering to Arbitrum and source chain is not Arbitrum. Change network icon for Perps deposit transactions to match source chain. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: #23099 ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After**  ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Hides Perps deposit transactions when their source chain isn’t selected and updates the transaction icon badge to reflect the source network, while refining chain filtering inputs and adding tests. > > - **Activity filtering**: > - Update `isTransactionOnChains` to hide `perpsDeposit` when the required (funding) transaction’s chain isn’t in selected `chainIds`. > - Add comprehensive tests for `isTransactionOnChains`, including `perpsDeposit` scenarios. > - **Unified Transactions View**: > - Use `transactionMetaPool` instead of `allConfirmed` when calling `isTransactionOnChains` to ensure correct chain context. > - **UI** (`app/components/UI/TransactionElement`): > - Compute network badge chain for `perpsDeposit` from first `requiredTransactionId` (falls back to tx `chainId`). > - Inject all controller `transactions` via `useSelector(selectTransactions)` and new required prop. > - Adjust `renderTxElementIcon` signature to accept `tx`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 7a10afc. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=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**
<!--
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?
-->
This PR bumps the deflation conditions number to latest migrations
included to make sure release 7.60.0 will allow users to migrate the
right way to the new persistence system.
## **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:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **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**
- [x] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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]
> Adjusts migration inflate/deflate gating from 106 to 107 and updates
tests to align with new thresholds, adding minor test cleanups.
>
> - **Migrations**:
> - Update gating to inflate from controllers only when `migrationNumber
> 107` (was `> 106`).
> - Deflate and strip only when `lastVersion >= 107` (was `>= 106`).
> - **Tests (`app/store/migrations/index.test.ts`)**:
> - Align test versions with new thresholds (e.g., inflation at `108`,
pre-threshold at `105/106`, deflation checks at `107`).
> - Rename test descriptions for clarity and condense assertions.
> - Add `afterEach` `jest.resetAllMocks()` and minor mock setup tweaks.
> - Extend mixed-version flow to include `108` and verify single
inflation call.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
6ee3941. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=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** <!-- 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? --> This PR removes more constants imported from `@metamask/swaps-controller`. Related to #23040 ## **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: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **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** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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] > Replaces swaps-controller chain ID constants with CHAIN_IDS from transaction-controller across bridge components, card logic/SDK, and tests. > > - **Bridge**: > - Replace chain constants with `CHAIN_IDS` in `BridgeDestNetworksBar` (update `ChainPopularity`, `ShortChainNames`). > - Migrate allowed chains to `CHAIN_IDS` in `utils/index.ts`; adjust `isBridgeAllowed` and related tests. > - **Card**: > - Use `CHAIN_IDS.LINEA_MAINNET` in `useAssetBalances` and `useGetPriorityCardToken` (including CAIP formatting) and update references accordingly. > - Update `CardSDK` to derive `lineaChainId` from `CHAIN_IDS.LINEA_MAINNET`. > - Revise associated tests to reference `CHAIN_IDS` and updated CAIP values. > - **Selectors/Tests**: > - Update multichain EVM tests to use `CHAIN_IDS` for mainnet/polygon and related assertions. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 9046975. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=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**
shards do not block each other for unit tests
<!--
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:
## **Related issues**
Fixes:
## **Manual testing steps**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **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 Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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]
> Make merge and SonarCloud jobs run unconditionally in CI by adding
`if: always()`.
>
> - **CI workflow (`.github/workflows/ci.yml`)**:
> - Add `if: always()` to run the following jobs regardless of upstream
job outcome:
> - `merge-unit-tests`
> - `sonar-cloud`
> - `sonar-cloud-quality-gate-status`
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1047036. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=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** Add key signing for EAS updates. We check in public key in the repo and we sign the new javascript bundle with our private key. Tested on build 3082: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8ac1e534-f323-421a-bc57-25ebdad85c24 ## **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: Added EAS updates key signing ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: EAS updates Scenario: users should receive the OTA updates Given the app has public key When we push EAS updates signed with private key Then the app should receive updates successfully ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** I pushed EAS updates to remove all the links from App Information screen Android  iOS  <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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] > Add explicit `string` type annotation to `OTA_VERSION` in `app/constants/ota.ts`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 85e8334. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com> Co-authored-by: Aslau Mario-Daniel <marioaslau@gmail.com> Co-authored-by: sethkfman <10342624+sethkfman@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**
<!--
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?
-->
sync 7.58.3 & 7.59.0
## **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**
```gherkin
Feature: my feature name
Scenario: user [verb for user action]
Given [describe expected initial app state]
When user [verb for user action]
Then [describe expected outcome]
```
## **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 Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/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-mobile/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.
---------
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Co-authored-by: metamaskbot <metamaskbot@users.noreply.github.com>
Co-authored-by: runway-github[bot] <73448015+runway-github[bot]@users.noreply.github.com>
Co-authored-by: abretonc7s <107169956+abretonc7s@users.noreply.github.com>
Co-authored-by: OGPoyraz <omergoktugpoyraz@gmail.com>
Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com>
Co-authored-by: Aslau Mario-Daniel <marioaslau@gmail.com>
Co-authored-by: Bernardo Garces Chapero <bernardo.chapero@consensys.net>
Co-authored-by: Bruno Nascimento <brunonascimentodev@gmail.com>
Co-authored-by: Monte Lai <monte.lai@consensys.net>
Co-authored-by: Nicholas Smith <nick.smith@consensys.net>
Co-authored-by: Kylan Hurt <6249205+smilingkylan@users.noreply.github.com>
Co-authored-by: Luis Taniça <matallui@gmail.com>
Co-authored-by: sethkfman <10342624+sethkfman@users.noreply.github.com>
Co-authored-by: tommasini <tommasini15@gmail.com>
Co-authored-by: Nick Gambino <35090461+gambinish@users.noreply.github.com>
Co-authored-by: Prithpal Sooriya <prithpal.sooriya@consensys.net>
Co-authored-by: sahar-fehri <sahar.fehri@consensys.net>
Co-authored-by: George Marshall <george.marshall@consensys.net>
Co-authored-by: Gaurav Goel <grvgoel19@gmail.com>
Co-authored-by: SteP-n-s <stylianos.panagakos@consensys.net>
Co-authored-by: Bryan Fullam <bryan.fullam@consensys.net>
Co-authored-by: AxelGes <34173844+AxelGes@users.noreply.github.com>
Co-authored-by: Arthur Breton <arthur.breton@consensys.net>
Co-authored-by: dylanbutler1 <99672693+dylanbutler1@users.noreply.github.com>
Co-authored-by: Brian August Nguyen <brianacnguyen@gmail.com>
Co-authored-by: Michal Szorad <michal.szorad@consensys.net>
Co-authored-by: Christian Montoya <christian.montoya@consensys.net>
Co-authored-by: Alejandro Garcia Anglada <aganglada@gmail.com>
Co-authored-by: asalsys <sallem.ahmed@consensys.net>
Co-authored-by: Salim TOUBAL <salim.toubal@outlook.com>
Co-authored-by: khanti42 <florin.dzeladini@consensys.net>
Co-authored-by: VGR <VanGulckRik@gmail.com>
Co-authored-by: Patryk Łucka <5708018+PatrykLucka@users.noreply.github.com>
Co-authored-by: Alejandro Garcia <alejandro.garcia@consensys.net>
Co-authored-by: Charly Chevalier <charlyy.chevalier@gmail.com>
Co-authored-by: sethkfman <setk.kaufman@consensys.net>
Co-authored-by: Nicholas Gambino <nicholas.gambino@consensys.net>
Co-authored-by: Christopher Ferreira <104831203+christopherferreira9@users.noreply.github.com>
Co-authored-by: juanmigdr <juanmi.gdr@gmail.com>
Co-authored-by: Juanmi <95381763+juanmigdr@users.noreply.github.com>
Co-authored-by: Bruno Nascimento <bruno.nascimento@consensys.net>
Co-authored-by: Daniel <80175477+dan437@users.noreply.github.com>
Co-authored-by: Wei Sun <wei.sun@consensys.net>
Co-authored-by: Matthew Walsh <matthew.walsh@consensys.net>
Co-authored-by: MetaMask Bot <37885440+metamaskbot@users.noreply.github.com>
## **Description** Switch to UAT for any non prod or RC. ## **Changelog** CHANGELOG entry: null <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Switch default rewards API base URL to UAT for dev/local/undefined/unknown environments; tests updated accordingly. > > - **Rewards API URL selection**: > - `getDefaultRewardsApiBaseUrlForMetaMaskEnv` now returns `UAT` for `dev`, `local`, and fallback (`default`) cases. > - `production`, `beta`, `pre-release`, `rc` remain `PRD`; `e2e`/`exp` remain `UAT`. > - **Tests**: > - Updated assertions in `rewards-api-url.test.ts` to expect `UAT` for `dev`, `local`, `undefined`, and `unknown`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2cfcdfe. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=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** This PR adds comprehensive analytics tracking for the unified buy flow in the Ramp feature. Related segment tracking plan PR: Consensys/segment-schema#385 The main changes include: 1. **Added `RAMPS_TOKEN_SELECTED` analytics event** in the unified buy token selection flow (`TokenSelection.tsx`) to track when users select a token during the unified buy process. This event includes detailed information about the selected token, routing decision, and user context. 2. **Enhanced analytics type definitions** in `app/components/UI/Ramp/Deposit/types/analytics.ts`: - Added support for `'UNIFIED BUY'` and `'SELL'` ramp types across multiple analytics interfaces - Added new optional fields to `RampsButtonClicked` interface: `ramp_routing`, `is_authenticated`, `preferred_provider`, and `order_count` - Enhanced `RampsTokenSelected` interface with `token_caip19`, `token_symbol`, and `ramp_routing` fields - Added `first_time_order` field to `RampsOrderProposed` interface - Imported `UnifiedRampRoutingType` to ensure type safety across analytics events 3. **Updated `UnifiedRampRoutingType` enum** in `app/reducers/fiatOrders/types.ts`: - Split `AGGREGATOR` into `AGGREGATOR_BUY` and `AGGREGATOR_SELL` to provide more granular routing information for analytics 4. **Created new `useRampsButtonClickData` hook** that provides analytics data including routing decision, authentication status, preferred provider, and order count for use across ramp components. 5. **Updated multiple UI components** throughout the ramp flow to use the new analytics types and ensure consistent event tracking across deposit, buy, and unified buy flows. These changes enable better tracking and analysis of user behavior in the unified buy flow, providing insights into token selection patterns, routing decisions, and user preferences. ## **Changelog** CHANGELOG entry: Added analytics tracking for unified buy token selection and enhanced ramp analytics with routing and user context data ## **Related issues** Fixes: [TRAM-2812](https://consensyssoftware.atlassian.net/browse/TRAM-2812), [TRAM-2849](https://consensyssoftware.atlassian.net/browse/TRAM-2849) ## **Manual testing steps** ```gherkin Feature: Unified Buy Analytics Tracking Scenario: user selects a token in unified buy flow Given the user is on the unified buy token selection screen And the app has detected the user's geolocation And a ramp routing decision has been made When user selects a token from the list Then the RAMPS_TOKEN_SELECTED analytics event should be tracked with: - ramp_type: 'UNIFIED BUY' - region: detected geolocation - chain_id: selected token's chain ID - currency_destination: selected token's asset ID - currency_destination_symbol: selected token's symbol - currency_destination_network: network name - token_caip19: selected token's asset ID - token_symbol: selected token's symbol - ramp_routing: routing decision (DEPOSIT, AGGREGATOR_BUY, etc.) Scenario: user selects a token in deposit flow Given the user is on the deposit token selector modal And a region has been selected And the user's authentication status is known When user selects a token from the list Then the RAMPS_TOKEN_SELECTED analytics event should be tracked with: - ramp_type: 'DEPOSIT' - region: selected region's ISO code - is_authenticated: user's authentication status - ramp_routing: routing decision if available ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> Events have been received correctly in mixpanel DEV <img width="1454" height="417" alt="Screenshot 2025-11-21 at 10 07 15 AM" src="https://github.com/user-attachments/assets/c1bc2316-8a72-42ce-a144-5a46b233c63a" /> ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **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. [TRAM-2812]: https://consensyssoftware.atlassian.net/browse/TRAM-2812?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Implements unified buy analytics by adding a new hook to enrich RAMPS events and wiring enhanced tracking across ramp UIs, plus minor routing tweak and comprehensive tests. > > - **Analytics**: > - Add `useRampsButtonClickData` hook to provide `ramp_routing`, `is_authenticated`, `preferred_provider`, and `order_count` for analytics. > - Track `RAMPS_TOKEN_SELECTED` in `ramp/components/TokenSelection` and `deposit/TokenSelectorModal` with token/network details and routing info. > - Enhance `RAMPS_BUTTON_CLICKED` payloads in `BalanceEmptyState`, `Card/AddFundsBottomSheet`, `FundActionMenu`, `Aggregator/SettingsModal`, and `Deposit/ConfigurationModal` with new properties and region/chain data. > - Update `Deposit/BuildQuote` to include `first_time_order` in `RAMPS_ORDER_PROPOSED` and ensure consistent auth/region fields. > - Expand analytics types in `deposit/types/analytics.ts` to support new ramp types and properties. > - **Navigation**: > - Adjust `useRampNavigation.goToBuy` to route to `TokenSelection` when unified routing decision is `null`. > - **Tests**: > - Add/update unit tests across affected components to validate analytics payloads, navigation behavior, and hook logic. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8757589. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Pedro Pablo Aste Kompen <wachunei@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )