Repository navigation
[pull] main from MetaMask:main - #231
Merged
Merged
Conversation
## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> Updates logic of `getBridgeERC20Allowance` method to use `chainId` parameter to retrieve the `networkClient`. ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > `getBridgeERC20Allowance` now finds the network client via `chainId` instead of the globally selected network, with new error handling and tests, and changelog updated. > > - **Bridge Controller**: > - Use `#getNetworkClientByChainId(chainId)` to resolve network client in `getBridgeERC20Allowance`, calling `NetworkController:findNetworkClientIdByChainId` then `NetworkController:getNetworkClientById`. > - Add error handling: throw when no network client for `chainId` or when no provider. > - **Tests**: > - Update `getBridgeERC20Allowance` tests to assert network client lookup by `chainId` and new error cases. > - **Changelog**: > - Note fix for removing global selected network reference in `getBridgeERC20Allowance`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2239728. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Micaela Estabillo <micaela.estabillo@consensys.net> Co-authored-by: Micaela <100321200+micaelae@users.noreply.github.com>
## Explanation The feature to hide tokens is available for EVM assets but not for non-EVM assets. This task involves implementing a similar token hiding feature for non-EVM assets. This is crucial for improving user experience by allowing users to hide unwanted tokens, especially in light of spam and malicious token issues. The implementation should be prioritized to align with upcoming Solana campaigns. NOTE: - Changes are needed on Mobile and extension to support this <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References https://consensyssoftware.atlassian.net/browse/ASSETS-1425 <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Introduces `allIgnoredAssets` with `ignoreAssets` action to hide non‑EVM assets per account and updates detection, selectors, and balance calculations to exclude ignored assets, including cleanup on account removal. > > - **MultichainAssetsController**: > - Add `allIgnoredAssets` to state and expose `ignoreAssets` action; register handler. > - Filter ignored assets in `accountAssetListUpdated` flow; remove ignored and active assets on account removal. > - Keep `assetsMetadata` handling unchanged; add metadata/state exposure for UI/persist. > - **Balances**: > - Update `calculateBalanceForAllWallets`, `calculateBalanceChangeForAllWallets`, and `calculateBalanceChangeForAccountGroup` signatures to accept `MultichainAssetsController` state. > - Exclude ignored non‑EVM assets from totals and change calculations. > - **Selectors** (`token-selectors.ts`): > - Include `allIgnoredAssets` in selector state; exclude ignored multichain assets from returned asset lists. > - **Tests**: > - Add coverage for ignoring/filtering assets, detection behavior, and cleanup on account removal; adjust balance tests to pass new controller state. > - **Changelog**: > - Note addition of `ignoreAssets` for non‑EVM chains. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit f79eece. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation Releases bridge-controller @56.0.2 <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Bumps monorepo to 648.0.0 and releases @metamask/bridge-controller 56.0.2 with a fix, updating dependent packages accordingly. > > - **Release** > - Bump monorepo `version` to `648.0.0`. > - **@metamask/bridge-controller 56.0.2** > - Add changelog entry and update comparison links. > - Fix: remove global selected network reference in `getBridgeERC20Allowance` handler. > - **Dependencies** > - Update `@metamask/bridge-status-controller` devDependency to `@metamask/bridge-controller@^56.0.2`. > - Update `yarn.lock` to reflect new versions. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 8acc9bf. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation This PR adds support for five additional networks to MetaMask Core's Infura network types: Arbitrum, BSC (Binance Smart Chain), Optimism, Polygon, and Sei. These networks are now available as built-in Infura networks across the MetaMask ecosystem. ### Changes Made: **Core Network Definitions (`@metamask/controller-utils`):** - Added network identifiers to `InfuraNetworkType` and `BUILT_IN_NETWORKS` - Updated `BuiltInNetworkName` enum with new entries - Added chain IDs: Arbitrum (0xa4b1), BSC (0x38), Optimism (0xa), Polygon (0x89), Sei (0x531) - Added network tickers: ETG, BNB, ETH, POL, SEI - Added block explorer URLs and network nicknames **Token Detection Support (`@metamask/assets-controllers`):** - Extended `TokenDetectionController` to support token tracking on these networks - Users can now automatically detect tokens on these additional chains **Network Controller (`@metamask/network-controller`):** - Added these networks to the default Infura network configurations - Networks are now available as first-class network options **Network Enablement (`@metamask/network-enablement-controller`):** - These networks are included in the popular networks list - Will be enabled when users call `enableAllPopularNetworks()` ### Impact: This change expands MetaMask's multi-chain capabilities by making these popular L1 and L2 networks available as built-in options, improving the user experience for accessing DeFi and Web3 applications across these ecosystems. ## References Related to the initiative to expand MetaMask's multi-chain support and provide better out-of-the-box network coverage for users. ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Add Arbitrum, BSC, Optimism, Polygon, and Sei as built-in Infura networks and update related constants, configs, and tests across packages. > > - **Networks (controller-utils)**: > - Extend `BUILT_IN_NETWORKS`, `InfuraNetworkType`, `BuiltInNetworkName`, `ChainId`, `NetworksTicker`, `BlockExplorerUrl`, and `NetworkNickname` with Arbitrum, BSC, Optimism, Polygon, and Sei (chain IDs: `0xa4b1`, `0x38`, `0xa`, `0x89`, `0x531`). > - Update `CHANGELOG.md` documenting the additions. > - **Network Controller**: > - Add default Infura configurations and client registry entries for the new networks (URLs, names, native currencies). > - Update tests to assert presence of these networks and endpoints. > - **Assets Controllers**: > - Update `TokenDetectionController` tests to include the new networks in the token detection chain ID set. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit fea7391. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
…er (#6996) ## Explanation <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Removes all selectedNetworkClientId references, deriving network clients via srcChainId, refactors metrics request params, and updates tests/snapshots accordingly. > > - **Bridge Controller**: > - Remove selected network usage: delete `#getSelectedNetworkClientId`/`#getSelectedNetworkClient`; resolve clients via `NetworkController:findNetworkClientIdByChainId` in `#getNetworkClientByChainId`. > - Use srcChainId-derived client for balance checks and provider config; treat non‑EVM src chains accordingly. > - Simplify polling input: drop `networkClientId` from `BridgePollingInput` and `startPolling` calls. > - **Metrics**: > - Refactor `getRequestParams` to take only `quoteRequest` (no external srcChainId param) with ETH fallback; update all event builders to use new signature. > - **Types**: > - Remove `NetworkController:getState` from allowed actions and `NetworkClientId` import/usages. > - **Tests/Snapshots**: > - Update mocks and expectations to remove `selectedNetworkClientId`; adjust call counts and snapshots; ensure network lookup by chainId. > - **Changelog**: > - Add Fixed note documenting removal of `selectedNetworkClientId` usages. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 131d042. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
## Explanation Releases the bridge-controller <!-- Thanks for your contribution! Take a moment to answer these questions so that reviewers have the information they need to properly understand your changes: * What is the current state of things and why does it need to change? * What is the solution your changes offer and how does it work? * Are there any changes whose purpose might not obvious to those unfamiliar with the domain? * If your primary goal was to update one package but you found you had to update another one along the way, why did you do so? * If you had to upgrade a dependency, why did you do so? --> ## References <!-- Are there any issues that this pull request is tied to? Are there other links that reviewers should consult to understand these changes better? Are there client or consumer pull requests to adopt any breaking changes? For example: * Fixes #12345 * Related to #67890 --> ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've communicated my changes to consumers by [updating changelogs for packages I've changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs), highlighting breaking changes as necessary - [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Publish monorepo 649.0.0, releasing bridge-controller 56.0.3 with a fix replacing selectedNetworkClientId usage and updating dependents. > > - **Release** > - Bump monorepo version to `649.0.0`. > - **Bridge Controller (`packages/bridge-controller`)** > - Version bump to `56.0.3`. > - Fix: replace `selectedNetworkClientId` usage by resolving network clients via `srcChainId`. > - Update `CHANGELOG.md` and comparison links. > - **Bridge Status Controller** > - Update devDependency `@metamask/bridge-controller` to `^56.0.3`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit a9ebab0. 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 : )