You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The TokenDetectionController will always use the token list for the current globally selected network, even when detecting tokens on a different network. Effectively it won't work when polling non-selected networks.
We should update the controller to use the token list for the network we're detecting tokens on.
The text was updated successfully, but these errors were encountered:
…assed networkClientId (#3914)
## Explanation
Currently, `detectTokens()` always uses the state for the globally
selected network from the `TokenListController` and `TokensController`
regardless of if/what networkClientId is passed in.
This PR updates `detectTokens()` to use the chainId keyed states of the
`TokenListController` and `TokensController` instead.
## References
Fixes: #3905
## Changelog
### `@metamask/assets-controllers`
- **FIXED**: `TokenDetectionController.detectTokens()` now reads the
chainId keyed state properties from `TokenListController` and
`TokensController` rather than incorrectly using the globally selected
state properties when networkClientId is passed
## 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
---------
Co-authored-by: Alex Donesky <[email protected]>
Co-authored-by: Jongsun Suh <[email protected]>
The TokenDetectionController will always use the token list for the current globally selected network, even when detecting tokens on a different network. Effectively it won't work when polling non-selected networks.
We should update the controller to use the token list for the network we're detecting tokens on.
The text was updated successfully, but these errors were encountered: