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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
/packages/rate-limit-controller @MetaMask/core-platform
/packages/react-data-query @MetaMask/core-platform
/packages/profile-metrics-controller @MetaMask/core-platform
/packages/wallet @MetaMask/core-platform

## Web3Auth Team
/packages/seedless-onboarding-controller @MetaMask/web3auth
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Each package in this repository has its own README where you can find installati
- [`@metamask/transaction-controller`](packages/transaction-controller)
- [`@metamask/transaction-pay-controller`](packages/transaction-pay-controller)
- [`@metamask/user-operation-controller`](packages/user-operation-controller)
- [`@metamask/wallet`](packages/wallet)

<!-- end package list -->

Expand Down Expand Up @@ -195,6 +196,7 @@ linkStyle default opacity:0.5
transaction_controller(["@metamask/transaction-controller"]);
transaction_pay_controller(["@metamask/transaction-pay-controller"]);
user_operation_controller(["@metamask/user-operation-controller"]);
wallet(["@metamask/wallet"]);
account_tree_controller --> accounts_controller;
account_tree_controller --> base_controller;
account_tree_controller --> keyring_controller;
Expand Down
31 changes: 21 additions & 10 deletions eslint-suppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -862,34 +862,45 @@
"count": 1
}
},
"packages/core-backend/src/AccountActivityService.test.ts": {
"packages/core-backend/src/api/shared-types.ts": {
"no-restricted-syntax": {
"count": 2
"count": 1
}
},
"packages/core-backend/src/AccountActivityService.ts": {
"packages/core-backend/src/index.ts": {
"no-restricted-syntax": {
"count": 1
"count": 4
}
},
"packages/core-backend/src/BackendWebSocketService.test.ts": {
"packages/core-backend/src/ws/AccountActivityService.test.ts": {
"no-restricted-syntax": {
"count": 1
"count": 2
}
},
"packages/core-backend/src/BackendWebSocketService.ts": {
"packages/core-backend/src/ws/AccountActivityService.ts": {
"no-restricted-syntax": {
"count": 5
"count": 1
}
},
"packages/core-backend/src/api/shared-types.ts": {
"packages/core-backend/src/ws/BackendWebSocketService.test.ts": {
"no-restricted-syntax": {
"count": 1
}
},
"packages/core-backend/src/index.ts": {
"packages/core-backend/src/ws/BackendWebSocketService.ts": {
"no-restricted-syntax": {
"count": 5
}
},
"packages/core-backend/src/ws/ohlcv/OHLCVService.test.ts": {
"@typescript-eslint/naming-convention": {
"count": 2
},
"id-length": {
"count": 1
},
"no-restricted-syntax": {
"count": 1
}
},
"packages/delegation-controller/src/DelegationController.test.ts": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/core-monorepo",
"version": "978.0.0",
"version": "980.0.0",
"private": true,
"description": "Monorepo for packages shared between MetaMask clients",
"repository": {
Expand Down
7 changes: 6 additions & 1 deletion packages/account-tree-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [7.4.0]

### Added

- Add `AccountTreeController:accountGroup{Created,Updated,Removed}` events ([#8766](https://github.com/MetaMask/core/pull/8766))
Expand All @@ -15,6 +17,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed

- Bump `@metamask/accounts-controller` from `^38.0.0` to `^38.1.1` ([#8755](https://github.com/MetaMask/core/pull/8755), [#8774](https://github.com/MetaMask/core/pull/8774))
- Bump `@metamask/multichain-account-service` from `^9.0.0` to `^10.0.0` ([#8783](https://github.com/MetaMask/core/pull/8783))
- Bump `@metamask/profile-sync-controller` from `^28.0.2` to `^28.1.0` ([#8783](https://github.com/MetaMask/core/pull/8783))

## [7.3.0]

Expand Down Expand Up @@ -565,7 +569,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial release ([#5847](https://github.com/MetaMask/core/pull/5847))
- Grouping accounts into 3 main categories: Entropy source, Snap ID, keyring types.

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@7.3.0...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@7.4.0...HEAD
[7.4.0]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@7.3.0...@metamask/account-tree-controller@7.4.0
[7.3.0]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@7.2.0...@metamask/account-tree-controller@7.3.0
[7.2.0]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@7.1.0...@metamask/account-tree-controller@7.2.0
[7.1.0]: https://github.com/MetaMask/core/compare/@metamask/account-tree-controller@7.0.0...@metamask/account-tree-controller@7.1.0
Expand Down
6 changes: 3 additions & 3 deletions packages/account-tree-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/account-tree-controller",
"version": "7.3.0",
"version": "7.4.0",
"description": "Controller to group account together based on some pre-defined rules",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -58,8 +58,8 @@
"@metamask/keyring-api": "^23.1.0",
"@metamask/keyring-controller": "^25.5.0",
"@metamask/messenger": "^1.2.0",
"@metamask/multichain-account-service": "^9.0.0",
"@metamask/profile-sync-controller": "^28.0.2",
"@metamask/multichain-account-service": "^10.0.0",
"@metamask/profile-sync-controller": "^28.1.0",
"@metamask/snaps-controllers": "^19.0.0",
"@metamask/snaps-sdk": "^11.0.0",
"@metamask/snaps-utils": "^12.1.2",
Expand Down
24 changes: 23 additions & 1 deletion packages/assets-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Bump `@metamask/transaction-controller` from `^65.3.0` to `^65.4.0` ([#8796](https://github.com/MetaMask/core/pull/8796))

## [7.1.2]

### Changed

- Bump `@metamask/account-tree-controller` from `^7.3.0` to `^7.4.0` ([#8783](https://github.com/MetaMask/core/pull/8783))
- Bump `@metamask/assets-controllers` from `^108.0.0` to `^108.1.0` ([#8783](https://github.com/MetaMask/core/pull/8783))

### Fixed

- `buildNativeAssetsFromConstant` now normalizes each native asset ID via `normalizeAssetId`, ensuring ERC20 addresses are EIP-55 checksummed and consistent with IDs written by data sources ([#8789](https://github.com/MetaMask/core/pull/8789))
- `RpcDataSource` no longer writes `{ amount: "NaN" }` entries into `assetsBalance` when state holds malformed native metadata ([#8781](https://github.com/MetaMask/core/pull/8781))
- Existing native metadata in `assetsInfo` is now only reused when its `decimals` field is a finite, non-negative number (via a new `#hasValidDecimals` guard). Stale entries like `{ type: 'native', decimals: null, name: '', symbol: '' }` or `{ decimals: -1, ... }` are replaced with the chain-status stub (`{ type: 'native', symbol/name: chainStatus.nativeCurrency, decimals: 18 }`) so balance conversion has a usable `decimals` and consumers never see a negative `decimals` in `assetsInfo`.
- `decimals: 0` is treated as valid; `name` and `symbol` are not required.
- Decimals resolution in `#handleBalanceUpdate` and the manual-fetch path no longer relies on `??` to fall through from state to pipeline metadata. A new `#pickValidDecimals` helper picks the first source whose `decimals` is finite and non-negative, so a stale `decimals: NaN` (or `decimals: -1`) in state can no longer shadow the chain-status stub's `decimals: 18` and silently produce `amount: '0'` while `assetsInfo` reports `decimals: 18`.
- `#convertToHumanReadable` now defensively returns `'0'` when `decimals` isn't a finite non-negative number or when the raw balance can't be parsed, matching the existing safe fallback used in the error path.
- The mUSD (`MetaMask USD`) contract address stored in `defaults.ts` is now EIP-55 checksummed (`0xacA92E438df0B2401fF60dA7E4337B687a2435DA`) ([#8786](https://github.com/MetaMask/core/pull/8786)). Previously the address was all-lowercase, causing the CAIP-19 keys pre-seeded into `assetsInfo` by `buildDefaultAssetsInfo()` to differ from the checksummed keys written by data sources (which always normalise asset IDs via `normalizeAssetId`). The mismatch resulted in two separate `assetsInfo` entries for the same token after the first balance or token-data poll.

## [7.1.1]

### Changed
Expand Down Expand Up @@ -480,7 +501,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Refactor `RpcDataSource` to delegate polling to `BalanceFetcher` and `TokenDetector` services ([#7709](https://github.com/MetaMask/core/pull/7709))
- Refactor `BalanceFetcher` and `TokenDetector` to extend `StaticIntervalPollingControllerOnly` for independent polling management ([#7709](https://github.com/MetaMask/core/pull/7709))

[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@7.1.1...HEAD
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@7.1.2...HEAD
[7.1.2]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@7.1.1...@metamask/assets-controller@7.1.2
[7.1.1]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@7.1.0...@metamask/assets-controller@7.1.1
[7.1.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@7.0.1...@metamask/assets-controller@7.1.0
[7.0.1]: https://github.com/MetaMask/core/compare/@metamask/assets-controller@7.0.0...@metamask/assets-controller@7.0.1
Expand Down
8 changes: 4 additions & 4 deletions packages/assets-controller/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metamask/assets-controller",
"version": "7.1.1",
"version": "7.1.2",
"description": "Tracks assets balances/prices and handles token detection across all digital assets",
"keywords": [
"Ethereum",
Expand Down Expand Up @@ -56,9 +56,9 @@
"@ethereumjs/util": "^9.1.0",
"@ethersproject/abi": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@metamask/account-tree-controller": "^7.3.0",
"@metamask/account-tree-controller": "^7.4.0",
"@metamask/accounts-controller": "^38.1.1",
"@metamask/assets-controllers": "^108.0.0",
"@metamask/assets-controllers": "^108.1.0",
"@metamask/base-controller": "^9.1.0",
"@metamask/client-controller": "^1.0.1",
"@metamask/controller-utils": "^12.1.0",
Expand All @@ -76,7 +76,7 @@
"@metamask/preferences-controller": "^23.1.0",
"@metamask/snaps-controllers": "^19.0.0",
"@metamask/snaps-utils": "^12.1.2",
"@metamask/transaction-controller": "^65.3.0",
"@metamask/transaction-controller": "^65.4.0",
"@metamask/utils": "^11.9.0",
"async-mutex": "^0.5.0",
"bignumber.js": "^9.1.2",
Expand Down
17 changes: 17 additions & 0 deletions packages/assets-controller/src/AssetsController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,23 @@ describe('AssetsController', () => {
selectedCurrency: 'usd',
});
});

it('pre-seeds assetsInfo with EIP-55 checksummed CAIP-19 keys', () => {
// Regression: MUSD_ADDRESS was previously all-lowercase, so
// buildDefaultAssetsInfo() produced lowercase CAIP-19 keys while data
// sources (which call normalizeAssetId) wrote checksummed keys.
// After the first balance poll both keys existed in assetsInfo.
const defaultState = getDefaultAssetsControllerState();
const assetIds = Object.keys(defaultState.assetsInfo);
expect(assetIds.length).toBeGreaterThan(0);
// Every erc20 asset ID must contain at least one uppercase hex letter
// (EIP-55 checksum property) so that keys match normalizeAssetId output.
const erc20Ids = assetIds.filter((id) => id.includes('/erc20:'));
expect(erc20Ids.length).toBeGreaterThan(0);
for (const id of erc20Ids) {
expect(id).toMatch(/\/erc20:0x[0-9a-fA-F]*[A-F][0-9a-fA-F]*/u);
}
});
});

describe('constructor', () => {
Expand Down
Loading
Loading