Commit f16ddbe
chore: explicitly pass networkClientId for nftController (#5622)
## Explanation
This PR is part of a larger effort to remove the global network
selector.
On this PR:
* Removal of this.#chainId on the nftController
* Removal of chainId from nftController constructor
* Making the optional networkClientId in all functions a mandatory field
UI integration:
- extension: MetaMask/metamask-extension#31917
<!--
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
* Fixes #5581
<!--
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
-->
## Changelog
<!--
THIS SECTION IS NO LONGER NEEDED.
The process for updating changelogs has changed. Please consult the
"Updating changelogs" section of the Contributing doc for more.
-->
### `@metamask/assets-controllers`
- **UPDATE:** Updated `NftController` and `NftDetectionController` to
eliminate the dependency on the current chain. All functions that
previously accepted networkClientId as an optional parameter now require
it as a mandatory parameter
## 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
---------
Co-authored-by: salimtb <[email protected]>1 parent d8bd629 commit f16ddbe
File tree
7 files changed
+1062
-615
lines changed- packages
- assets-controllers
- src
- network-controller/tests
7 files changed
+1062
-615
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
44 | | - | |
45 | | - | |
| 43 | + | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
| |||
0 commit comments