[pull] main from MetaMask:main#311
Merged
Merged
Conversation
## **Description** This is a collective effort to clean up our codebase by removing old feature flags such as `MM_PER_DAPP_SELECTED_NETWORK` ## **Changelog** CHANGELOG entry:null ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/MUL-1132 ## **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** `~` ### **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** - [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] > Removes MM_PER_DAPP_SELECTED_NETWORK flag and simplifies code to always use per-dapp network selection across UI, RPC, WalletConnect, selectors, hooks, tests, and CI. > > - **Network selection (core/infra)**: > - Remove `MM_PER_DAPP_SELECTED_NETWORK` flag and all conditionals; per-dapp network selection is now always on. > - `selectedNetworkController` selectors default to domain-based values; `selectPerOriginChainId` used broadly. > - `ethereum-chain-utils.switchToNetwork` and RPC middleware always set `SelectedNetworkController.setNetworkClientIdForDomain`. > - `useSwitchNetworks`/NetworkSelector: when dapp connected, always set per-domain network; otherwise switch global. > - **UI**: > - Account/Tx components (`AccountFromToInfoCard`, `AddressFrom`, `TransactionDetails`, `TransactionNotification`) use tx/chain-specific data directly (no flag checks). > - Permissions UIs (`PermissionsSummary`, `AccountPermissions`, multichain variants) always show per-dapp network picker and set domain network on changes. > - BrowserTab: remove legacy permission checks tied to global selection. > - **WalletConnect**: > - Use per-origin chain ID (`selectPerOriginChainId`) and domain network switching; simplify switch handling and tests accordingly. > - **Hooks/Utils**: > - `useAddressBalance` and smart tx publish hook rely on provided `chainId`/`networkClientId` without gating. > - **Tests/CI/Config**: > - Update unit/e2e tests and mocks removing flag; rename E2E titles to “Dapp Network Switching”. > - Remove flag from `.js.env.example` and Bitrise envs. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8de63d1. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description** Jira: https://consensyssoftware.atlassian.net/browse/NWNT-688 This PR adds support for the Predict tab in the Wallet view, which displays when the `predictEnabled` feature flag is enabled. The implementation follows the same pattern as the existing Perps tab integration, including visibility tracking and proper tab index calculation. **What is the reason for the change?** - Need to add a new Predict tab to the Wallet view that can be toggled via a feature flag - Ensure NFT and DeFi tabs remain hidden for non-EVM networks **What is the improvement/solution?** - Added Predict tab visibility logic based on the `selectPredictEnabledFlag` selector - Implemented visibility callback handling to track when the Predict tab is active - Added proper tab index calculation that accounts for enabled/disabled Perps and Predict tabs - Updated tests to cover all Predict tab visibility scenarios - Verified existing NFT and DeFi tab logic correctly hides these tabs for non-EVM networks ## **Changelog** CHANGELOG entry: Added Predict tab to Wallet view with feature flag support ## **Related issues** Fixes: [Issue number] ## **Manual testing steps** ### **Before** - No Predict tab in Wallet view - NFT and DeFi tabs already correctly hidden for non-EVM networks ### **After** - Predict tab appears when feature flag is enabled - Tab positioning adjusts dynamically based on enabled features - All visibility callbacks work correctly - NFT and DeFi tabs remain correctly hidden for non-EVM networks https://github.com/user-attachments/assets/135485da-5f80-4e7d-8515-6512c9964f99 ## **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 - Added 5 comprehensive tests for Predict tab visibility - All tests passing (36 skipped, 5 passed) - [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. --- ## **Technical Details** ### Files Changed: 1. **`app/components/Views/Wallet/index.tsx`** - Added `isPredictEnabled` logic based on `selectPredictEnabledFlag` - Added `predictVisibilityCallback` ref for visibility tracking - Added `predictTabIndex` calculation - Added `useEffect` hook to update Predict tab visibility - Integrated `PredictTabView` component with proper props 2. **`app/components/UI/Predict/views/PredictTabView/PredictTabView.tsx`** - Added `onVisibilityChange` prop to interface - Updated component to accept visibility callback (currently unused but prepared for future use) 3. **`app/components/Views/Wallet/index.test.tsx`** - Added mock for `PredictTabView` - Added mock for `selectPredictEnabledFlag` selector - Added comprehensive test suite with 5 tests covering all visibility scenarios ### Verification of Requirements: - ✅ **Predict tab displayed when feature flag is true** - Implemented via `isPredictEnabled` check - ✅ **NFT tab hidden for non-EVM** - Already implemented: `collectiblesEnabled` returns `isEvmSelected` (line 758) - ✅ **DeFi tab hidden for non-EVM** - Already implemented: `defiEnabled` includes `isEvmSelected &&` check (line 1314) ### Test Results: <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Integrates a feature-flagged Predict tab in Wallet and refines EVM-based visibility for NFTs/DeFi, with comprehensive tests for Predict/Perps tab visibility. > > - **Wallet view (`app/components/Views/Wallet/index.tsx`)**: > - **Predict tab**: Integrates `PredictTabView` with dynamic tab index and `isVisible` handling based on `selectPredictEnabledFlag`. > - **Perps visibility**: Keeps callback-driven visibility; updates tab index interactions alongside Predict. > - **Enablement logic**: > - `isPredictEnabled` no longer gated by EVM selection (depends only on flag). > - `collectiblesEnabled` simplified to use `isEvmSelected` when a single network is enabled. > - `defiEnabled` now strictly requires `isEvmSelected` (removes multichain state 2 allowance). > - **Tabs rendering**: Dynamic tabs array and key updated to include Predict and reflect visibility changes. > - **Tests (`app/components/Views/Wallet/index.test.tsx`)**: > - Add mocks for `PredictTabView` and `selectPredictEnabledFlag`. > - New Predict visibility suite covering enabled/disabled states and index calc with/without Perps. > - Update Perps tests and setup to coexist with Predict flag/state. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d99afa6. 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** Disables the Android perps tests due to flakiness and fixes the Card unit tests coming from #22394 <!-- 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 the Android Perps smoke workflow and skips flaky Perps add-funds and Card OTP error-handling tests. > > - **CI/Workflows**: > - Comment out `perps-android-smoke` job in `.github/workflows/run-e2e-smoke-tests-android.yml` and remove it from `report-android-smoke-tests.needs`. > - **Tests**: > - In `app/components/UI/Card/Views/CardAuthentication/CardAuthentication.test.tsx`: > - Skip `describe('OTP Step - Error Handling')` via `describe.skip`. > - Minor test adjustments to set OTP error mock before render and inline assertions. > - In `e2e/specs/perps/perps-add-funds.spec.ts`: > - Mark the add-funds test as `it.skip`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0fa40ec. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- 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>
## **Description** Use asset picker from send flow in MetaMask Pay. Also display disabled entries in token list, including associated message. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: [#6174](MetaMask/MetaMask-planning#6174) ## **Manual testing steps** ## **Screenshots/Recordings** ### **Before** ### **After** <img width="300" alt="Asset Picker" src="https://github.com/user-attachments/assets/dffb1e98-32c5-43f7-afd7-8bfadbff07e6" /> ## **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 the Pay With modal’s token selector with the Send flow’s Asset picker, adds disabled-token handling/no-gas messaging, drops the network selector modal, and updates hooks/types/tests accordingly. > > - **UI/UX**: > - **PayWithModal**: Refactored to BottomSheet using `send/asset` picker; filters to EVM `ERC20` tokens, shows zero-balance tokens if required/selected, and disables tokens lacking native gas with `pay_with_modal.no_gas` message. > - **Token**: Supports `disabled` state (press disabled, opacity) and optional `disabledMessage` display. > - **Asset/TokenList**: New props `hideNfts`, `includeNoBalance`, `onTokenSelect`, `tokenFilter`; adaptive search placeholder; NFT section hidden when `hideNfts`. > - **Navigation**: > - Removed `Routes.CONFIRMATION_PAY_WITH_NETWORK_MODAL` screen and references. > - **Data/Hooks/Types**: > - `useAccountTokens` accepts `{ includeNoBalance }` to optionally include zero-balance assets. > - Added `disabled`/`disabledMessage` to `AssetType`. > - Removed `useTransactionPayAvailableTokens` hook and its tests. > - **Localization**: > - Added strings: `send.search_tokens`, `pay_with_modal.no_gas`. > - **Tests**: > - Added/updated tests for PayWithModal filtering/selection, token disabled behavior, Asset/TokenList props and behavior; removed obsolete network modal and available-tokens tests. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c264c90. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## **Description**
PR to add search tokens hook for the new trending epic.
## **Changelog**
CHANGELOG entry: No functionality changes expected
## **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]
> Adds a debounced token search hook and refactors the trending hook to
expose results/loading/error with improved debounce and race handling,
plus comprehensive tests.
>
> - **Hooks**:
> - **`app/components/UI/Assets/hooks/useSearchRequest` (new)**:
> - Debounced `searchTokens` request with memoized options and request
ID to avoid stale updates.
> - Exposes `results`, `isLoading`, `error`, and `search` function;
auto-triggers on `query` changes.
> - Comprehensive tests for success, error, debounce coalescing, empty
query skip, and stable references.
> - **`app/components/UI/Assets/hooks/useTrendingRequest` (refactor)**:
> - Changes API to return `{ results, isLoading, error, fetch }` instead
of just a debounced function.
> - Adds request ID, improved debounce/cancel behavior, auto-fetch on
options change, and stable array memoization.
> - Expanded tests covering success, loading, error + retry, empty
`chainIds` skip, debounce coalescing, and function reference stability.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
b53c53b. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## **Description** Hide incoming transactions resulting from a predict deposit. ## **Changelog** CHANGELOG entry: null ## **Related issues** Fixes: [#6145](http://github.com/MetaMask/MetaMask-planning/issues/6145) ## **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] > Integrates bridge history into transaction filtering to hide bridge destination txs, wires selector through transaction views, and adds targeted tests. > > - **Activity filtering (`app/util/activity`)**: > - Extend `filterByAddress` and `filterByAddressAndNetwork` to accept `allTransactions` and `bridgeHistory` and exclude: > - Transactions required by others. > - Bridge destination txs whose source tx is a required dependency (match via `destChain.txHash`). > - Update internal `isFilteredByMetaMaskPay` with bridge-based exclusion. > - **Transaction views**: > - `TransactionsView` and `UnifiedTransactionsView` now select `bridgeHistory` (`selectBridgeHistoryForAccount`) and pass it into filtering (`filterByAddress*`). > - **Tests**: > - Add unit tests covering bridge destination exclusion in both `filterByAddress` and `filterByAddressAndNetwork`. > - Update view tests to mock `selectBridgeHistoryForAccount`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 112d3e0. 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**
A recent change to run detox in detached mode is currently not allowing
us to stop the tests locally as it should, leading to more hanging
services on timeout.
This PR leaves detox in `detached` mode for CI only keeping local runs
attached.
<!--
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]
> Conditionally sets Detox `testRunner.detached` to `true` only when
`CI` is set, keeping local runs attached.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
acf863a. 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** Mirror the change made to the extension where the client is only consider active when it is open and unlocked. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: null <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Updates `getIsActive` to return true only when the app is active (foreground) and the keyring is unlocked. > > - **Snaps middleware (`app/core/Snaps/SnapsMethodMiddleware.ts`)**: > - Refines `getIsActive` to check `AppState.currentState === 'active'` and `KeyringController.isUnlocked()`. > - Adds `AppState` import from `react-native`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 94f4010. 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?
-->
Manual intervention on semver version bump because release automation
failed.
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Updates Android versionName, iOS MARKETING_VERSION, and Bitrise
VERSION_NAME/FLASK_VERSION_NAME to 7.60.0.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
82841dc. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Co-authored-by: tommasini <46944231+tommasini@users.noreply.github.com>
…9.0 (#22242) ## **Description** This PR fixes 429 rate limit errors and improves Perps trading performance through two complementary changes: 1. **Dual Transport Architecture**: Separates HTTP and WebSocket transports to match their intended use cases 2. **Session-Based Caching**: Eliminates redundant API calls during user sessions ### What is the reason for the change? **Problem 1: 429 Rate Limit Errors After SDK Upgrade (TAT-1974)** HyperLiquid SDK v0.25.9 defaulted all operations to WebSocket transport, causing 429 errors during normal trading. Write operations (orders, cancellations) were exhausting WebSocket rate limits that should be reserved for real-time subscriptions. **Problem 2: Redundant API Calls (TAT-2022)** Builder fee approval, referral setup, and market metadata were called repeatedly during each session, adding unnecessary latency and rate limit pressure. ### What is the improvement/solution? **Solution 1: Dual Transport Architecture (TAT-1974)** Separated HTTP and WebSocket transports to match their intended use: - **HTTP transport**: Request/response operations (orders, queries, account data) - **WebSocket transport**: Real-time subscriptions only (price feeds, position updates) **Benefits:** - Eliminates 429 errors (separate rate limit pools) - Improved reliability (write operations don't compete with subscriptions) **Solution 2: Session-Based Caching (TAT-2022)** Moved repeated API calls to once-per-session initialization: - **Builder fee approval**: Called once during initialization instead of per-order - **Referral setup**: Non-blocking fire-and-forget pattern - **Market metadata**: Single shared cache for all operations **Benefits:** - Reduced API calls (1 vs many per session) - Lower latency (no per-order network overhead) - Improved reliability (referral failures don't block orders) ## **Changelog** CHANGELOG entry: Fixed 429 rate limit errors by separating HTTP/WebSocket transports and improved Perps trading performance through session-based caching ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/TAT-1974 Fixes: https://consensyssoftware.atlassian.net/browse/TAT-2022 ## **Manual testing steps** ```gherkin Feature: Dual transport architecture and session-based caching for Perps trading Scenario: Write operations use HTTP transport Given user opens Perps and initializes connection When user places multiple orders rapidly Then orders should complete successfully without 429 errors And WebSocket subscriptions should remain active for price updates Scenario: Session caching reduces redundant API calls Given user opens Perps and initializes connection When user places multiple orders Then builder fee approval should only be called once And referral setup should happen in background (non-blocking) And meta responses should be cached and reused When user disconnects or switches account Then caches should be cleared and reinitialized ``` ## **Screenshots/Recordings** Backend performance optimization (no UI changes). https://github.com/user-attachments/assets/6b5014e0-2c3f-41c2-b1ce-69ef4171128d Demo on iOS/Android showing functionality still works correctly. ## **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. ## **Technical Implementation Details** <details> <summary>For reviewers: Implementation overview</summary> ### Files Modified: **Transport Architecture (TAT-1974):** 1. `HyperLiquidClientService.ts` - Dual transport creation and injection 2. `HyperLiquidClientService.test.ts` - Transport configuration tests **Session-Based Caching (TAT-2022):** 3. `HyperLiquidProvider.ts` - Session cache implementation and initialization flow 4. `HyperLiquidProvider.test.ts` - Updated test expectations ### Test Coverage: - **Transport Architecture**: 32 tests passing - **Session Caching**: 244 tests passing - **Total**: 276 tests passing </details> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Splits SDK transport into HTTP (Info/Exchange) and WebSocket (Subscription), adds session-scoped caching for meta, referral, and builder-fee approval, refactors provider to use cached meta across methods, updates tests, and bumps SDK. > > - **Perps Backend (HyperLiquidProvider.ts)** > - Introduces shared `getCachedMeta()` and replaces prior market cache; used in `placeOrder`, `editOrder`, `closePositions`, `getMarkets`, `getMaxLeverage`, `getAvailableHip3Dexs`, etc. > - Adds session caches for referral and builder-fee approval; initializes once in `ensureReady()` and clears on `disconnect()`. > - Refactors market fetching API to `{ dex, skipFilters, skipCache }` and updates internal callers. > - Improves meta validation and error messaging; switches TP/SL/referral to non-blocking behavior where applicable. > - Adds HIP‑3 balance handling helpers and post-order rebalance/rollback flow (uses cached meta and session state). > - **SDK Client Service (HyperLiquidClientService.ts)** > - Implements dual transports: `HttpTransport` for `ExchangeClient`/`InfoClient`, `WebSocketTransport` for `SubscriptionClient`. > - Updates logging and disconnect to close only WebSocket transport; exposes connection state helpers. > - **Tests** > - Updates provider tests for new error messages (e.g., "Invalid meta response"), non-blocking referral, and session-cached builder-fee approval (verifies single approval across orders). > - Updates client service tests to validate dual transports, config, and disconnect behavior. > - **Dependencies** > - Bumps `@nktkas/hyperliquid` to `^0.25.9` (lockfile updated). > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit b85d046. 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>
<!--
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 reduces the amount of logs produced by the mockServer and adds a
mechanism to suppress logs for certain Urls.
<!--
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]
> Introduces a suppressed-URLs list to skip noisy logs and downgrades
several mock server logs from info to debug, while keeping server start
at info.
>
> - **E2E Mock Server Logging**
> - Adds `mock-config/suppressed-logs.ts` with `SUPPRESSED_LOGS_URLS`
(e.g., favicon) and `isUrlSuppressedFromLogs` helper.
> - Skips error logging in `handleDirectFetch` for suppressed URLs.
> - Adjusts log levels in `MockServerE2E`:
> - Server start message now `info`.
> - `testSpecificMock` and mock-response details downgraded to `debug`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
4ea286d. 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 reuses the BIP-44 designs for the notification account settings. I also took this as an opportunity to improve the style and spacing for the notification settings view. NOTE - once we support multi-SRP notifications, we will probably clean up this settings page. Potentially remove the per account notification settings (notifications will be on all accounts or no accounts) <!-- 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: refactor: cleanup notification account settings to use BIP-44 designs. ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1260 ## **Manual testing steps** 1. Open notification settings (settings > notifications) 2. See account notification styles. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <img width="429" height="481" alt="Screenshot 2025-11-07 at 14 04 54" src="https://github.com/user-attachments/assets/a7539ca6-819b-471b-92e5-6da40d7bd7d0" /> <!-- [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] > Refactors Notifications settings to use multichain account groups (BIP-44) with AccountCell UI, updates hooks to operate on account IDs/EVM addresses, and adjusts styles and tests/e2e. > > - **Notifications Settings UI (BIP-44)** > - Replace per-address UI with multichain account group UI using `AccountCell` and section header `AccountListHeader`. > - New `endContainer` support in `AccountCell` with `BalanceEndContainer` for balance/menu; used to render per-account switches. > - Updated styles (`NotificationsSettings.styles`) to add separators, spacing tweaks, and header layout. > - **Hooks/Logic** > - `useNotificationAccountListProps` now derives addresses from account IDs, normalizes EVM addresses, and exposes `getEvmAddress` plus ID-based `isAccountLoading/isAccountEnabled`. > - Add `useFirstHDWalletAccounts` and update `useAccountProps` to return `firstHDWalletGroups` + avatar type. > - **Components** > - `AccountsList` now lists `firstHDWalletGroups.data`, renders `NotificationOptionToggle` with group item and computed EVM address, and shows a section header. > - `NotificationOptionToggle` composes `AccountCell` and renders loading/switch via `endContainer`. > - `AccountListHeader` accepts optional `containerStyle`. > - **Tests/E2E** > - Update unit tests to new account-group model and ID-based APIs; refresh snapshots. > - E2E: add separator test ID and swipe interactions; update selectors and flow. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0e45afd. 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** Updated assets-controllers to version ^87.1.1 <!-- 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: updated assets-controllers to version ^87.1.1 ## **Related issues** Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-1425 ## **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] > Bumps @metamask/assets-controllers to ^87.1.1 and guards `selectMultichainAssetsAllIgnoredAssets` to default to an empty object. > > - **Selectors**: > - `app/selectors/multichain/multichain.ts`: `selectMultichainAssetsAllIgnoredAssets` now defaults `allIgnoredAssets` to `{}` when nullish. > - **Dependencies**: > - Upgrade `@metamask/assets-controllers` from `^87.1.0` to `^87.1.1` in `package.json`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 055404d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Bruno Nascimento <bruno.nascimento@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?
-->
Use metamask enviornment variable instead of node_env to view feature
override dashboard
## **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 navigates to Feature Flag Override Dashboard in settings
Given the metamask eviornment is not production
When user navigates to settings
Then they will see and navigate to the Feature Flag Override Dashboard
```
## **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]
> Switches visibility gating from NODE_ENV to METAMASK_ENVIRONMENT for
Feature Flag Override screens and adds tests; also memoizes feature flag
context helpers.
>
> - **Navigation & Settings**
> - Replace `process.env.NODE_ENV !== 'production'` with
`process.env.METAMASK_ENVIRONMENT !== 'production'` to conditionally
show `Routes.FEATURE_FLAG_OVERRIDE` in `MainNavigator` and the Feature
Flag Override drawer in `Views/Settings`.
> - **Tests**
> - Update `MainNavigator.test.tsx` and `Views/Settings/index.test.tsx`
to use `METAMASK_ENVIRONMENT`, including setup/teardown of env var and
assertions that Feature Flag Override is present in non-production.
> - **Feature Flag Context**
> - Memoize `featureFlagsList`, `getFeatureFlag`, and the provided
context value via `useMemo/useCallback`.
> - Use `process.env.METAMASK_ENVIRONMENT` in minimum version
validation.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
1ab6560. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
…l screens (#22286) <!-- 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** Updated currency switch clicked event for deposit and withdrawal screens ### Changes: - Removed code fence blocking `EARN_INPUT_CURRENCY_SWITCH_CLICKED` event for pooled-staking - Added `token_symbol` and `chain_id_hex` properties to `EARN_INPUT_CURRENCY_SWITCH_CLICKED`, `EARN_INPUT_CURRENCY_SWITCH_CLICKED`, and `UNSTAKE_INPUT_CURRENCY_SWITCH_CLICKED` events <!-- 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: updated earn input view deposit and withdrawal currency switch events ## **Related issues** Fixes: [TAT-1909: Add "Stake Input Currency Switch Clicked" to MP Segment events](https://consensyssoftware.atlassian.net/browse/TAT-1909) ## **Manual testing steps** ```gherkin Feature: Event tracking for Earn input view currency switch button Scenario: user wants to enter fiat amount Given user is on EarnInputView (e.g. ETH staking or stablecoin lending) When user clicks currency switch Then currency switch event is tracked with new `token_symbol` and `chain_id_hex` properties for both ETH staking and stablecoin lending tokens. ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> Pooled-Staking currency switch events weren't firing ### **After** <!-- [screenshots/recordings] --> https://github.com/user-attachments/assets/4b13b5bb-113e-4c9b-b18a-75375e5fcbcb ## **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). - [ ] 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. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Always log currency-switch on deposit and add token_symbol and chain_id (hex) to deposit and withdrawal currency-switch events. > > - **Analytics**: > - **Deposit (`EarnInputView.tsx`)**: > - Always log `EARN_INPUT_CURRENCY_SWITCH_CLICKED` on currency toggle (removes prior gating). > - Add `token_symbol` and `chain_id` (hex) to event properties. > - **Withdrawal (`EarnWithdrawInputView.tsx`)**: > - Add `token_symbol` and `chain_id` (hex) to `EARN_INPUT_CURRENCY_SWITCH_CLICKED` and `UNSTAKE_INPUT_CURRENCY_SWITCH_CLICKED`. > - Import `toHex` for chain ID formatting. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 803d2e2. 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** Upgrading bitcoin to 1.4.5 * https://github.com/MetaMask/snap-bitcoin-wallet/releases/tag/v1.4.5 <!-- 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: MetaMask/metamask-extension#37616 ## **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] > Update dependency `@metamask/bitcoin-wallet-snap` from `^1.4.4` to `^1.4.5` in `package.json` and `yarn.lock`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fecd794. 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** 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 -->
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 : )