feat: add portfolio discover page url in network configuration #5429
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.
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:
The MM extension uses the NetworkConfiguration to store the network's properties in the store, there is a need for the extension to retrieve the new MM portfolio ecosystem page URL that will go live soon. There will be one page dedicated by network following this route format: https://portfolio.metamask.io/explore/networks/{networkName}
This solution makes it possible to configure the page's url for a network, it's also optional as there won't be a page for every network.
No
I had to update the network-controller package for the configuration type itself but also the multichain-network-controller to change the function
toMultichainNetworkConfiguration
as this configuration can be applied to non EVM chains as well.No dependency upgrade
References
Are there any issues that this pull request is tied to? No
Are there other links that reviewers should consult to understand these changes better?
Yes this is the PR that being currently worked on to add the ecosystem page in Portfolio: https://github.com/consensys-vertical-apps/metamask-portfolio/pull/1534
Are there client or consumer pull requests to adopt any breaking changes?
No breaking changes but the MM extension will consume this change: MetaMask/metamask-extension#30777
For example:
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/network-controller
portfolioDiscoverUrl
a new optional property for theNetworkConfiguration
type@metamask/multichain-network-controller
portfolioDiscoverUrl
a new optional property for theCommonNetworkConfiguration
typetoMultichainNetworkConfiguration
function to take into account the new propertyportfolioDiscoverUrl
Checklist