This repository was archived by the owner on Mar 20, 2026. It is now read-only.
Commit eb253bd
authored
feat: allow using a chainId or networkClientId to fetch top assets (#403)
## 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?
-->
This PR allows passing in either a `chainId` or a `networkClientId` to
`fetchTopAssets`. Previously only `networkClientId` was allowed.
This is to support the case of Bridge where a user could select a
destination chain that they have not added to MM yet, there by not
having a `networkClientId` to provide. The user will have a destination
`chainId` that we want to look up top assets on.
## 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
-->
Related to MetaMask/metamask-mobile#14258
## 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/swaps-controller`
- CHANGED: Allow passing in either a `chainId` or a `networkClientId` to
`fetchTopAssets`. Previously only `networkClientId` was allowed.
## 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 changes1 parent 41df7ae commit eb253bd
2 files changed
+80
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2520 | 2520 | | |
2521 | 2521 | | |
2522 | 2522 | | |
| 2523 | + | |
| 2524 | + | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
2523 | 2584 | | |
2524 | 2585 | | |
2525 | 2586 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1013 | 1013 | | |
1014 | 1014 | | |
1015 | 1015 | | |
1016 | | - | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1017 | 1019 | | |
1018 | 1020 | | |
1019 | 1021 | | |
| 1022 | + | |
1020 | 1023 | | |
1021 | | - | |
| 1024 | + | |
| 1025 | + | |
1022 | 1026 | | |
1023 | | - | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1024 | 1035 | | |
1025 | | - | |
| 1036 | + | |
1026 | 1037 | | |
1027 | 1038 | | |
1028 | 1039 | | |
1029 | 1040 | | |
1030 | 1041 | | |
1031 | 1042 | | |
1032 | | - | |
| 1043 | + | |
1033 | 1044 | | |
1034 | 1045 | | |
1035 | 1046 | | |
1036 | 1047 | | |
1037 | 1048 | | |
1038 | 1049 | | |
1039 | 1050 | | |
1040 | | - | |
| 1051 | + | |
1041 | 1052 | | |
1042 | 1053 | | |
1043 | 1054 | | |
| |||
1046 | 1057 | | |
1047 | 1058 | | |
1048 | 1059 | | |
1049 | | - | |
| 1060 | + | |
1050 | 1061 | | |
1051 | 1062 | | |
1052 | 1063 | | |
| |||
1055 | 1066 | | |
1056 | 1067 | | |
1057 | 1068 | | |
1058 | | - | |
| 1069 | + | |
1059 | 1070 | | |
1060 | 1071 | | |
1061 | 1072 | | |
| |||
0 commit comments