Conversation
|
@metamaskbot publish-previews |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
a7ae91d to
f57ddeb
Compare
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
| AccountTreeControllerStateChangeEvent, | ||
| } from '@metamask/account-tree-controller'; | ||
| import type { AccountsControllerGetSelectedAccountAction } from '@metamask/accounts-controller'; | ||
| import { SPOT_PRICES_SUPPORT_INFO } from '@metamask/assets-controllers'; |
There was a problem hiding this comment.
hmmm do we need to release first the assets-controllers and bump it inside this package ?
There was a problem hiding this comment.
Can be done at the same time when we release. It's a minor release for both packages as there are no breaking changes.
b23b2a4
2ba0a4e to
6a3d9ce
Compare
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
Explanation
The code for the new controller currently considers that only assets in the slip44 namespace are native. This limits support for prices on many chains supported by price-api. With this changes, we create a centralised way of determining if an asset is native, as well as support chains for which price-api does not yet support the slip44 entry or for which there is none.
Not doing this would cause a regression when the new controller is updated.
With AssetsController enabled without this changes, we are missing support for chains that already had support before. Mostly due to using a wrong default instead of a specific assetId.

References
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-2885
Checklist
Note
Medium Risk
Touches native-asset identification used by balance fetching, token metadata filtering, and bridge/transaction-pay formatting, so misclassification could impact displayed balances/prices across chains. Changes are well-covered by updated and new unit tests, reducing but not eliminating regression risk.
Overview
Fixes native-asset detection by introducing a cached chainId→native-asset map (seeded from
SPOT_PRICES_SUPPORT_INFOand optionally augmented viachainid.network) and using it throughoutAssetsControllerand data sources instead of relying onslip44:namespace checks.Updates EVM balance/price/token flows to treat native assets consistently even when represented as ERC-20 (e.g., zero-address forms), including passing native-asset resolvers into
RpcDataSource,BalanceFetcher, andBackendWebsocketDataSource, and updatingformatExchangeRatesForBridge/formatStateForTransactionPayto derive native handling fromassetsInfoandgetNativeTokenAddress.Reviewed by Cursor Bugbot for commit af2c9f6. Bugbot is set up for automated code reviews on this repo. Configure here.