Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/dist/TokenBalancesController.cjs b/dist/TokenBalancesController.cjs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes in this file come from this PR #38126, which was not included in 13.11.0, but was cherry-picked in 13.10.1.

index 4918812dde60b8d0e24a7bded27d88f233968858..4e8018bce92b9e5d47fc40784409e16db22be615 100644
--- a/dist/TokenBalancesController.cjs
+++ b/dist/TokenBalancesController.cjs
@@ -535,14 +535,16 @@ class TokenBalancesController extends (0, polling_controller_1.StaticIntervalPol
}
// Update with actual fetched balances only if the value has changed
aggregated.forEach(({ success, value, account, token, chainId }) => {
- var _a, _b, _c;
+ var _a, _b;
if (success && value !== undefined) {
+ // Ensure all accounts we add/update are in lower-case
+ const lowerCaseAccount = account.toLowerCase();
const newBalance = (0, controller_utils_1.toHex)(value);
const tokenAddress = checksum(token);
- const currentBalance = d.tokenBalances[account]?.[chainId]?.[tokenAddress];
+ const currentBalance = d.tokenBalances[lowerCaseAccount]?.[chainId]?.[tokenAddress];
// Only update if the balance has actually changed
if (currentBalance !== newBalance) {
- ((_c = ((_a = d.tokenBalances)[_b = account] ?? (_a[_b] = {})))[chainId] ?? (_c[chainId] = {}))[tokenAddress] = newBalance;
+ ((_b = ((_a = d.tokenBalances)[lowerCaseAccount] ?? (_a[lowerCaseAccount] = {})))[chainId] ?? (_b[chainId] = {}))[tokenAddress] = newBalance;
}
}
});
diff --git a/dist/TokenBalancesController.mjs b/dist/TokenBalancesController.mjs
index f64d13f8de56631345a44e6ebb025e62e03f51bc..99aa7f27c574c94b26daa56091ac50d15281dd30 100644
--- a/dist/TokenBalancesController.mjs
+++ b/dist/TokenBalancesController.mjs
@@ -531,14 +531,16 @@ export class TokenBalancesController extends StaticIntervalPollingController() {
}
// Update with actual fetched balances only if the value has changed
aggregated.forEach(({ success, value, account, token, chainId }) => {
- var _a, _b, _c;
+ var _a, _b;
if (success && value !== undefined) {
+ // Ensure all accounts we add/update are in lower-case
+ const lowerCaseAccount = account.toLowerCase();
const newBalance = toHex(value);
const tokenAddress = checksum(token);
- const currentBalance = d.tokenBalances[account]?.[chainId]?.[tokenAddress];
+ const currentBalance = d.tokenBalances[lowerCaseAccount]?.[chainId]?.[tokenAddress];
// Only update if the balance has actually changed
if (currentBalance !== newBalance) {
- ((_c = ((_a = d.tokenBalances)[_b = account] ?? (_a[_b] = {})))[chainId] ?? (_c[chainId] = {}))[tokenAddress] = newBalance;
+ ((_b = ((_a = d.tokenBalances)[lowerCaseAccount] ?? (_a[lowerCaseAccount] = {})))[chainId] ?? (_b[chainId] = {}))[tokenAddress] = newBalance;
}
}
});
13 changes: 12 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix error message when trying to import an SRP with an account that is already imported via private key (#37743)
- Change available value text to total fiat value when fiat mode is enabled (#37749)

## [13.10.1]

### Fixed

- Prevents token list from fetching balances for all accounts (#38065)
- Fixes dapp-swap comparison fiat rate fetching for native tokens (#37980)
- Fixes dapp-swap fix conversion rate for pol native token (#38102)
- Removes unnecessary extension permission (#38075)
- Fixes missing native token balances in wallet balance (#38126)

## [13.10.0]

### Added
Expand Down Expand Up @@ -1276,7 +1286,8 @@ authorized by the user.` error until the user fully revoked dapp
- All older changes can be found in [docs/CHANGELOG_older.md](https://github.com/MetaMask/metamask-extension/blob/main/docs/CHANGELOG_older.md)

[Unreleased]: https://github.com/MetaMask/metamask-extension/compare/v13.11.0...HEAD
[13.11.0]: https://github.com/MetaMask/metamask-extension/compare/v13.10.0...v13.11.0
[13.11.0]: https://github.com/MetaMask/metamask-extension/compare/v13.10.1...v13.11.0
[13.10.1]: https://github.com/MetaMask/metamask-extension/compare/v13.10.0...v13.10.1
[13.10.0]: https://github.com/MetaMask/metamask-extension/compare/v13.9.0...v13.10.0
[13.9.0]: https://github.com/MetaMask/metamask-extension/compare/v13.8.0...v13.9.0
[13.8.0]: https://github.com/MetaMask/metamask-extension/compare/v13.7.0...v13.8.0
Expand Down
1 change: 0 additions & 1 deletion app/manifest/v3/_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
"notifications",
"scripting",
"storage",
"tabs",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes in this file come from this PR #38075, which was not included in 13.11.0, but was cherry-picked in 13.10.1.

"unlimitedStorage",
"webRequest",
"offscreen",
Expand Down
4 changes: 2 additions & 2 deletions development/webpack/utils/plugins/ManifestPlugin/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export function transformManifest(
}
}

if (args.test && args.manifest_version === 2) {
// test builds need "tabs" permission for switchToWindowWithTitle in MV2
if (args.test) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes in this file come from this PR #38075, which was not included in 13.11.0, but was cherry-picked in 13.10.1.

// test builds need "tabs" permission for switchToWindowWithTitle
transforms.push(addTabsPermission);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
"@metamask/address-book-controller": "^7.0.0",
"@metamask/announcement-controller": "^8.0.0",
"@metamask/approval-controller": "^8.0.0",
"@metamask/assets-controllers": "^89.0.1",
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A89.0.1#~/.yarn/patches/@metamask-assets-controllers-npm-89.0.1-02fa7acd54.patch",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes in this file come from this PR #38126, which was not included in 13.11.0, but was cherry-picked in 13.10.1.

"@metamask/base-controller": "^9.0.0",
"@metamask/bitcoin-wallet-snap": "^1.6.0",
"@metamask/bridge-controller": "^61.0.0",
Expand Down
56 changes: 54 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5591,7 +5591,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/assets-controllers@npm:^89.0.1":
"@metamask/assets-controllers@npm:89.0.1":
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes in this file come from this PR #38126, which was not included in 13.11.0, but was cherry-picked in 13.10.1.

version: 89.0.1
resolution: "@metamask/assets-controllers@npm:89.0.1"
dependencies:
Expand Down Expand Up @@ -5643,6 +5643,58 @@ __metadata:
languageName: node
linkType: hard

"@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A89.0.1#~/.yarn/patches/@metamask-assets-controllers-npm-89.0.1-02fa7acd54.patch":
version: 89.0.1
resolution: "@metamask/assets-controllers@patch:@metamask/assets-controllers@npm%3A89.0.1#~/.yarn/patches/@metamask-assets-controllers-npm-89.0.1-02fa7acd54.patch::version=89.0.1&hash=6be0d3"
dependencies:
"@ethereumjs/util": "npm:^9.1.0"
"@ethersproject/abi": "npm:^5.7.0"
"@ethersproject/address": "npm:^5.7.0"
"@ethersproject/bignumber": "npm:^5.7.0"
"@ethersproject/contracts": "npm:^5.7.0"
"@ethersproject/providers": "npm:^5.7.0"
"@metamask/abi-utils": "npm:^2.0.3"
"@metamask/base-controller": "npm:^9.0.0"
"@metamask/contract-metadata": "npm:^2.4.0"
"@metamask/controller-utils": "npm:^11.15.0"
"@metamask/eth-query": "npm:^4.0.0"
"@metamask/keyring-api": "npm:^21.0.0"
"@metamask/messenger": "npm:^0.3.0"
"@metamask/metamask-eth-abis": "npm:^3.1.1"
"@metamask/polling-controller": "npm:^15.0.0"
"@metamask/rpc-errors": "npm:^7.0.2"
"@metamask/snaps-sdk": "npm:^9.0.0"
"@metamask/snaps-utils": "npm:^11.0.0"
"@metamask/utils": "npm:^11.8.1"
"@types/bn.js": "npm:^5.1.5"
"@types/uuid": "npm:^8.3.0"
async-mutex: "npm:^0.5.0"
bitcoin-address-validation: "npm:^2.2.3"
bn.js: "npm:^5.2.1"
immer: "npm:^9.0.6"
lodash: "npm:^4.17.21"
multiformats: "npm:^9.9.0"
reselect: "npm:^5.1.1"
single-call-balance-checker-abi: "npm:^1.0.0"
uuid: "npm:^8.3.2"
peerDependencies:
"@metamask/account-tree-controller": ^3.0.0
"@metamask/accounts-controller": ^34.0.0
"@metamask/approval-controller": ^8.0.0
"@metamask/core-backend": ^4.1.0
"@metamask/keyring-controller": ^24.0.0
"@metamask/network-controller": ^25.0.0
"@metamask/permission-controller": ^12.0.0
"@metamask/phishing-controller": ^15.0.0
"@metamask/preferences-controller": ^21.0.0
"@metamask/providers": ^22.0.0
"@metamask/snaps-controllers": ^14.0.0
"@metamask/transaction-controller": ^61.0.0
webextension-polyfill: ^0.10.0 || ^0.11.0 || ^0.12.0
checksum: 10/b936b09bc22944626b3332844070c0fab559b7e3973873cc96c8321618e6879c1ee1215a588bb1f8f38029e4a69f796d01141ad1cb0726fd590df54ca111355b
languageName: node
linkType: hard

"@metamask/auth-network-utils@npm:^0.3.0":
version: 0.3.1
resolution: "@metamask/auth-network-utils@npm:0.3.1"
Expand Down Expand Up @@ -32510,7 +32562,7 @@ __metadata:
"@metamask/announcement-controller": "npm:^8.0.0"
"@metamask/api-specs": "npm:^0.13.0"
"@metamask/approval-controller": "npm:^8.0.0"
"@metamask/assets-controllers": "npm:^89.0.1"
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@npm%3A89.0.1#~/.yarn/patches/@metamask-assets-controllers-npm-89.0.1-02fa7acd54.patch"
"@metamask/auto-changelog": "npm:^5.1.0"
"@metamask/base-controller": "npm:^9.0.0"
"@metamask/bitcoin-wallet-snap": "npm:^1.6.0"
Expand Down
Loading