Skip to content

Commit 15271e4

Browse files
authored
chore: bump assets controllers to v93 (#38521)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** bump assets controllers to v93 <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/38521?quickstart=1) ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: bump assets controllers to v93 ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Extension Coding Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Upgrade assets-controllers to v93, adjust token price service behavior, add selected EVM account change event to token balances messenger, and update related snapshots. > > - **Dependencies** > - Bump `@metamask/assets-controllers` to `93.0.0`. > - **Token Prices Service (patched)** > - Set numerous `SPOT_PRICES_SUPPORT_INFO` chain mappings to `null`. > - Use decimal chain ID in `/spot-prices` URL (`parseInt(chainId, 16)`). > - **Token Balances Controller Messenger** > - Listen for `AccountsController:selectedEvmAccountChange` events. > - **Tests** > - Update ETH rate precision in state snapshot fixtures. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 61cb37e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent e66d9a7 commit 15271e4

File tree

6 files changed

+106
-21
lines changed

6 files changed

+106
-21
lines changed

app/scripts/controller-init/messengers/token-balances-controller-messenger.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { AuthenticationController } from '@metamask/profile-sync-controller';
1212
import {
1313
AccountsControllerGetSelectedAccountAction,
1414
AccountsControllerListAccountsAction,
15+
AccountsControllerSelectedEvmAccountChangeEvent,
1516
} from '@metamask/accounts-controller';
1617
import {
1718
AccountTrackerUpdateNativeBalancesAction,
@@ -62,7 +63,8 @@ type AllowedEvents =
6263
| PreferencesControllerStateChangeEvent
6364
| TokensControllerStateChangeEvent
6465
| AccountActivityServiceStatusChangedEvent
65-
| AccountActivityServiceBalanceUpdatedEvent;
66+
| AccountActivityServiceBalanceUpdatedEvent
67+
| AccountsControllerSelectedEvmAccountChangeEvent;
6668

6769
export type TokenBalancesControllerMessenger = ReturnType<
6870
typeof getTokenBalancesControllerMessenger
@@ -109,6 +111,7 @@ export function getTokenBalancesControllerMessenger(
109111
'KeyringController:accountRemoved',
110112
'AccountActivityService:statusChanged',
111113
'AccountActivityService:balanceUpdated',
114+
'AccountsController:selectedEvmAccountChange',
112115
],
113116
});
114117
return controllerMessenger;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
"@metamask/address-book-controller": "^7.0.0",
275275
"@metamask/announcement-controller": "^8.0.0",
276276
"@metamask/approval-controller": "^8.0.0",
277-
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A92.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-92.0.0-ea998cb0bd.patch",
277+
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A93.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-93.0.0-ea998cb0bd.patch",
278278
"@metamask/base-controller": "^9.0.0",
279279
"@metamask/bitcoin-wallet-snap": "^1.8.0",
280280
"@metamask/bridge-controller": "patch:@metamask/bridge-controller@npm%3A61.0.0#~/.yarn/patches/@metamask-bridge-controller-npm-61.0.0-8c413c463f.patch",

test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-background-state.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@
113113
"currencyRates": {
114114
"ETH": {
115115
"conversionDate": "number",
116-
"conversionRate": 1700,
117-
"usdConversionRate": 1700
116+
"conversionRate": 1700.0000000000002,
117+
"usdConversionRate": 1700.0000000000002
118118
},
119119
"MON": {
120120
"conversionDate": "number",

test/e2e/tests/metrics/state-snapshots/errors-after-init-opt-in-ui-state.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@
122122
"currencyRates": {
123123
"ETH": {
124124
"conversionDate": "number",
125-
"conversionRate": 1700,
126-
"usdConversionRate": 1700
125+
"conversionRate": 1700.0000000000002,
126+
"usdConversionRate": 1700.0000000000002
127127
},
128128
"MON": {
129129
"conversionDate": "number",

yarn.lock

Lines changed: 97 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5684,9 +5684,9 @@ __metadata:
56845684
languageName: node
56855685
linkType: hard
56865686

5687-
"@metamask/assets-controllers@npm:92.0.0, @metamask/assets-controllers@npm:^92.0.0":
5688-
version: 92.0.0
5689-
resolution: "@metamask/assets-controllers@npm:92.0.0"
5687+
"@metamask/assets-controllers@npm:93.0.0":
5688+
version: 93.0.0
5689+
resolution: "@metamask/assets-controllers@npm:93.0.0"
56905690
dependencies:
56915691
"@ethereumjs/util": "npm:^9.1.0"
56925692
"@ethersproject/abi": "npm:^5.7.0"
@@ -5708,7 +5708,7 @@ __metadata:
57085708
"@metamask/messenger": "npm:^0.3.0"
57095709
"@metamask/metamask-eth-abis": "npm:^3.1.1"
57105710
"@metamask/multichain-account-service": "npm:^4.0.0"
5711-
"@metamask/network-controller": "npm:^26.0.0"
5711+
"@metamask/network-controller": "npm:^27.0.0"
57125712
"@metamask/permission-controller": "npm:^12.1.1"
57135713
"@metamask/phishing-controller": "npm:^16.1.0"
57145714
"@metamask/polling-controller": "npm:^16.0.0"
@@ -5718,7 +5718,7 @@ __metadata:
57185718
"@metamask/snaps-controllers": "npm:^14.0.1"
57195719
"@metamask/snaps-sdk": "npm:^9.0.0"
57205720
"@metamask/snaps-utils": "npm:^11.0.0"
5721-
"@metamask/transaction-controller": "npm:^62.3.0"
5721+
"@metamask/transaction-controller": "npm:^62.4.0"
57225722
"@metamask/utils": "npm:^11.8.1"
57235723
"@types/bn.js": "npm:^5.1.5"
57245724
"@types/uuid": "npm:^8.3.0"
@@ -5734,7 +5734,7 @@ __metadata:
57345734
peerDependencies:
57355735
"@metamask/providers": ^22.0.0
57365736
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
5737-
checksum: 10/fa6d43e9397654ed504f76d19f74a343bf937171dcf639cf203a6135d7e7e31617ff98d302283d3cabcb2d39767632cbad5717580bb40fcd63e2aa0f948d6bb4
5737+
checksum: 10/35b4294bacc2a2123d99af181c2482674386f21d89ae102934573810101ba97b71e5ff5a24038a09f3dd8ad07d12b5cabe7a29c9aa04bdd5847a83284240d217
57385738
languageName: node
57395739
linkType: hard
57405740

@@ -5790,9 +5790,9 @@ __metadata:
57905790
languageName: node
57915791
linkType: hard
57925792

5793-
"@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A92.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-92.0.0-ea998cb0bd.patch":
5793+
"@metamask/assets-controllers@npm:^92.0.0":
57945794
version: 92.0.0
5795-
resolution: "@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A92.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-92.0.0-ea998cb0bd.patch::version=92.0.0&hash=224a2c"
5795+
resolution: "@metamask/assets-controllers@npm:92.0.0"
57965796
dependencies:
57975797
"@ethereumjs/util": "npm:^9.1.0"
57985798
"@ethersproject/abi": "npm:^5.7.0"
@@ -5840,7 +5840,61 @@ __metadata:
58405840
peerDependencies:
58415841
"@metamask/providers": ^22.0.0
58425842
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
5843-
checksum: 10/ef92c6489322775f0a654dca5b23a792587c71218ef85ef442c4a008fae519c553bb33e885373348ca574343fe72824b63f104f21b3c0f661c0df86993ae8815
5843+
checksum: 10/fa6d43e9397654ed504f76d19f74a343bf937171dcf639cf203a6135d7e7e31617ff98d302283d3cabcb2d39767632cbad5717580bb40fcd63e2aa0f948d6bb4
5844+
languageName: node
5845+
linkType: hard
5846+
5847+
"@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A93.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-93.0.0-ea998cb0bd.patch":
5848+
version: 93.0.0
5849+
resolution: "@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A93.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-93.0.0-ea998cb0bd.patch::version=93.0.0&hash=224a2c"
5850+
dependencies:
5851+
"@ethereumjs/util": "npm:^9.1.0"
5852+
"@ethersproject/abi": "npm:^5.7.0"
5853+
"@ethersproject/address": "npm:^5.7.0"
5854+
"@ethersproject/bignumber": "npm:^5.7.0"
5855+
"@ethersproject/contracts": "npm:^5.7.0"
5856+
"@ethersproject/providers": "npm:^5.7.0"
5857+
"@metamask/abi-utils": "npm:^2.0.3"
5858+
"@metamask/account-tree-controller": "npm:^4.0.0"
5859+
"@metamask/accounts-controller": "npm:^35.0.0"
5860+
"@metamask/approval-controller": "npm:^8.0.0"
5861+
"@metamask/base-controller": "npm:^9.0.0"
5862+
"@metamask/contract-metadata": "npm:^2.4.0"
5863+
"@metamask/controller-utils": "npm:^11.16.0"
5864+
"@metamask/core-backend": "npm:^5.0.0"
5865+
"@metamask/eth-query": "npm:^4.0.0"
5866+
"@metamask/keyring-api": "npm:^21.0.0"
5867+
"@metamask/keyring-controller": "npm:^25.0.0"
5868+
"@metamask/messenger": "npm:^0.3.0"
5869+
"@metamask/metamask-eth-abis": "npm:^3.1.1"
5870+
"@metamask/multichain-account-service": "npm:^4.0.0"
5871+
"@metamask/network-controller": "npm:^27.0.0"
5872+
"@metamask/permission-controller": "npm:^12.1.1"
5873+
"@metamask/phishing-controller": "npm:^16.1.0"
5874+
"@metamask/polling-controller": "npm:^16.0.0"
5875+
"@metamask/preferences-controller": "npm:^22.0.0"
5876+
"@metamask/profile-sync-controller": "npm:^27.0.0"
5877+
"@metamask/rpc-errors": "npm:^7.0.2"
5878+
"@metamask/snaps-controllers": "npm:^14.0.1"
5879+
"@metamask/snaps-sdk": "npm:^9.0.0"
5880+
"@metamask/snaps-utils": "npm:^11.0.0"
5881+
"@metamask/transaction-controller": "npm:^62.4.0"
5882+
"@metamask/utils": "npm:^11.8.1"
5883+
"@types/bn.js": "npm:^5.1.5"
5884+
"@types/uuid": "npm:^8.3.0"
5885+
async-mutex: "npm:^0.5.0"
5886+
bitcoin-address-validation: "npm:^2.2.3"
5887+
bn.js: "npm:^5.2.1"
5888+
immer: "npm:^9.0.6"
5889+
lodash: "npm:^4.17.21"
5890+
multiformats: "npm:^9.9.0"
5891+
reselect: "npm:^5.1.1"
5892+
single-call-balance-checker-abi: "npm:^1.0.0"
5893+
uuid: "npm:^8.3.2"
5894+
peerDependencies:
5895+
"@metamask/providers": ^22.0.0
5896+
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
5897+
checksum: 10/a17bf2047c38f419826b4dec56ebed4ad6160b3db94e15a1fc61e69e4264bd6450693bf0ea096ecb91a8fb547362d4b94960505df7319359becb0a3df7ee4e78
58445898
languageName: node
58455899
linkType: hard
58465900

@@ -7750,6 +7804,34 @@ __metadata:
77507804
languageName: node
77517805
linkType: hard
77527806

7807+
"@metamask/network-controller@npm:^27.0.0":
7808+
version: 27.0.0
7809+
resolution: "@metamask/network-controller@npm:27.0.0"
7810+
dependencies:
7811+
"@metamask/base-controller": "npm:^9.0.0"
7812+
"@metamask/controller-utils": "npm:^11.16.0"
7813+
"@metamask/error-reporting-service": "npm:^3.0.0"
7814+
"@metamask/eth-block-tracker": "npm:^15.0.0"
7815+
"@metamask/eth-json-rpc-infura": "npm:^10.3.0"
7816+
"@metamask/eth-json-rpc-middleware": "npm:^22.0.0"
7817+
"@metamask/eth-json-rpc-provider": "npm:^6.0.0"
7818+
"@metamask/eth-query": "npm:^4.0.0"
7819+
"@metamask/json-rpc-engine": "npm:^10.2.0"
7820+
"@metamask/messenger": "npm:^0.3.0"
7821+
"@metamask/rpc-errors": "npm:^7.0.2"
7822+
"@metamask/swappable-obj-proxy": "npm:^2.3.0"
7823+
"@metamask/utils": "npm:^11.8.1"
7824+
async-mutex: "npm:^0.5.0"
7825+
fast-deep-equal: "npm:^3.1.3"
7826+
immer: "npm:^9.0.6"
7827+
loglevel: "npm:^1.8.1"
7828+
reselect: "npm:^5.1.1"
7829+
uri-js: "npm:^4.4.1"
7830+
uuid: "npm:^8.3.2"
7831+
checksum: 10/74b6583fbf02d62ac0882df2554bcfa1fe46fda83c9002130d28868c749d33ab9951378b84ec4b67986aece92a50d55f800e30892a4ecf85d7718dd778518355
7832+
languageName: node
7833+
linkType: hard
7834+
77537835
"@metamask/network-enablement-controller@npm:^3.1.0":
77547836
version: 3.1.0
77557837
resolution: "@metamask/network-enablement-controller@npm:3.1.0"
@@ -9017,9 +9099,9 @@ __metadata:
90179099
languageName: node
90189100
linkType: hard
90199101

9020-
"@metamask/transaction-controller@npm:^62.3.0, @metamask/transaction-controller@npm:^62.3.1":
9021-
version: 62.3.1
9022-
resolution: "@metamask/transaction-controller@npm:62.3.1"
9102+
"@metamask/transaction-controller@npm:^62.3.0, @metamask/transaction-controller@npm:^62.3.1, @metamask/transaction-controller@npm:^62.4.0":
9103+
version: 62.4.0
9104+
resolution: "@metamask/transaction-controller@npm:62.4.0"
90239105
dependencies:
90249106
"@ethereumjs/common": "npm:^4.4.0"
90259107
"@ethereumjs/tx": "npm:^5.4.0"
@@ -9036,7 +9118,7 @@ __metadata:
90369118
"@metamask/gas-fee-controller": "npm:^26.0.0"
90379119
"@metamask/messenger": "npm:^0.3.0"
90389120
"@metamask/metamask-eth-abis": "npm:^3.1.1"
9039-
"@metamask/network-controller": "npm:^26.0.0"
9121+
"@metamask/network-controller": "npm:^27.0.0"
90409122
"@metamask/nonce-tracker": "npm:^6.0.0"
90419123
"@metamask/remote-feature-flag-controller": "npm:^2.0.1"
90429124
"@metamask/rpc-errors": "npm:^7.0.2"
@@ -9051,7 +9133,7 @@ __metadata:
90519133
peerDependencies:
90529134
"@babel/runtime": ^7.0.0
90539135
"@metamask/eth-block-tracker": ">=9"
9054-
checksum: 10/bf1fc4b305fcdf295fdc75ff5ebc21014cbd00c7b7fb29d4b34deb3e95c4b621c3139e1426980bc2ca6fa6855b0b47046471d62b527841fe8309f8467133fd7f
9136+
checksum: 10/36a816c881babf7b71542857be50045cb25b1a5cf7fa5444c0ad0c101da3c6718cfd83942ad5f868b53088aa2601c234dcf47e324173014ee5037c084f783438
90559137
languageName: node
90569138
linkType: hard
90579139

@@ -33348,7 +33430,7 @@ __metadata:
3334833430
"@metamask/announcement-controller": "npm:^8.0.0"
3334933431
"@metamask/api-specs": "npm:^0.13.0"
3335033432
"@metamask/approval-controller": "npm:^8.0.0"
33351-
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A92.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-92.0.0-ea998cb0bd.patch"
33433+
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A93.0.0#~/.yarn/patches/@metamask-assets-controllers-npm-93.0.0-ea998cb0bd.patch"
3335233434
"@metamask/auto-changelog": "npm:^5.3.0"
3335333435
"@metamask/base-controller": "npm:^9.0.0"
3335433436
"@metamask/bitcoin-wallet-snap": "npm:^1.8.0"

0 commit comments

Comments
 (0)