-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
chore: upgrade multichain-networks-controllers-v0.5.1 WIP #14348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
vinnyhoward
wants to merge
9
commits into
main
Choose a base branch
from
feat-4469-networks-with-activity
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+93
−12
Conversation
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
…m the multichain networks controller and added the relevant state updates for mocks/fixtures
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
4 tasks
…4469-networks-with-activity
…4469-networks-with-activity
brianacnguyen
previously approved these changes
Apr 4, 2025
vinnyhoward
added a commit
to MetaMask/core
that referenced
this pull request
Apr 16, 2025
## Explanation Currently, our client manually adds networks and checks user activity one network at a time. This is inefficient and doesn't scale well. This PR introduces a more efficient approach by: 1. Adding a new API integration that fetches active networks for multiple accounts in a single request 2. Managing network activity state through the controller 3. Adding type-safe methods to handle both EVM and non-EVM accounts 4. Extracting network fetching logic into a dedicated service layer Key additions: - `getNetworksWithTransactionActivityByAccounts`: Fetches active networks for accounts - `MultichainNetworkService`: New service layer handling network activity fetching - Enhanced state management for network configurations and activity - Improved error handling and fallback mechanisms The new implementation: - Reduces API calls through batch fetching - Improves separation of concerns with dedicated service layer - Enhances type safety and error handling - Provides better state management with fallbacks PRs for Client Integration [Extension](MetaMask/metamask-extension#31414) [Mobile](MetaMask/metamask-mobile#14348) ## References Related to [#4469 ](MetaMask/MetaMask-planning#4469) ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/multichain-network-controller` - **ADDED**: New method `getNetworksWithTransactionActivityByAccounts` to fetch active networks for accounts - **ADDED**: New `MultichainNetworkServiceController` for handling network activity fetching - **ADDED**: New types for network activity state and responses - **CHANGED**: Enhanced error handling for network requests - **CHANGED**: Improved type safety for messenger actions - **CHANGED**: Updated state management for network activity ## 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 highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes --------- Co-authored-by: Charly Chevalier <[email protected]>
…4469-networks-with-activity
…k service and update relevant tests
salimtb
pushed a commit
to MetaMask/core
that referenced
this pull request
Apr 23, 2025
## Explanation Currently, our client manually adds networks and checks user activity one network at a time. This is inefficient and doesn't scale well. This PR introduces a more efficient approach by: 1. Adding a new API integration that fetches active networks for multiple accounts in a single request 2. Managing network activity state through the controller 3. Adding type-safe methods to handle both EVM and non-EVM accounts 4. Extracting network fetching logic into a dedicated service layer Key additions: - `getNetworksWithTransactionActivityByAccounts`: Fetches active networks for accounts - `MultichainNetworkService`: New service layer handling network activity fetching - Enhanced state management for network configurations and activity - Improved error handling and fallback mechanisms The new implementation: - Reduces API calls through batch fetching - Improves separation of concerns with dedicated service layer - Enhances type safety and error handling - Provides better state management with fallbacks PRs for Client Integration [Extension](MetaMask/metamask-extension#31414) [Mobile](MetaMask/metamask-mobile#14348) ## References Related to [#4469 ](MetaMask/MetaMask-planning#4469) ## Changelog <!-- If you're making any consumer-facing changes, list those changes here as if you were updating a changelog, using the template below as a guide. (CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or FIXED. For security-related issues, follow the Security Advisory process.) Please take care to name the exact pieces of the API you've added or changed (e.g. types, interfaces, functions, or methods). If there are any breaking changes, make sure to offer a solution for consumers to follow once they upgrade to the changes. Finally, if you're only making changes to development scripts or tests, you may replace the template below with "None". --> ### `@metamask/multichain-network-controller` - **ADDED**: New method `getNetworksWithTransactionActivityByAccounts` to fetch active networks for accounts - **ADDED**: New `MultichainNetworkServiceController` for handling network activity fetching - **ADDED**: New types for network activity state and responses - **CHANGED**: Enhanced error handling for network requests - **CHANGED**: Improved type safety for messenger actions - **CHANGED**: Updated state management for network activity ## 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 highlighted breaking changes using the "BREAKING" category above as appropriate - [x] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes --------- Co-authored-by: Charly Chevalier <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Important: This integration is dependent on this PR and a multichain network controller update
This PR updates the multichain network controller to implement the new
getNetworksWithActivityByAccounts
method from our core library and adds the necessary state management.Related issues
Related to #4469
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist