From 868c871c969d827f4478b180908a055056991c8a Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Wed, 29 May 2024 10:56:18 -0600 Subject: [PATCH 01/18] Release 158.0.0 --- packages/accounts-controller/CHANGELOG.md | 21 ++++- packages/accounts-controller/package.json | 4 +- packages/address-book-controller/CHANGELOG.md | 14 ++- packages/address-book-controller/package.json | 2 +- packages/announcement-controller/CHANGELOG.md | 9 +- packages/announcement-controller/package.json | 2 +- packages/assets-controllers/CHANGELOG.md | 59 +++++++++++- packages/assets-controllers/package.json | 14 +-- packages/composable-controller/CHANGELOG.md | 7 +- packages/composable-controller/package.json | 2 +- packages/controller-utils/CHANGELOG.md | 4 + packages/ens-controller/CHANGELOG.md | 15 ++- packages/ens-controller/package.json | 4 +- packages/gas-fee-controller/CHANGELOG.md | 11 ++- packages/gas-fee-controller/package.json | 6 +- .../json-rpc-middleware-stream/CHANGELOG.md | 9 +- .../json-rpc-middleware-stream/package.json | 2 +- packages/keyring-controller/CHANGELOG.md | 22 ++++- packages/keyring-controller/package.json | 4 +- packages/logging-controller/CHANGELOG.md | 10 +- packages/logging-controller/package.json | 2 +- packages/message-manager/CHANGELOG.md | 9 +- packages/message-manager/package.json | 2 +- packages/name-controller/CHANGELOG.md | 15 ++- packages/name-controller/package.json | 2 +- packages/network-controller/CHANGELOG.md | 9 +- packages/network-controller/package.json | 2 +- packages/notification-controller/CHANGELOG.md | 9 +- packages/notification-controller/package.json | 2 +- packages/permission-controller/CHANGELOG.md | 9 +- packages/permission-controller/package.json | 2 +- .../permission-log-controller/CHANGELOG.md | 10 +- .../permission-log-controller/package.json | 2 +- packages/phishing-controller/CHANGELOG.md | 9 +- packages/phishing-controller/package.json | 2 +- packages/polling-controller/CHANGELOG.md | 14 ++- packages/polling-controller/package.json | 4 +- packages/preferences-controller/CHANGELOG.md | 18 +++- packages/preferences-controller/package.json | 4 +- .../queued-request-controller/CHANGELOG.md | 11 ++- .../queued-request-controller/package.json | 8 +- packages/rate-limit-controller/CHANGELOG.md | 9 +- packages/rate-limit-controller/package.json | 2 +- .../selected-network-controller/CHANGELOG.md | 10 +- .../selected-network-controller/package.json | 6 +- packages/signature-controller/CHANGELOG.md | 12 ++- packages/signature-controller/package.json | 12 +-- packages/transaction-controller/CHANGELOG.md | 11 ++- packages/transaction-controller/package.json | 8 +- .../user-operation-controller/CHANGELOG.md | 22 ++++- .../user-operation-controller/package.json | 20 ++-- yarn.lock | 92 +++++++++---------- 52 files changed, 437 insertions(+), 133 deletions(-) diff --git a/packages/accounts-controller/CHANGELOG.md b/packages/accounts-controller/CHANGELOG.md index 2c8f9dcca2..a0340c5300 100644 --- a/packages/accounts-controller/CHANGELOG.md +++ b/packages/accounts-controller/CHANGELOG.md @@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [15.0.0] + +### Added + +- Add `getNextAvailableAccountName` method and `AccountsController:getNextAvailableAccountName` controller action ([#4326](https://github.com/MetaMask/core/pull/4326)) + +### Changed + +- **BREAKING:** Bump peer dependency `@metamask/snaps-controllers` to `^8.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) +- Bump `@metamask/eth-snap-keyring` to `^4.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) +- Bump `@metamask/keyring-api` to `^6.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) +- Bump `@metamask/snaps-sdk` to `^4.2.0` ([#4262](https://github.com/MetaMask/core/pull/4262)) +- Bump `@metamask/snaps-utils` to `^7.4.0` ([#4262](https://github.com/MetaMask/core/pull/4262)) + +### Fixed + +- Fix "Type instantiation is excessively deep and possibly infinite" TypeScript error ([#4331](https://github.com/MetaMask/core/pull/4331)) + ## [14.0.0] ### Changed @@ -171,7 +189,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release ([#1637](https://github.com/MetaMask/core/pull/1637)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@14.0.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@15.0.0...HEAD +[15.0.0]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@14.0.0...@metamask/accounts-controller@15.0.0 [14.0.0]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@13.0.0...@metamask/accounts-controller@14.0.0 [13.0.0]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@12.0.1...@metamask/accounts-controller@13.0.0 [12.0.1]: https://github.com/MetaMask/core/compare/@metamask/accounts-controller@12.0.0...@metamask/accounts-controller@12.0.1 diff --git a/packages/accounts-controller/package.json b/packages/accounts-controller/package.json index 3c59326eb2..7a5a6c63fd 100644 --- a/packages/accounts-controller/package.json +++ b/packages/accounts-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/accounts-controller", - "version": "14.0.0", + "version": "15.0.0", "description": "Manages internal accounts", "keywords": [ "MetaMask", @@ -55,7 +55,7 @@ }, "devDependencies": { "@metamask/auto-changelog": "^3.4.4", - "@metamask/keyring-controller": "^16.0.0", + "@metamask/keyring-controller": "^16.1.0", "@metamask/snaps-controllers": "^8.1.1", "@types/jest": "^27.4.1", "@types/readable-stream": "^2.3.0", diff --git a/packages/address-book-controller/CHANGELOG.md b/packages/address-book-controller/CHANGELOG.md index 7d38702f94..f01a33b9d4 100644 --- a/packages/address-book-controller/CHANGELOG.md +++ b/packages/address-book-controller/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [4.0.2] + +### Changed + +- Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + +### Fixed + +- Fix `delete` method to protect against prototype-polluting assignments ([#4041](https://github.com/MetaMask/core/pull/4041)) + ## [4.0.1] ### Fixed @@ -127,7 +138,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/address-book-controller@4.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/address-book-controller@4.0.2...HEAD +[4.0.2]: https://github.com/MetaMask/core/compare/@metamask/address-book-controller@4.0.1...@metamask/address-book-controller@4.0.2 [4.0.1]: https://github.com/MetaMask/core/compare/@metamask/address-book-controller@4.0.0...@metamask/address-book-controller@4.0.1 [4.0.0]: https://github.com/MetaMask/core/compare/@metamask/address-book-controller@3.1.7...@metamask/address-book-controller@4.0.0 [3.1.7]: https://github.com/MetaMask/core/compare/@metamask/address-book-controller@3.1.6...@metamask/address-book-controller@3.1.7 diff --git a/packages/address-book-controller/package.json b/packages/address-book-controller/package.json index c796063683..4dffeda279 100644 --- a/packages/address-book-controller/package.json +++ b/packages/address-book-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/address-book-controller", - "version": "4.0.1", + "version": "4.0.2", "description": "Manages a list of recipient addresses associated with nicknames", "keywords": [ "MetaMask", diff --git a/packages/announcement-controller/CHANGELOG.md b/packages/announcement-controller/CHANGELOG.md index 8ed50fe48a..98ce46b527 100644 --- a/packages/announcement-controller/CHANGELOG.md +++ b/packages/announcement-controller/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [6.1.1] + +### Changed + +- Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) + ## [6.1.0] ### Added @@ -129,7 +135,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/announcement-controller@6.1.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/announcement-controller@6.1.1...HEAD +[6.1.1]: https://github.com/MetaMask/core/compare/@metamask/announcement-controller@6.1.0...@metamask/announcement-controller@6.1.1 [6.1.0]: https://github.com/MetaMask/core/compare/@metamask/announcement-controller@6.0.1...@metamask/announcement-controller@6.1.0 [6.0.1]: https://github.com/MetaMask/core/compare/@metamask/announcement-controller@6.0.0...@metamask/announcement-controller@6.0.1 [6.0.0]: https://github.com/MetaMask/core/compare/@metamask/announcement-controller@5.0.2...@metamask/announcement-controller@6.0.0 diff --git a/packages/announcement-controller/package.json b/packages/announcement-controller/package.json index f19f2ae7f5..43d3563030 100644 --- a/packages/announcement-controller/package.json +++ b/packages/announcement-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/announcement-controller", - "version": "6.1.0", + "version": "6.1.1", "description": "Manages in-app announcements", "keywords": [ "MetaMask", diff --git a/packages/assets-controllers/CHANGELOG.md b/packages/assets-controllers/CHANGELOG.md index 9c9332f8ec..0a0528cf86 100644 --- a/packages/assets-controllers/CHANGELOG.md +++ b/packages/assets-controllers/CHANGELOG.md @@ -7,6 +7,62 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [31.0.0] + +### Added + +- **BREAKING:** The `NftDetectionController` now takes a `messenger`, which can be used for communication ([#4312](https://github.com/MetaMask/core/pull/4312)) + - This messenger must allow the following actions `ApprovalController:addRequest`, `NetworkController:getState`, `NetworkController:getNetworkClientById`, and `PreferencesController:getState`, and must allow the events `PreferencesController:stateChange` and `NetworkController:stateChange` + +### Changed + +- **BREAKING:** Change `TokensController` to inherit from `BaseController` rather than `BaseControllerV1` ([#4304](https://github.com/MetaMask/core/pull/4304)) + - The constructor arguments have changed: rather than accepting `config`, the constructor takes `selectedAddress` and `provider` instead. +- **BREAKING:** Rename `TokensState` type to `TokensControllerState` ([#4304](https://github.com/MetaMask/core/pull/4304)) +- **BREAKING:** Make all `TokensController` methods and properties in starting with `_` private ([#4304](https://github.com/MetaMask/core/pull/4304)) +- **BREAKING:** Convert `Token` from `interface` to `type` ([#4304](https://github.com/MetaMask/core/pull/4304)) +- **BREAKING:** Replace `balanceError` property in `Token` with `hasBalanceError`; update `TokenBalancesController` so that it no longer captures the error resulting from getting the balance of an ERC-20 token ([#4304](https://github.com/MetaMask/core/pull/4304)) +- **BREAKING:** Change `NftDetectionController` to inherit from `StaticIntervalPollingController` rather than `StaticIntervalPollingControllerV1` ([#4312](https://github.com/MetaMask/core/pull/4312)) + - The constructor now takes a single options object rather than three arguments. +- **BREAKING:** Convert `ApiNft` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) +- **BREAKING:** Convert `ApiNftContract` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) +- **BREAKING:** Convert `ApiNftLastSale` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) +- **BREAKING:** Convert `ApiNftCreator` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/accounts-controller` to `^15.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Change `NftDetectionController` method `detectNfts` so that `userAddress` option is optional ([#4312](https://github.com/MetaMask/core/pull/4312)) + - This will default to the currently selected address as kept by PreferencesController. +- Bump dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump dependency `@metamask/polling-controller` to `^7.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump dependency `@metamask/preferences-controller` to `^11.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + +### Removed + +- **BREAKING:** Remove `config` property and `configure` method from `TokensController` ([#4304](https://github.com/MetaMask/core/pull/4304)) + - The `TokensController` takes a single options object which can be used for configuration, and configuration is now kept internal. +- **BREAKING:** Remove `notify`, `subscribe`, and `unsubscribe` methods from `TokensController` ([#4304](https://github.com/MetaMask/core/pull/4304)) + - Use the controller messenger for subscribing to and publishing events instead. +- **BREAKING:** Remove `TokensConfig` type ([#4304](https://github.com/MetaMask/core/pull/4304)) + - These properties have been merged into the options that `TokensController` takes. +- **BREAKING:** Remove `config` property and `configure` method from `TokensController` ([#4312](https://github.com/MetaMask/core/pull/4312)) + - The `TokensController` takes a single options object which can be used for configuration, and configuration is now kept internal. +- **BREAKING:** Remove `notify`, `subscribe`, and `unsubscribe` methods from `NftDetectionController` ([#4312](https://github.com/MetaMask/core/pull/4312)) + - Use the controller messenger for subscribing to and publishing events instead. +- **BREAKING:** Remove `chainId` as a `NftDetectionController` constructor argument ([#4312](https://github.com/MetaMask/core/pull/4312)) + - The controller will now read the `networkClientId` from the NetworkController state through the messenger when needed. +- **BREAKING:** Remove `getNetworkClientById` as a `NftDetectionController` constructor argument ([#4312](https://github.com/MetaMask/core/pull/4312)) + - The controller will now call `NetworkController:getNetworkClientId` through the messenger object. +- **BREAKING:** Remove `onPreferencesStateChange` as a `NftDetectionController` constructor argument ([#4312](https://github.com/MetaMask/core/pull/4312)) + - The controller will now call `PreferencesController:stateChange` through the messenger object. +- **BREAKING:** Remove `onNetworkStateChange` as a `NftDetectionController` constructor argument ([#4312](https://github.com/MetaMask/core/pull/4312)) + - The controller will now read the `networkClientId` from the NetworkController state through the messenger when needed. +- **BREAKING:** Remove `getOpenSeaApiKey` as a `NftDetectionController` constructor argument ([#4312](https://github.com/MetaMask/core/pull/4312)) + - This was never used. +- **BREAKING:** Remove `getNftApi` as a `NftDetectionController` constructor argument ([#4312](https://github.com/MetaMask/core/pull/4312)) + - This was never used. +- **BREAKING:** Remove `NftDetectionConfig` type ([#4312](https://github.com/MetaMask/core/pull/4312)) + - These properties have been merged into the options that `NftDetectionController` takes. + ## [30.0.0] ### Added @@ -796,7 +852,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@30.0.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@31.0.0...HEAD +[31.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@30.0.0...@metamask/assets-controllers@31.0.0 [30.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@29.0.0...@metamask/assets-controllers@30.0.0 [29.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@28.0.0...@metamask/assets-controllers@29.0.0 [28.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@27.2.0...@metamask/assets-controllers@28.0.0 diff --git a/packages/assets-controllers/package.json b/packages/assets-controllers/package.json index 7f7021740e..7df26d4912 100644 --- a/packages/assets-controllers/package.json +++ b/packages/assets-controllers/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/assets-controllers", - "version": "30.0.0", + "version": "31.0.0", "description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)", "keywords": [ "MetaMask", @@ -47,17 +47,17 @@ "@ethersproject/contracts": "^5.7.0", "@ethersproject/providers": "^5.7.0", "@metamask/abi-utils": "^2.0.2", - "@metamask/accounts-controller": "^14.0.0", + "@metamask/accounts-controller": "^15.0.0", "@metamask/approval-controller": "^6.0.2", "@metamask/base-controller": "^5.0.2", "@metamask/contract-metadata": "^2.4.0", "@metamask/controller-utils": "^10.0.0", "@metamask/eth-query": "^4.0.0", - "@metamask/keyring-controller": "^16.0.0", + "@metamask/keyring-controller": "^16.1.0", "@metamask/metamask-eth-abis": "^3.1.1", - "@metamask/network-controller": "^18.1.2", - "@metamask/polling-controller": "^6.0.2", - "@metamask/preferences-controller": "^11.0.0", + "@metamask/network-controller": "^18.1.3", + "@metamask/polling-controller": "^7.0.0", + "@metamask/preferences-controller": "^11.1.0", "@metamask/rpc-errors": "^6.2.1", "@metamask/utils": "^8.3.0", "@types/bn.js": "^5.1.5", @@ -88,7 +88,7 @@ "typescript": "~4.9.5" }, "peerDependencies": { - "@metamask/accounts-controller": "^14.0.0", + "@metamask/accounts-controller": "^15.0.0", "@metamask/approval-controller": "^6.0.0", "@metamask/keyring-controller": "^16.0.0", "@metamask/network-controller": "^18.1.2", diff --git a/packages/composable-controller/CHANGELOG.md b/packages/composable-controller/CHANGELOG.md index ee846caee9..e4f1af9e1a 100644 --- a/packages/composable-controller/CHANGELOG.md +++ b/packages/composable-controller/CHANGELOG.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [6.0.2] + ### Added - Adds and exports new types: ([#3952](https://github.com/MetaMask/core/pull/3952)) @@ -18,6 +20,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** The `ComposableController` class is now a generic class that expects one generic argument `ComposableControllerState` ([#3952](https://github.com/MetaMask/core/pull/3952)). - **BREAKING:** For the `ComposableController` class to be typed correctly, any of its child controllers that extend `BaseControllerV1` must have an overridden `name` property that is defined using the `as const` assertion. +- Bump `@metamask/json-rpc-engine` to `^8.0.2` ([#4234](https://github.com/MetaMask/core/pull/4234)) +- Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) ## [6.0.1] @@ -134,7 +138,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@6.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@6.0.2...HEAD +[6.0.2]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@6.0.1...@metamask/composable-controller@6.0.2 [6.0.1]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@6.0.0...@metamask/composable-controller@6.0.1 [6.0.0]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@5.0.1...@metamask/composable-controller@6.0.0 [5.0.1]: https://github.com/MetaMask/core/compare/@metamask/composable-controller@5.0.0...@metamask/composable-controller@5.0.1 diff --git a/packages/composable-controller/package.json b/packages/composable-controller/package.json index 6425c98e6e..145a43577b 100644 --- a/packages/composable-controller/package.json +++ b/packages/composable-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/composable-controller", - "version": "6.0.1", + "version": "6.0.2", "description": "Consolidates the state from multiple controllers into one", "keywords": [ "MetaMask", diff --git a/packages/controller-utils/CHANGELOG.md b/packages/controller-utils/CHANGELOG.md index 8b33dcfa94..dc40a38b13 100644 --- a/packages/controller-utils/CHANGELOG.md +++ b/packages/controller-utils/CHANGELOG.md @@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [10.0.0] +### Added + +- Add `NFT_API_VERSION` and `NFT_API_TIMEOUT` constants ([#4312](https://github.com/MetaMask/core/pull/4312)) + ### Changed - **BREAKING:** Changed price and token API endpoints from `*.metafi.codefi.network` to `*.api.cx.metamask.io` ([#4301](https://github.com/MetaMask/core/pull/4301)) diff --git a/packages/ens-controller/CHANGELOG.md b/packages/ens-controller/CHANGELOG.md index d7b0e67a3b..1359582308 100644 --- a/packages/ens-controller/CHANGELOG.md +++ b/packages/ens-controller/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [11.0.0] + +### Changed + +- **BREAKING:** Bump peer dependency `@metamask/network-controller` to `^18.1.2` ([#4332](https://github.com/MetaMask/core/pull/4332)) +- Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + +### Fixed + +- Fix `delete` method to protect against prototype-polluting assignments ([#4041](https://github.com/MetaMask/core/pull/4041) + ## [10.0.1] ### Fixed @@ -174,7 +186,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ens-controller@10.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/ens-controller@11.0.0...HEAD +[11.0.0]: https://github.com/MetaMask/core/compare/@metamask/ens-controller@10.0.1...@metamask/ens-controller@11.0.0 [10.0.1]: https://github.com/MetaMask/core/compare/@metamask/ens-controller@10.0.0...@metamask/ens-controller@10.0.1 [10.0.0]: https://github.com/MetaMask/core/compare/@metamask/ens-controller@9.0.0...@metamask/ens-controller@10.0.0 [9.0.0]: https://github.com/MetaMask/core/compare/@metamask/ens-controller@8.0.0...@metamask/ens-controller@9.0.0 diff --git a/packages/ens-controller/package.json b/packages/ens-controller/package.json index f816ba74ad..6da7429e54 100644 --- a/packages/ens-controller/package.json +++ b/packages/ens-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/ens-controller", - "version": "10.0.1", + "version": "11.0.0", "description": "Maps ENS names to their resolved addresses by chain id", "keywords": [ "MetaMask", @@ -49,7 +49,7 @@ }, "devDependencies": { "@metamask/auto-changelog": "^3.4.4", - "@metamask/network-controller": "^18.1.2", + "@metamask/network-controller": "^18.1.3", "@types/jest": "^27.4.1", "deepmerge": "^4.2.2", "jest": "^27.5.1", diff --git a/packages/gas-fee-controller/CHANGELOG.md b/packages/gas-fee-controller/CHANGELOG.md index dfd93c08b5..e95d3b50fd 100644 --- a/packages/gas-fee-controller/CHANGELOG.md +++ b/packages/gas-fee-controller/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [16.0.0] + +### Changed + +- **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/polling-controller` to `^7.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [15.1.2] ### Fixed @@ -275,7 +283,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@15.1.2...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@16.0.0...HEAD +[16.0.0]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@15.1.2...@metamask/gas-fee-controller@16.0.0 [15.1.2]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@15.1.1...@metamask/gas-fee-controller@15.1.2 [15.1.1]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@15.1.0...@metamask/gas-fee-controller@15.1.1 [15.1.0]: https://github.com/MetaMask/core/compare/@metamask/gas-fee-controller@15.0.0...@metamask/gas-fee-controller@15.1.0 diff --git a/packages/gas-fee-controller/package.json b/packages/gas-fee-controller/package.json index c346c34038..10727798ac 100644 --- a/packages/gas-fee-controller/package.json +++ b/packages/gas-fee-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/gas-fee-controller", - "version": "15.1.2", + "version": "16.0.0", "description": "Periodically calculates gas fee estimates based on various gas limits as well as other data displayed on transaction confirm screens", "keywords": [ "MetaMask", @@ -45,8 +45,8 @@ "@metamask/controller-utils": "^10.0.0", "@metamask/eth-query": "^4.0.0", "@metamask/ethjs-unit": "^0.3.0", - "@metamask/network-controller": "^18.1.2", - "@metamask/polling-controller": "^6.0.2", + "@metamask/network-controller": "^18.1.3", + "@metamask/polling-controller": "^7.0.0", "@metamask/utils": "^8.3.0", "@types/bn.js": "^5.1.5", "@types/uuid": "^8.3.0", diff --git a/packages/json-rpc-middleware-stream/CHANGELOG.md b/packages/json-rpc-middleware-stream/CHANGELOG.md index 23f4e566e5..7c10898b1e 100644 --- a/packages/json-rpc-middleware-stream/CHANGELOG.md +++ b/packages/json-rpc-middleware-stream/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.2] + +### Changed + +- Bump `@metamask/json-rpc-engine` to `^8.0.2` ([#4234](https://github.com/MetaMask/core/pull/4234)) + ## [7.0.1] ### Fixed @@ -116,7 +122,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - TypeScript typings ([#11](https://github.com/MetaMask/json-rpc-middleware-stream/pull/11)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/json-rpc-middleware-stream@7.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/json-rpc-middleware-stream@7.0.2...HEAD +[7.0.2]: https://github.com/MetaMask/core/compare/@metamask/json-rpc-middleware-stream@7.0.1...@metamask/json-rpc-middleware-stream@7.0.2 [7.0.1]: https://github.com/MetaMask/core/compare/@metamask/json-rpc-middleware-stream@7.0.0...@metamask/json-rpc-middleware-stream@7.0.1 [7.0.0]: https://github.com/MetaMask/core/compare/@metamask/json-rpc-middleware-stream@6.0.2...@metamask/json-rpc-middleware-stream@7.0.0 [6.0.2]: https://github.com/MetaMask/core/compare/@metamask/json-rpc-middleware-stream@6.0.1...@metamask/json-rpc-middleware-stream@6.0.2 diff --git a/packages/json-rpc-middleware-stream/package.json b/packages/json-rpc-middleware-stream/package.json index d93179aed7..b48c8160d8 100644 --- a/packages/json-rpc-middleware-stream/package.json +++ b/packages/json-rpc-middleware-stream/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/json-rpc-middleware-stream", - "version": "7.0.1", + "version": "7.0.2", "description": "A small toolset for streaming JSON-RPC data and matching requests and responses", "keywords": [ "MetaMask", diff --git a/packages/keyring-controller/CHANGELOG.md b/packages/keyring-controller/CHANGELOG.md index 3ed83289cb..db683f1f0b 100644 --- a/packages/keyring-controller/CHANGELOG.md +++ b/packages/keyring-controller/CHANGELOG.md @@ -7,10 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [16.1.0] + ### Added -- Added `changePassword` method ([#4279](https://github.com/MetaMask/core/pull/4279)) - - This method can be used to change the password used to encrypt the vault +- Add `changePassword` method ([#4279](https://github.com/MetaMask/core/pull/4279)) + - This method can be used to change the password used to encrypt the vault. +- Add support for non-EVM account addresses to most methods ([#4282](https://github.com/MetaMask/core/pull/4282)) + - Previously, all addresses were assumed to be Ethereum addresses and normalized, but now only Ethereum addresses are treated as such. + - Relax type of `account` argument on `removeAccount` from `Hex` to `string` + +### Changed + +- Bump `@metamask/keyring-api` to `^6.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) +- Bump `@keystonehq/metamask-airgapped-keyring` to `^0.14.1` ([#4277](https://github.com/MetaMask/core/pull/4277)) +- Bump `@metamask/message-manager` to `^8.0.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) + +### Fixed + +- Fix QR keyrings so that they are not initialized with invalid state ([#4256](https://github.com/MetaMask/core/pull/4256)) ## [16.0.0] @@ -445,7 +460,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@16.0.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@16.1.0...HEAD +[16.1.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@16.0.0...@metamask/keyring-controller@16.1.0 [16.0.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@15.0.0...@metamask/keyring-controller@16.0.0 [15.0.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@14.0.1...@metamask/keyring-controller@15.0.0 [14.0.1]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@14.0.0...@metamask/keyring-controller@14.0.1 diff --git a/packages/keyring-controller/package.json b/packages/keyring-controller/package.json index cec140eef9..40d296b221 100644 --- a/packages/keyring-controller/package.json +++ b/packages/keyring-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/keyring-controller", - "version": "16.0.0", + "version": "16.1.0", "description": "Stores identities seen in the wallet and manages interactions such as signing", "keywords": [ "MetaMask", @@ -49,7 +49,7 @@ "@metamask/eth-sig-util": "^7.0.1", "@metamask/eth-simple-keyring": "^6.0.1", "@metamask/keyring-api": "^6.1.1", - "@metamask/message-manager": "^8.0.2", + "@metamask/message-manager": "^8.0.3", "@metamask/utils": "^8.3.0", "async-mutex": "^0.2.6", "ethereumjs-wallet": "^1.0.1", diff --git a/packages/logging-controller/CHANGELOG.md b/packages/logging-controller/CHANGELOG.md index be46c8c475..384aec2860 100644 --- a/packages/logging-controller/CHANGELOG.md +++ b/packages/logging-controller/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [3.0.2] + +### Uncategorized + +- Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [3.0.1] ### Fixed @@ -87,7 +94,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial Release - Add logging controller ([#1089](https://github.com/MetaMask/core.git/pull/1089)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.2...HEAD +[3.0.2]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.1...@metamask/logging-controller@3.0.2 [3.0.1]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.0...@metamask/logging-controller@3.0.1 [3.0.0]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@2.0.3...@metamask/logging-controller@3.0.0 [2.0.3]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@2.0.2...@metamask/logging-controller@2.0.3 diff --git a/packages/logging-controller/package.json b/packages/logging-controller/package.json index b5248c2e34..43a1e31bc3 100644 --- a/packages/logging-controller/package.json +++ b/packages/logging-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/logging-controller", - "version": "3.0.1", + "version": "3.0.2", "description": "Manages logging data to assist users and support staff", "keywords": [ "MetaMask", diff --git a/packages/message-manager/CHANGELOG.md b/packages/message-manager/CHANGELOG.md index 5c1c1afacd..f55f0aa63e 100644 --- a/packages/message-manager/CHANGELOG.md +++ b/packages/message-manager/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [8.0.3] + +### Changed + +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [8.0.2] ### Changed @@ -236,7 +242,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.2...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.3...HEAD +[8.0.3]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.2...@metamask/message-manager@8.0.3 [8.0.2]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.1...@metamask/message-manager@8.0.2 [8.0.1]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.0...@metamask/message-manager@8.0.1 [8.0.0]: https://github.com/MetaMask/core/compare/@metamask/message-manager@7.3.9...@metamask/message-manager@8.0.0 diff --git a/packages/message-manager/package.json b/packages/message-manager/package.json index 1d436c727c..158da25007 100644 --- a/packages/message-manager/package.json +++ b/packages/message-manager/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/message-manager", - "version": "8.0.2", + "version": "8.0.3", "description": "Stores and manages interactions with signing requests", "keywords": [ "MetaMask", diff --git a/packages/name-controller/CHANGELOG.md b/packages/name-controller/CHANGELOG.md index ee62ff7c76..61e79d7191 100644 --- a/packages/name-controller/CHANGELOG.md +++ b/packages/name-controller/CHANGELOG.md @@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.0] + +### Changed + +- **BREAKING:** Changed token API endpoint from `*.metafi.codefi.network` to `*.api.cx.metamask.io` ([#4301](https://github.com/MetaMask/core/pull/4301)) +- Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + +### Fixed + +- Fix `setName` and `updateProposedNames` methods to protect against prototype-polluting assignments ([#4041](https://github.com/MetaMask/core/pull/4041) + ## [6.0.1] ### Fixed @@ -100,7 +112,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial Release ([#1647](https://github.com/MetaMask/core/pull/1647)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/name-controller@6.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/name-controller@7.0.0...HEAD +[7.0.0]: https://github.com/MetaMask/core/compare/@metamask/name-controller@6.0.1...@metamask/name-controller@7.0.0 [6.0.1]: https://github.com/MetaMask/core/compare/@metamask/name-controller@6.0.0...@metamask/name-controller@6.0.1 [6.0.0]: https://github.com/MetaMask/core/compare/@metamask/name-controller@5.0.0...@metamask/name-controller@6.0.0 [5.0.0]: https://github.com/MetaMask/core/compare/@metamask/name-controller@4.2.0...@metamask/name-controller@5.0.0 diff --git a/packages/name-controller/package.json b/packages/name-controller/package.json index d8e797a158..acb9270667 100644 --- a/packages/name-controller/package.json +++ b/packages/name-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/name-controller", - "version": "6.0.1", + "version": "7.0.0", "description": "Stores and suggests names for values such as Ethereum addresses", "keywords": [ "MetaMask", diff --git a/packages/network-controller/CHANGELOG.md b/packages/network-controller/CHANGELOG.md index 1da5a057ef..9b94d83554 100644 --- a/packages/network-controller/CHANGELOG.md +++ b/packages/network-controller/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [18.1.3] + +### Changed + +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [18.1.2] ### Fixed @@ -488,7 +494,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/network-controller@18.1.2...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/network-controller@18.1.3...HEAD +[18.1.3]: https://github.com/MetaMask/core/compare/@metamask/network-controller@18.1.2...@metamask/network-controller@18.1.3 [18.1.2]: https://github.com/MetaMask/core/compare/@metamask/network-controller@18.1.1...@metamask/network-controller@18.1.2 [18.1.1]: https://github.com/MetaMask/core/compare/@metamask/network-controller@18.1.0...@metamask/network-controller@18.1.1 [18.1.0]: https://github.com/MetaMask/core/compare/@metamask/network-controller@18.0.1...@metamask/network-controller@18.1.0 diff --git a/packages/network-controller/package.json b/packages/network-controller/package.json index 2c85ed9910..6f1a157f50 100644 --- a/packages/network-controller/package.json +++ b/packages/network-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/network-controller", - "version": "18.1.2", + "version": "18.1.3", "description": "Provides an interface to the currently selected network via a MetaMask-compatible provider object", "keywords": [ "MetaMask", diff --git a/packages/notification-controller/CHANGELOG.md b/packages/notification-controller/CHANGELOG.md index 84a2760316..4200c288c0 100644 --- a/packages/notification-controller/CHANGELOG.md +++ b/packages/notification-controller/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.0.2] + +### Changed + +- Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) + ## [5.0.1] ### Fixed @@ -110,7 +116,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/notification-controller@5.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/notification-controller@5.0.2...HEAD +[5.0.2]: https://github.com/MetaMask/core/compare/@metamask/notification-controller@5.0.1...@metamask/notification-controller@5.0.2 [5.0.1]: https://github.com/MetaMask/core/compare/@metamask/notification-controller@5.0.0...@metamask/notification-controller@5.0.1 [5.0.0]: https://github.com/MetaMask/core/compare/@metamask/notification-controller@4.0.2...@metamask/notification-controller@5.0.0 [4.0.2]: https://github.com/MetaMask/core/compare/@metamask/notification-controller@4.0.1...@metamask/notification-controller@4.0.2 diff --git a/packages/notification-controller/package.json b/packages/notification-controller/package.json index 0d8365856e..715ed746d3 100644 --- a/packages/notification-controller/package.json +++ b/packages/notification-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/notification-controller", - "version": "5.0.1", + "version": "5.0.2", "description": "Manages display of notifications within MetaMask", "keywords": [ "MetaMask", diff --git a/packages/permission-controller/CHANGELOG.md b/packages/permission-controller/CHANGELOG.md index 146a959f9b..ca913d0325 100644 --- a/packages/permission-controller/CHANGELOG.md +++ b/packages/permission-controller/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [9.1.1] + +### Changed + +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [9.1.0] ### Added @@ -226,7 +232,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@9.1.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@9.1.1...HEAD +[9.1.1]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@9.1.0...@metamask/permission-controller@9.1.1 [9.1.0]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@9.0.2...@metamask/permission-controller@9.1.0 [9.0.2]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@9.0.1...@metamask/permission-controller@9.0.2 [9.0.1]: https://github.com/MetaMask/core/compare/@metamask/permission-controller@9.0.0...@metamask/permission-controller@9.0.1 diff --git a/packages/permission-controller/package.json b/packages/permission-controller/package.json index 4c5f91240d..0b17c1aa16 100644 --- a/packages/permission-controller/package.json +++ b/packages/permission-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/permission-controller", - "version": "9.1.0", + "version": "9.1.1", "description": "Mediates access to JSON-RPC methods, used to interact with pieces of the MetaMask stack, via middleware for json-rpc-engine", "keywords": [ "MetaMask", diff --git a/packages/permission-log-controller/CHANGELOG.md b/packages/permission-log-controller/CHANGELOG.md index a49564a432..b371cc2627 100644 --- a/packages/permission-log-controller/CHANGELOG.md +++ b/packages/permission-log-controller/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.0.2] + +### Changed + +- Bump `@metamask/base-controller` to `^5.0.2` ([#4234](https://github.com/MetaMask/core/pull/4234)) +- Bump `@metamask/json-rpc-engine` to `^8.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) + ## [2.0.1] ### Fixed @@ -32,7 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/permission-log-controller@2.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/permission-log-controller@2.0.2...HEAD +[2.0.2]: https://github.com/MetaMask/core/compare/@metamask/permission-log-controller@2.0.1...@metamask/permission-log-controller@2.0.2 [2.0.1]: https://github.com/MetaMask/core/compare/@metamask/permission-log-controller@2.0.0...@metamask/permission-log-controller@2.0.1 [2.0.0]: https://github.com/MetaMask/core/compare/@metamask/permission-log-controller@1.0.0...@metamask/permission-log-controller@2.0.0 [1.0.0]: https://github.com/MetaMask/core/releases/tag/@metamask/permission-log-controller@1.0.0 diff --git a/packages/permission-log-controller/package.json b/packages/permission-log-controller/package.json index 76b31562d1..e6d8ae5716 100644 --- a/packages/permission-log-controller/package.json +++ b/packages/permission-log-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/permission-log-controller", - "version": "2.0.1", + "version": "2.0.2", "description": "Controller with middleware for logging requests and responses to restricted and permissions-related methods", "keywords": [ "MetaMask", diff --git a/packages/phishing-controller/CHANGELOG.md b/packages/phishing-controller/CHANGELOG.md index d3c15c4dad..e4c5665f94 100644 --- a/packages/phishing-controller/CHANGELOG.md +++ b/packages/phishing-controller/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [9.0.4] + +### Changed + +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [9.0.3] ### Changed @@ -184,7 +190,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@9.0.3...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@9.0.4...HEAD +[9.0.4]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@9.0.3...@metamask/phishing-controller@9.0.4 [9.0.3]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@9.0.2...@metamask/phishing-controller@9.0.3 [9.0.2]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@9.0.1...@metamask/phishing-controller@9.0.2 [9.0.1]: https://github.com/MetaMask/core/compare/@metamask/phishing-controller@9.0.0...@metamask/phishing-controller@9.0.1 diff --git a/packages/phishing-controller/package.json b/packages/phishing-controller/package.json index 3b76b03224..77fa8082b2 100644 --- a/packages/phishing-controller/package.json +++ b/packages/phishing-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/phishing-controller", - "version": "9.0.3", + "version": "9.0.4", "description": "Maintains a periodically updated list of approved and unapproved website origins", "keywords": [ "MetaMask", diff --git a/packages/polling-controller/CHANGELOG.md b/packages/polling-controller/CHANGELOG.md index 5361880df4..ac62b1159b 100644 --- a/packages/polling-controller/CHANGELOG.md +++ b/packages/polling-controller/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.0] + +### Changed + +- **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + +### Fixed + +- `StaticIntervalPollingControllerOnly`, `StaticIntervalPollingController`, and `StaticIntervalPollingControllerV1` now properly stops polling when a stop is requested while `_executePoll` has not yet resolved for the current loop ([#4230](https://github.com/MetaMask/core/pull/4230)) + ## [6.0.2] ### Changed @@ -123,7 +134,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@6.0.2...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@7.0.0...HEAD +[7.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@6.0.2...@metamask/polling-controller@7.0.0 [6.0.2]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@6.0.1...@metamask/polling-controller@6.0.2 [6.0.1]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@6.0.0...@metamask/polling-controller@6.0.1 [6.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@5.0.1...@metamask/polling-controller@6.0.0 diff --git a/packages/polling-controller/package.json b/packages/polling-controller/package.json index 8d8ab0916f..f3d701fa48 100644 --- a/packages/polling-controller/package.json +++ b/packages/polling-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/polling-controller", - "version": "6.0.2", + "version": "7.0.0", "description": "Polling Controller is the base for controllers that polling by networkClientId", "keywords": [ "MetaMask", @@ -43,7 +43,7 @@ "dependencies": { "@metamask/base-controller": "^5.0.2", "@metamask/controller-utils": "^10.0.0", - "@metamask/network-controller": "^18.1.2", + "@metamask/network-controller": "^18.1.3", "@metamask/utils": "^8.3.0", "@types/uuid": "^8.3.0", "fast-json-stable-stringify": "^2.1.0", diff --git a/packages/preferences-controller/CHANGELOG.md b/packages/preferences-controller/CHANGELOG.md index 06b1701ba4..63e98f5cac 100644 --- a/packages/preferences-controller/CHANGELOG.md +++ b/packages/preferences-controller/CHANGELOG.md @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [11.1.0] + +### Added + +- Add `smartTransactionsOptInStatus` preference ([#3815](https://github.com/MetaMask/core/pull/3815)) + - Add `smartTransactionsOptInStatus` property to the `PreferencesController` state (default: `false`) + - Add `setSmartTransactionOptInStatus` method to set this property +- Add `useTransactionSimulations` preference ([#4283](https://github.com/MetaMask/core/pull/4283)) + - Add `useTransactionSimulations` property to the `PreferencesController` state (default value: `false`) + - Add `setUseTransactionSimulations` method to set this property + +### Changed + +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [11.0.0] ### Added @@ -219,7 +234,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@11.0.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@11.1.0...HEAD +[11.1.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@11.0.0...@metamask/preferences-controller@11.1.0 [11.0.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@10.0.0...@metamask/preferences-controller@11.0.0 [10.0.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@9.0.1...@metamask/preferences-controller@10.0.0 [9.0.1]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@9.0.0...@metamask/preferences-controller@9.0.1 diff --git a/packages/preferences-controller/package.json b/packages/preferences-controller/package.json index bc3c3bc87c..a1c28c828d 100644 --- a/packages/preferences-controller/package.json +++ b/packages/preferences-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/preferences-controller", - "version": "11.0.0", + "version": "11.1.0", "description": "Manages user-configurable settings for MetaMask", "keywords": [ "MetaMask", @@ -46,7 +46,7 @@ }, "devDependencies": { "@metamask/auto-changelog": "^3.4.4", - "@metamask/keyring-controller": "^16.0.0", + "@metamask/keyring-controller": "^16.1.0", "@types/jest": "^27.4.1", "deepmerge": "^4.2.2", "jest": "^27.5.1", diff --git a/packages/queued-request-controller/CHANGELOG.md b/packages/queued-request-controller/CHANGELOG.md index e51e951137..2ca4149cfa 100644 --- a/packages/queued-request-controller/CHANGELOG.md +++ b/packages/queued-request-controller/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.0] + +### Changed + +- **BREAKING:** Bump peer dependency `@metamask/network-controller` to `^18.1.2` ([#4332](https://github.com/MetaMask/core/pull/4332)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/selected-network-controller` to `^14.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [0.10.0] ### Changed @@ -181,7 +189,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/queued-request-controller@0.10.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/queued-request-controller@0.11.0...HEAD +[0.11.0]: https://github.com/MetaMask/core/compare/@metamask/queued-request-controller@0.10.0...@metamask/queued-request-controller@0.11.0 [0.10.0]: https://github.com/MetaMask/core/compare/@metamask/queued-request-controller@0.9.0...@metamask/queued-request-controller@0.10.0 [0.9.0]: https://github.com/MetaMask/core/compare/@metamask/queued-request-controller@0.8.0...@metamask/queued-request-controller@0.9.0 [0.8.0]: https://github.com/MetaMask/core/compare/@metamask/queued-request-controller@0.7.0...@metamask/queued-request-controller@0.8.0 diff --git a/packages/queued-request-controller/package.json b/packages/queued-request-controller/package.json index 4e689f6b08..d8ca568976 100644 --- a/packages/queued-request-controller/package.json +++ b/packages/queued-request-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/queued-request-controller", - "version": "0.10.0", + "version": "0.11.0", "description": "Includes a controller and middleware that implements a request queue", "keywords": [ "MetaMask", @@ -50,8 +50,8 @@ }, "devDependencies": { "@metamask/auto-changelog": "^3.4.4", - "@metamask/network-controller": "^18.1.2", - "@metamask/selected-network-controller": "^13.0.0", + "@metamask/network-controller": "^18.1.3", + "@metamask/selected-network-controller": "^14.0.0", "@types/jest": "^27.4.1", "deepmerge": "^4.2.2", "immer": "^9.0.6", @@ -66,7 +66,7 @@ }, "peerDependencies": { "@metamask/network-controller": "^18.1.2", - "@metamask/selected-network-controller": "^13.0.0" + "@metamask/selected-network-controller": "^14.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/packages/rate-limit-controller/CHANGELOG.md b/packages/rate-limit-controller/CHANGELOG.md index 20f1954f4a..753c037800 100644 --- a/packages/rate-limit-controller/CHANGELOG.md +++ b/packages/rate-limit-controller/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.0.2] + +### Changed + +- Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.comMetaMask/core/pull/4232)) + ## [5.0.1] ### Fixed @@ -124,7 +130,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/rate-limit-controller@5.0.1...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/rate-limit-controller@5.0.2...HEAD +[5.0.2]: https://github.com/MetaMask/core/compare/@metamask/rate-limit-controller@5.0.1...@metamask/rate-limit-controller@5.0.2 [5.0.1]: https://github.com/MetaMask/core/compare/@metamask/rate-limit-controller@5.0.0...@metamask/rate-limit-controller@5.0.1 [5.0.0]: https://github.com/MetaMask/core/compare/@metamask/rate-limit-controller@4.0.2...@metamask/rate-limit-controller@5.0.0 [4.0.2]: https://github.com/MetaMask/core/compare/@metamask/rate-limit-controller@4.0.1...@metamask/rate-limit-controller@4.0.2 diff --git a/packages/rate-limit-controller/package.json b/packages/rate-limit-controller/package.json index f3954e9b4b..cb36fa37a5 100644 --- a/packages/rate-limit-controller/package.json +++ b/packages/rate-limit-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/rate-limit-controller", - "version": "5.0.1", + "version": "5.0.2", "description": "Contains logic for rate-limiting API endpoints by requesting origin", "keywords": [ "MetaMask", diff --git a/packages/selected-network-controller/CHANGELOG.md b/packages/selected-network-controller/CHANGELOG.md index dd7d0a901f..82c7928f67 100644 --- a/packages/selected-network-controller/CHANGELOG.md +++ b/packages/selected-network-controller/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [14.0.0] + +### Changed + +- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/permission-controller` to `^9.1.1` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [13.0.0] ### Changed @@ -206,7 +213,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial Release ([#1643](https://github.com/MetaMask/core/pull/1643)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@13.0.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@14.0.0...HEAD +[14.0.0]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@13.0.0...@metamask/selected-network-controller@14.0.0 [13.0.0]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@12.0.1...@metamask/selected-network-controller@13.0.0 [12.0.1]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@12.0.0...@metamask/selected-network-controller@12.0.1 [12.0.0]: https://github.com/MetaMask/core/compare/@metamask/selected-network-controller@11.0.0...@metamask/selected-network-controller@12.0.0 diff --git a/packages/selected-network-controller/package.json b/packages/selected-network-controller/package.json index 8b2f273e41..577425b060 100644 --- a/packages/selected-network-controller/package.json +++ b/packages/selected-network-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/selected-network-controller", - "version": "13.0.0", + "version": "14.0.0", "description": "Provides an interface to the currently selected networkClientId for a given domain", "keywords": [ "MetaMask", @@ -43,8 +43,8 @@ "dependencies": { "@metamask/base-controller": "^5.0.2", "@metamask/json-rpc-engine": "^8.0.2", - "@metamask/network-controller": "^18.1.2", - "@metamask/permission-controller": "^9.1.0", + "@metamask/network-controller": "^18.1.3", + "@metamask/permission-controller": "^9.1.1", "@metamask/swappable-obj-proxy": "^2.2.0", "@metamask/utils": "^8.3.0" }, diff --git a/packages/signature-controller/CHANGELOG.md b/packages/signature-controller/CHANGELOG.md index d4f5dafc5b..b0b1ccdcca 100644 --- a/packages/signature-controller/CHANGELOG.md +++ b/packages/signature-controller/CHANGELOG.md @@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [17.0.0] + +### Changed + +- **BREAKING** Bump `@metamask/keyring-controller` peer dependency to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING** Bump `@metamask/logging-controller` peer dependency to `^3.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/message-manager` to `^8.0.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [16.0.0] ### Changed @@ -239,7 +248,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial release ([#1214](https://github.com/MetaMask/core/pull/1214)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/signature-controller@16.0.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/signature-controller@17.0.0...HEAD +[17.0.0]: https://github.com/MetaMask/core/compare/@metamask/signature-controller@16.0.0...@metamask/signature-controller@17.0.0 [16.0.0]: https://github.com/MetaMask/core/compare/@metamask/signature-controller@15.0.0...@metamask/signature-controller@16.0.0 [15.0.0]: https://github.com/MetaMask/core/compare/@metamask/signature-controller@14.0.1...@metamask/signature-controller@15.0.0 [14.0.1]: https://github.com/MetaMask/core/compare/@metamask/signature-controller@14.0.0...@metamask/signature-controller@14.0.1 diff --git a/packages/signature-controller/package.json b/packages/signature-controller/package.json index 8140a6d95f..7f061dd05d 100644 --- a/packages/signature-controller/package.json +++ b/packages/signature-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/signature-controller", - "version": "16.0.0", + "version": "17.0.0", "description": "Processes signing requests in order to sign arbitrary and typed data", "keywords": [ "MetaMask", @@ -44,9 +44,9 @@ "@metamask/approval-controller": "^6.0.2", "@metamask/base-controller": "^5.0.2", "@metamask/controller-utils": "^10.0.0", - "@metamask/keyring-controller": "^16.0.0", - "@metamask/logging-controller": "^3.0.1", - "@metamask/message-manager": "^8.0.2", + "@metamask/keyring-controller": "^16.1.0", + "@metamask/logging-controller": "^3.0.2", + "@metamask/message-manager": "^8.0.3", "@metamask/rpc-errors": "^6.2.1", "@metamask/utils": "^8.3.0", "lodash": "^4.17.21" @@ -63,8 +63,8 @@ }, "peerDependencies": { "@metamask/approval-controller": "^6.0.0", - "@metamask/keyring-controller": "^16.0.0", - "@metamask/logging-controller": "^3.0.0" + "@metamask/keyring-controller": "^16.1.0", + "@metamask/logging-controller": "^3.0.2" }, "engines": { "node": ">=16.0.0" diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index 5d5a2005b8..25ca9817a5 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [31.0.0] + +### Changed + +- **BREAKING:** Bump dependency and peer dependency `@metamask/gas-fee-controller` to `^16.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [30.0.0] ### Fixed @@ -846,7 +854,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@30.0.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@31.0.0...HEAD +[31.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@30.0.0...@metamask/transaction-controller@31.0.0 [30.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@29.1.0...@metamask/transaction-controller@30.0.0 [29.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@29.0.2...@metamask/transaction-controller@29.1.0 [29.0.2]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@29.0.1...@metamask/transaction-controller@29.0.2 diff --git a/packages/transaction-controller/package.json b/packages/transaction-controller/package.json index ccd5d3d712..674111bf26 100644 --- a/packages/transaction-controller/package.json +++ b/packages/transaction-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/transaction-controller", - "version": "30.0.0", + "version": "31.0.0", "description": "Stores transactions alongside their periodically updated statuses and manages interactions such as approval and cancellation", "keywords": [ "MetaMask", @@ -51,9 +51,9 @@ "@metamask/base-controller": "^5.0.2", "@metamask/controller-utils": "^10.0.0", "@metamask/eth-query": "^4.0.0", - "@metamask/gas-fee-controller": "^15.1.2", + "@metamask/gas-fee-controller": "^16.0.0", "@metamask/metamask-eth-abis": "^3.1.1", - "@metamask/network-controller": "^18.1.2", + "@metamask/network-controller": "^18.1.3", "@metamask/nonce-tracker": "^5.0.0", "@metamask/rpc-errors": "^6.2.1", "@metamask/utils": "^8.3.0", @@ -84,7 +84,7 @@ "peerDependencies": { "@babel/runtime": "^7.23.9", "@metamask/approval-controller": "^6.0.0", - "@metamask/gas-fee-controller": "^15.0.0", + "@metamask/gas-fee-controller": "^16.0.0", "@metamask/network-controller": "^18.1.2" }, "engines": { diff --git a/packages/user-operation-controller/CHANGELOG.md b/packages/user-operation-controller/CHANGELOG.md index b3f60aee3b..2c168b091d 100644 --- a/packages/user-operation-controller/CHANGELOG.md +++ b/packages/user-operation-controller/CHANGELOG.md @@ -7,6 +7,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [11.0.0] + +### Added + +- Add support for "swap+send" transactions ([#4298](https://github.com/MetaMask/core/pull/4298)) + - Add optional properties `destinationTokenAmount`, `sourceTokenAddress`, `sourceTokenAmount`, `sourceTokenDecimals`, and `swapAndSendRecipient` to `TransactionMeta` + - Add `swapAndSend` as a new entry in `TransactionType` enum + - When persisting this type of transaction, copy source tokens, destination tokens, and recipient from swap data, and emit `TransactionController:newSwapAndSend` controller event + +### Changed + +- **BREAKING:** Bump dependency and peer dependency `@metamask/approval-controller` to `^6.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/gas-fee-controller` to `^16.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/transaction-controller` to `^31.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/polling-controller` to `^7.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) + ## [10.0.0] ### Changed @@ -130,7 +149,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial Release ([#3749](https://github.com/MetaMask/core/pull/3749)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/user-operation-controller@10.0.0...HEAD +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/user-operation-controller@11.0.0...HEAD +[11.0.0]: https://github.com/MetaMask/core/compare/@metamask/user-operation-controller@10.0.0...@metamask/user-operation-controller@11.0.0 [10.0.0]: https://github.com/MetaMask/core/compare/@metamask/user-operation-controller@9.0.0...@metamask/user-operation-controller@10.0.0 [9.0.0]: https://github.com/MetaMask/core/compare/@metamask/user-operation-controller@8.0.1...@metamask/user-operation-controller@9.0.0 [8.0.1]: https://github.com/MetaMask/core/compare/@metamask/user-operation-controller@8.0.0...@metamask/user-operation-controller@8.0.1 diff --git a/packages/user-operation-controller/package.json b/packages/user-operation-controller/package.json index a6d0ef0173..9c71600794 100644 --- a/packages/user-operation-controller/package.json +++ b/packages/user-operation-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/user-operation-controller", - "version": "10.0.0", + "version": "11.0.0", "description": "Creates user operations and manages their life cycle", "keywords": [ "MetaMask", @@ -46,12 +46,12 @@ "@metamask/base-controller": "^5.0.2", "@metamask/controller-utils": "^10.0.0", "@metamask/eth-query": "^4.0.0", - "@metamask/gas-fee-controller": "^15.1.2", - "@metamask/keyring-controller": "^16.0.0", - "@metamask/network-controller": "^18.1.2", - "@metamask/polling-controller": "^6.0.2", + "@metamask/gas-fee-controller": "^16.0.0", + "@metamask/keyring-controller": "^16.1.0", + "@metamask/network-controller": "^18.1.3", + "@metamask/polling-controller": "^7.0.0", "@metamask/rpc-errors": "^6.2.1", - "@metamask/transaction-controller": "^30.0.0", + "@metamask/transaction-controller": "^31.0.0", "@metamask/utils": "^8.3.0", "bn.js": "^5.2.1", "immer": "^9.0.6", @@ -70,11 +70,11 @@ "typescript": "~4.9.5" }, "peerDependencies": { - "@metamask/approval-controller": "^6.0.0", - "@metamask/gas-fee-controller": "^15.0.0", - "@metamask/keyring-controller": "^16.0.0", + "@metamask/approval-controller": "^6.0.2", + "@metamask/gas-fee-controller": "^16.0.0", + "@metamask/keyring-controller": "^16.1.0", "@metamask/network-controller": "^18.1.2", - "@metamask/transaction-controller": "^30.0.0" + "@metamask/transaction-controller": "^31.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/yarn.lock b/yarn.lock index 8d20e9ec1c..803f6ae04b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1609,7 +1609,7 @@ __metadata: languageName: node linkType: hard -"@metamask/accounts-controller@^14.0.0, @metamask/accounts-controller@workspace:packages/accounts-controller": +"@metamask/accounts-controller@^15.0.0, @metamask/accounts-controller@workspace:packages/accounts-controller": version: 0.0.0-use.local resolution: "@metamask/accounts-controller@workspace:packages/accounts-controller" dependencies: @@ -1618,7 +1618,7 @@ __metadata: "@metamask/base-controller": ^5.0.2 "@metamask/eth-snap-keyring": ^4.1.1 "@metamask/keyring-api": ^6.1.1 - "@metamask/keyring-controller": ^16.0.0 + "@metamask/keyring-controller": ^16.1.0 "@metamask/snaps-controllers": ^8.1.1 "@metamask/snaps-sdk": ^4.2.0 "@metamask/snaps-utils": ^7.4.0 @@ -1715,7 +1715,7 @@ __metadata: "@ethersproject/contracts": ^5.7.0 "@ethersproject/providers": ^5.7.0 "@metamask/abi-utils": ^2.0.2 - "@metamask/accounts-controller": ^14.0.0 + "@metamask/accounts-controller": ^15.0.0 "@metamask/approval-controller": ^6.0.2 "@metamask/auto-changelog": ^3.4.4 "@metamask/base-controller": ^5.0.2 @@ -1724,11 +1724,11 @@ __metadata: "@metamask/eth-query": ^4.0.0 "@metamask/ethjs-provider-http": ^0.3.0 "@metamask/keyring-api": ^6.1.1 - "@metamask/keyring-controller": ^16.0.0 + "@metamask/keyring-controller": ^16.1.0 "@metamask/metamask-eth-abis": ^3.1.1 - "@metamask/network-controller": ^18.1.2 - "@metamask/polling-controller": ^6.0.2 - "@metamask/preferences-controller": ^11.0.0 + "@metamask/network-controller": ^18.1.3 + "@metamask/polling-controller": ^7.0.0 + "@metamask/preferences-controller": ^11.1.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 "@types/bn.js": ^5.1.5 @@ -1753,7 +1753,7 @@ __metadata: typescript: ~4.9.5 uuid: ^8.3.2 peerDependencies: - "@metamask/accounts-controller": ^14.0.0 + "@metamask/accounts-controller": ^15.0.0 "@metamask/approval-controller": ^6.0.0 "@metamask/keyring-controller": ^16.0.0 "@metamask/network-controller": ^18.1.2 @@ -2000,7 +2000,7 @@ __metadata: "@metamask/auto-changelog": ^3.4.4 "@metamask/base-controller": ^5.0.2 "@metamask/controller-utils": ^10.0.0 - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 deepmerge: ^4.2.2 @@ -2304,7 +2304,7 @@ __metadata: languageName: node linkType: hard -"@metamask/gas-fee-controller@^15.1.2, @metamask/gas-fee-controller@workspace:packages/gas-fee-controller": +"@metamask/gas-fee-controller@^16.0.0, @metamask/gas-fee-controller@workspace:packages/gas-fee-controller": version: 0.0.0-use.local resolution: "@metamask/gas-fee-controller@workspace:packages/gas-fee-controller" dependencies: @@ -2313,8 +2313,8 @@ __metadata: "@metamask/controller-utils": ^10.0.0 "@metamask/eth-query": ^4.0.0 "@metamask/ethjs-unit": ^0.3.0 - "@metamask/network-controller": ^18.1.2 - "@metamask/polling-controller": ^6.0.2 + "@metamask/network-controller": ^18.1.3 + "@metamask/polling-controller": ^7.0.0 "@metamask/utils": ^8.3.0 "@types/bn.js": ^5.1.5 "@types/jest": ^27.4.1 @@ -2417,7 +2417,7 @@ __metadata: languageName: node linkType: hard -"@metamask/keyring-controller@^16.0.0, @metamask/keyring-controller@workspace:packages/keyring-controller": +"@metamask/keyring-controller@^16.1.0, @metamask/keyring-controller@workspace:packages/keyring-controller": version: 0.0.0-use.local resolution: "@metamask/keyring-controller@workspace:packages/keyring-controller" dependencies: @@ -2434,7 +2434,7 @@ __metadata: "@metamask/eth-sig-util": ^7.0.1 "@metamask/eth-simple-keyring": ^6.0.1 "@metamask/keyring-api": ^6.1.1 - "@metamask/message-manager": ^8.0.2 + "@metamask/message-manager": ^8.0.3 "@metamask/scure-bip39": ^2.1.1 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 @@ -2453,7 +2453,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/logging-controller@^3.0.1, @metamask/logging-controller@workspace:packages/logging-controller": +"@metamask/logging-controller@^3.0.2, @metamask/logging-controller@workspace:packages/logging-controller": version: 0.0.0-use.local resolution: "@metamask/logging-controller@workspace:packages/logging-controller" dependencies: @@ -2471,7 +2471,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/message-manager@^8.0.2, @metamask/message-manager@workspace:packages/message-manager": +"@metamask/message-manager@^8.0.3, @metamask/message-manager@workspace:packages/message-manager": version: 0.0.0-use.local resolution: "@metamask/message-manager@workspace:packages/message-manager" dependencies: @@ -2519,7 +2519,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/network-controller@^18.1.2, @metamask/network-controller@workspace:packages/network-controller": +"@metamask/network-controller@^18.1.3, @metamask/network-controller@workspace:packages/network-controller": version: 0.0.0-use.local resolution: "@metamask/network-controller@workspace:packages/network-controller" dependencies: @@ -2615,7 +2615,7 @@ __metadata: languageName: node linkType: hard -"@metamask/permission-controller@^9.0.2, @metamask/permission-controller@^9.1.0, @metamask/permission-controller@workspace:packages/permission-controller": +"@metamask/permission-controller@^9.0.2, @metamask/permission-controller@^9.1.1, @metamask/permission-controller@workspace:packages/permission-controller": version: 0.0.0-use.local resolution: "@metamask/permission-controller@workspace:packages/permission-controller" dependencies: @@ -2685,14 +2685,14 @@ __metadata: languageName: unknown linkType: soft -"@metamask/polling-controller@^6.0.2, @metamask/polling-controller@workspace:packages/polling-controller": +"@metamask/polling-controller@^7.0.0, @metamask/polling-controller@workspace:packages/polling-controller": version: 0.0.0-use.local resolution: "@metamask/polling-controller@workspace:packages/polling-controller" dependencies: "@metamask/auto-changelog": ^3.4.4 "@metamask/base-controller": ^5.0.2 "@metamask/controller-utils": ^10.0.0 - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 "@types/uuid": ^8.3.0 @@ -2720,14 +2720,14 @@ __metadata: languageName: node linkType: hard -"@metamask/preferences-controller@^11.0.0, @metamask/preferences-controller@workspace:packages/preferences-controller": +"@metamask/preferences-controller@^11.1.0, @metamask/preferences-controller@workspace:packages/preferences-controller": version: 0.0.0-use.local resolution: "@metamask/preferences-controller@workspace:packages/preferences-controller" dependencies: "@metamask/auto-changelog": ^3.4.4 "@metamask/base-controller": ^5.0.2 "@metamask/controller-utils": ^10.0.0 - "@metamask/keyring-controller": ^16.0.0 + "@metamask/keyring-controller": ^16.1.0 "@types/jest": ^27.4.1 deepmerge: ^4.2.2 jest: ^27.5.1 @@ -2790,9 +2790,9 @@ __metadata: "@metamask/base-controller": ^5.0.2 "@metamask/controller-utils": ^10.0.0 "@metamask/json-rpc-engine": ^8.0.2 - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 "@metamask/rpc-errors": ^6.2.1 - "@metamask/selected-network-controller": ^13.0.0 + "@metamask/selected-network-controller": ^14.0.0 "@metamask/swappable-obj-proxy": ^2.2.0 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 @@ -2808,7 +2808,7 @@ __metadata: typescript: ~4.9.5 peerDependencies: "@metamask/network-controller": ^18.1.2 - "@metamask/selected-network-controller": ^13.0.0 + "@metamask/selected-network-controller": ^14.0.0 languageName: unknown linkType: soft @@ -2857,15 +2857,15 @@ __metadata: languageName: node linkType: hard -"@metamask/selected-network-controller@^13.0.0, @metamask/selected-network-controller@workspace:packages/selected-network-controller": +"@metamask/selected-network-controller@^14.0.0, @metamask/selected-network-controller@workspace:packages/selected-network-controller": version: 0.0.0-use.local resolution: "@metamask/selected-network-controller@workspace:packages/selected-network-controller" dependencies: "@metamask/auto-changelog": ^3.4.4 "@metamask/base-controller": ^5.0.2 "@metamask/json-rpc-engine": ^8.0.2 - "@metamask/network-controller": ^18.1.2 - "@metamask/permission-controller": ^9.1.0 + "@metamask/network-controller": ^18.1.3 + "@metamask/permission-controller": ^9.1.1 "@metamask/swappable-obj-proxy": ^2.2.0 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 @@ -2893,9 +2893,9 @@ __metadata: "@metamask/auto-changelog": ^3.4.4 "@metamask/base-controller": ^5.0.2 "@metamask/controller-utils": ^10.0.0 - "@metamask/keyring-controller": ^16.0.0 - "@metamask/logging-controller": ^3.0.1 - "@metamask/message-manager": ^8.0.2 + "@metamask/keyring-controller": ^16.1.0 + "@metamask/logging-controller": ^3.0.2 + "@metamask/message-manager": ^8.0.3 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 @@ -2908,8 +2908,8 @@ __metadata: typescript: ~4.9.5 peerDependencies: "@metamask/approval-controller": ^6.0.0 - "@metamask/keyring-controller": ^16.0.0 - "@metamask/logging-controller": ^3.0.0 + "@metamask/keyring-controller": ^16.1.0 + "@metamask/logging-controller": ^3.0.2 languageName: unknown linkType: soft @@ -3036,7 +3036,7 @@ __metadata: languageName: node linkType: hard -"@metamask/transaction-controller@^30.0.0, @metamask/transaction-controller@workspace:packages/transaction-controller": +"@metamask/transaction-controller@^31.0.0, @metamask/transaction-controller@workspace:packages/transaction-controller": version: 0.0.0-use.local resolution: "@metamask/transaction-controller@workspace:packages/transaction-controller" dependencies: @@ -3053,9 +3053,9 @@ __metadata: "@metamask/controller-utils": ^10.0.0 "@metamask/eth-query": ^4.0.0 "@metamask/ethjs-provider-http": ^0.3.0 - "@metamask/gas-fee-controller": ^15.1.2 + "@metamask/gas-fee-controller": ^16.0.0 "@metamask/metamask-eth-abis": ^3.1.1 - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 "@metamask/nonce-tracker": ^5.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 @@ -3080,7 +3080,7 @@ __metadata: peerDependencies: "@babel/runtime": ^7.23.9 "@metamask/approval-controller": ^6.0.0 - "@metamask/gas-fee-controller": ^15.0.0 + "@metamask/gas-fee-controller": ^16.0.0 "@metamask/network-controller": ^18.1.2 languageName: unknown linkType: soft @@ -3094,12 +3094,12 @@ __metadata: "@metamask/base-controller": ^5.0.2 "@metamask/controller-utils": ^10.0.0 "@metamask/eth-query": ^4.0.0 - "@metamask/gas-fee-controller": ^15.1.2 - "@metamask/keyring-controller": ^16.0.0 - "@metamask/network-controller": ^18.1.2 - "@metamask/polling-controller": ^6.0.2 + "@metamask/gas-fee-controller": ^16.0.0 + "@metamask/keyring-controller": ^16.1.0 + "@metamask/network-controller": ^18.1.3 + "@metamask/polling-controller": ^7.0.0 "@metamask/rpc-errors": ^6.2.1 - "@metamask/transaction-controller": ^30.0.0 + "@metamask/transaction-controller": ^31.0.0 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 bn.js: ^5.2.1 @@ -3114,11 +3114,11 @@ __metadata: typescript: ~4.9.5 uuid: ^8.3.2 peerDependencies: - "@metamask/approval-controller": ^6.0.0 - "@metamask/gas-fee-controller": ^15.0.0 - "@metamask/keyring-controller": ^16.0.0 + "@metamask/approval-controller": ^6.0.2 + "@metamask/gas-fee-controller": ^16.0.0 + "@metamask/keyring-controller": ^16.1.0 "@metamask/network-controller": ^18.1.2 - "@metamask/transaction-controller": ^30.0.0 + "@metamask/transaction-controller": ^31.0.0 languageName: unknown linkType: soft From 012d5b9b526ba5317e06c880abc65a20f77acd02 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 30 May 2024 14:08:14 -0600 Subject: [PATCH 02/18] Update some peer dependencies --- packages/accounts-controller/CHANGELOG.md | 1 + packages/accounts-controller/package.json | 2 +- packages/assets-controllers/CHANGELOG.md | 7 ++++--- packages/assets-controllers/package.json | 8 ++++---- packages/ens-controller/CHANGELOG.md | 2 +- packages/ens-controller/package.json | 2 +- packages/gas-fee-controller/package.json | 2 +- packages/polling-controller/package.json | 2 +- packages/queued-request-controller/CHANGELOG.md | 2 +- packages/queued-request-controller/package.json | 2 +- packages/selected-network-controller/CHANGELOG.md | 4 ++-- packages/selected-network-controller/package.json | 4 ++-- packages/transaction-controller/CHANGELOG.md | 3 ++- packages/transaction-controller/package.json | 4 ++-- packages/user-operation-controller/package.json | 2 +- 15 files changed, 25 insertions(+), 22 deletions(-) diff --git a/packages/accounts-controller/CHANGELOG.md b/packages/accounts-controller/CHANGELOG.md index a0340c5300..88b435f8e0 100644 --- a/packages/accounts-controller/CHANGELOG.md +++ b/packages/accounts-controller/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed - **BREAKING:** Bump peer dependency `@metamask/snaps-controllers` to `^8.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) +- **BREAKING:** Bump peer dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump `@metamask/eth-snap-keyring` to `^4.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) - Bump `@metamask/keyring-api` to `^6.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) - Bump `@metamask/snaps-sdk` to `^4.2.0` ([#4262](https://github.com/MetaMask/core/pull/4262)) diff --git a/packages/accounts-controller/package.json b/packages/accounts-controller/package.json index 7a5a6c63fd..96879a9a51 100644 --- a/packages/accounts-controller/package.json +++ b/packages/accounts-controller/package.json @@ -66,7 +66,7 @@ "typescript": "~4.9.5" }, "peerDependencies": { - "@metamask/keyring-controller": "^16.0.0", + "@metamask/keyring-controller": "^16.1.0", "@metamask/snaps-controllers": "^8.1.1" }, "engines": { diff --git a/packages/assets-controllers/CHANGELOG.md b/packages/assets-controllers/CHANGELOG.md index 0a0528cf86..4e73e1dc66 100644 --- a/packages/assets-controllers/CHANGELOG.md +++ b/packages/assets-controllers/CHANGELOG.md @@ -29,12 +29,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Convert `ApiNftLastSale` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) - **BREAKING:** Convert `ApiNftCreator` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) - **BREAKING:** Bump dependency and peer dependency `@metamask/accounts-controller` to `^15.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/approval-controller` to `^6.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/preferences-controller` to `^11.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Change `NftDetectionController` method `detectNfts` so that `userAddress` option is optional ([#4312](https://github.com/MetaMask/core/pull/4312)) - This will default to the currently selected address as kept by PreferencesController. -- Bump dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) -- Bump dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump dependency `@metamask/polling-controller` to `^7.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) -- Bump dependency `@metamask/preferences-controller` to `^11.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) ### Removed diff --git a/packages/assets-controllers/package.json b/packages/assets-controllers/package.json index 7df26d4912..2391a69a05 100644 --- a/packages/assets-controllers/package.json +++ b/packages/assets-controllers/package.json @@ -89,10 +89,10 @@ }, "peerDependencies": { "@metamask/accounts-controller": "^15.0.0", - "@metamask/approval-controller": "^6.0.0", - "@metamask/keyring-controller": "^16.0.0", - "@metamask/network-controller": "^18.1.2", - "@metamask/preferences-controller": "^11.0.0" + "@metamask/approval-controller": "^6.0.2", + "@metamask/keyring-controller": "^16.1.0", + "@metamask/network-controller": "^18.1.3", + "@metamask/preferences-controller": "^11.1.0" }, "engines": { "node": ">=16.0.0" diff --git a/packages/ens-controller/CHANGELOG.md b/packages/ens-controller/CHANGELOG.md index 1359582308..c390ee1374 100644 --- a/packages/ens-controller/CHANGELOG.md +++ b/packages/ens-controller/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- **BREAKING:** Bump peer dependency `@metamask/network-controller` to `^18.1.2` ([#4332](https://github.com/MetaMask/core/pull/4332)) +- **BREAKING:** Bump peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) diff --git a/packages/ens-controller/package.json b/packages/ens-controller/package.json index 6da7429e54..b9e0664868 100644 --- a/packages/ens-controller/package.json +++ b/packages/ens-controller/package.json @@ -59,7 +59,7 @@ "typescript": "~4.9.5" }, "peerDependencies": { - "@metamask/network-controller": "^18.1.2" + "@metamask/network-controller": "^18.1.3" }, "engines": { "node": ">=16.0.0" diff --git a/packages/gas-fee-controller/package.json b/packages/gas-fee-controller/package.json index 10727798ac..b39aa4d49e 100644 --- a/packages/gas-fee-controller/package.json +++ b/packages/gas-fee-controller/package.json @@ -67,7 +67,7 @@ "typescript": "~4.9.5" }, "peerDependencies": { - "@metamask/network-controller": "^18.1.2" + "@metamask/network-controller": "^18.1.3" }, "engines": { "node": ">=16.0.0" diff --git a/packages/polling-controller/package.json b/packages/polling-controller/package.json index f3d701fa48..8093868177 100644 --- a/packages/polling-controller/package.json +++ b/packages/polling-controller/package.json @@ -61,7 +61,7 @@ "typescript": "~4.9.5" }, "peerDependencies": { - "@metamask/network-controller": "^18.1.2" + "@metamask/network-controller": "^18.1.3" }, "engines": { "node": ">=16.0.0" diff --git a/packages/queued-request-controller/CHANGELOG.md b/packages/queued-request-controller/CHANGELOG.md index 2ca4149cfa..2506f69b8c 100644 --- a/packages/queued-request-controller/CHANGELOG.md +++ b/packages/queued-request-controller/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- **BREAKING:** Bump peer dependency `@metamask/network-controller` to `^18.1.2` ([#4332](https://github.com/MetaMask/core/pull/4332)) +- **BREAKING:** Bump peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING:** Bump dependency and peer dependency `@metamask/selected-network-controller` to `^14.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) diff --git a/packages/queued-request-controller/package.json b/packages/queued-request-controller/package.json index d8ca568976..45102d0881 100644 --- a/packages/queued-request-controller/package.json +++ b/packages/queued-request-controller/package.json @@ -65,7 +65,7 @@ "typescript": "~4.9.5" }, "peerDependencies": { - "@metamask/network-controller": "^18.1.2", + "@metamask/network-controller": "^18.1.3", "@metamask/selected-network-controller": "^14.0.0" }, "engines": { diff --git a/packages/selected-network-controller/CHANGELOG.md b/packages/selected-network-controller/CHANGELOG.md index 82c7928f67..3e9996f959 100644 --- a/packages/selected-network-controller/CHANGELOG.md +++ b/packages/selected-network-controller/CHANGELOG.md @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) -- Bump `@metamask/permission-controller` to `^9.1.1` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/permission-controller` to `^9.1.1` ([#4342](https://github.com/MetaMask/core/pull/4342)) ## [13.0.0] diff --git a/packages/selected-network-controller/package.json b/packages/selected-network-controller/package.json index 577425b060..6c966697a5 100644 --- a/packages/selected-network-controller/package.json +++ b/packages/selected-network-controller/package.json @@ -63,8 +63,8 @@ "typescript": "~4.9.5" }, "peerDependencies": { - "@metamask/network-controller": "^18.1.2", - "@metamask/permission-controller": "^9.0.0" + "@metamask/network-controller": "^18.1.3", + "@metamask/permission-controller": "^9.1.1" }, "engines": { "node": ">=16.0.0" diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index 25ca9817a5..32feb7d5b2 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -11,9 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **BREAKING:** Bump dependency and peer dependency `@metamask/approval-controller` to `^6.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING:** Bump dependency and peer dependency `@metamask/gas-fee-controller` to `^16.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) -- Bump `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) ## [30.0.0] diff --git a/packages/transaction-controller/package.json b/packages/transaction-controller/package.json index 674111bf26..5ced13eed1 100644 --- a/packages/transaction-controller/package.json +++ b/packages/transaction-controller/package.json @@ -83,9 +83,9 @@ }, "peerDependencies": { "@babel/runtime": "^7.23.9", - "@metamask/approval-controller": "^6.0.0", + "@metamask/approval-controller": "^6.0.2", "@metamask/gas-fee-controller": "^16.0.0", - "@metamask/network-controller": "^18.1.2" + "@metamask/network-controller": "^18.1.3" }, "engines": { "node": ">=16.0.0" diff --git a/packages/user-operation-controller/package.json b/packages/user-operation-controller/package.json index 9c71600794..609de2a5e1 100644 --- a/packages/user-operation-controller/package.json +++ b/packages/user-operation-controller/package.json @@ -73,7 +73,7 @@ "@metamask/approval-controller": "^6.0.2", "@metamask/gas-fee-controller": "^16.0.0", "@metamask/keyring-controller": "^16.1.0", - "@metamask/network-controller": "^18.1.2", + "@metamask/network-controller": "^18.1.3", "@metamask/transaction-controller": "^31.0.0" }, "engines": { From fc94a75bf50ca834bbbebc61d495c317ab907307 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 30 May 2024 14:29:17 -0600 Subject: [PATCH 03/18] Update ComposableController changelog Co-authored-by: Jongsun Suh --- packages/composable-controller/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/composable-controller/CHANGELOG.md b/packages/composable-controller/CHANGELOG.md index e4f1af9e1a..37b127f7de 100644 --- a/packages/composable-controller/CHANGELOG.md +++ b/packages/composable-controller/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** The `ComposableController` class is now a generic class that expects one generic argument `ComposableControllerState` ([#3952](https://github.com/MetaMask/core/pull/3952)). - **BREAKING:** For the `ComposableController` class to be typed correctly, any of its child controllers that extend `BaseControllerV1` must have an overridden `name` property that is defined using the `as const` assertion. +- **BREAKING:** The types `ComposableControllerStateChangeEvent`, `ComposableControllerEvents`, `ComposableControllerMessenger` are now generic types that expect one generic argument `ComposableControllerState` ([#3952](https://github.com/MetaMask/core/pull/3952)). - Bump `@metamask/json-rpc-engine` to `^8.0.2` ([#4234](https://github.com/MetaMask/core/pull/4234)) - Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) From 4dd5504be77e5519cdde02c638958f3fc3017884 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 30 May 2024 16:59:40 -0600 Subject: [PATCH 04/18] Update yarn.lock --- yarn.lock | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index 803f6ae04b..1d395907ff 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1635,7 +1635,7 @@ __metadata: typescript: ~4.9.5 uuid: ^8.3.2 peerDependencies: - "@metamask/keyring-controller": ^16.0.0 + "@metamask/keyring-controller": ^16.1.0 "@metamask/snaps-controllers": ^8.1.1 languageName: unknown linkType: soft @@ -1754,10 +1754,10 @@ __metadata: uuid: ^8.3.2 peerDependencies: "@metamask/accounts-controller": ^15.0.0 - "@metamask/approval-controller": ^6.0.0 - "@metamask/keyring-controller": ^16.0.0 - "@metamask/network-controller": ^18.1.2 - "@metamask/preferences-controller": ^11.0.0 + "@metamask/approval-controller": ^6.0.2 + "@metamask/keyring-controller": ^16.1.0 + "@metamask/network-controller": ^18.1.3 + "@metamask/preferences-controller": ^11.1.0 languageName: unknown linkType: soft @@ -2011,7 +2011,7 @@ __metadata: typedoc-plugin-missing-exports: ^2.0.0 typescript: ~4.9.5 peerDependencies: - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 languageName: unknown linkType: soft @@ -2331,7 +2331,7 @@ __metadata: typescript: ~4.9.5 uuid: ^8.3.2 peerDependencies: - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 languageName: unknown linkType: soft @@ -2706,7 +2706,7 @@ __metadata: typescript: ~4.9.5 uuid: ^8.3.2 peerDependencies: - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 languageName: unknown linkType: soft @@ -2807,7 +2807,7 @@ __metadata: typedoc-plugin-missing-exports: ^2.0.0 typescript: ~4.9.5 peerDependencies: - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 "@metamask/selected-network-controller": ^14.0.0 languageName: unknown linkType: soft @@ -2880,8 +2880,8 @@ __metadata: typedoc-plugin-missing-exports: ^2.0.0 typescript: ~4.9.5 peerDependencies: - "@metamask/network-controller": ^18.1.2 - "@metamask/permission-controller": ^9.0.0 + "@metamask/network-controller": ^18.1.3 + "@metamask/permission-controller": ^9.1.1 languageName: unknown linkType: soft @@ -3079,9 +3079,9 @@ __metadata: uuid: ^8.3.2 peerDependencies: "@babel/runtime": ^7.23.9 - "@metamask/approval-controller": ^6.0.0 + "@metamask/approval-controller": ^6.0.2 "@metamask/gas-fee-controller": ^16.0.0 - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 languageName: unknown linkType: soft @@ -3117,7 +3117,7 @@ __metadata: "@metamask/approval-controller": ^6.0.2 "@metamask/gas-fee-controller": ^16.0.0 "@metamask/keyring-controller": ^16.1.0 - "@metamask/network-controller": ^18.1.2 + "@metamask/network-controller": ^18.1.3 "@metamask/transaction-controller": ^31.0.0 languageName: unknown linkType: soft From c787fcafe30ab8fe204dc4999eedde3fe53d1cf0 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 30 May 2024 21:11:15 -0600 Subject: [PATCH 05/18] Add changelog entries for PR 4310 --- packages/assets-controllers/CHANGELOG.md | 37 ++++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/assets-controllers/CHANGELOG.md b/packages/assets-controllers/CHANGELOG.md index 4e73e1dc66..20f98be335 100644 --- a/packages/assets-controllers/CHANGELOG.md +++ b/packages/assets-controllers/CHANGELOG.md @@ -13,21 +13,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** The `NftDetectionController` now takes a `messenger`, which can be used for communication ([#4312](https://github.com/MetaMask/core/pull/4312)) - This messenger must allow the following actions `ApprovalController:addRequest`, `NetworkController:getState`, `NetworkController:getNetworkClientById`, and `PreferencesController:getState`, and must allow the events `PreferencesController:stateChange` and `NetworkController:stateChange` +- Add `NftDetectionControllerMessenger` type ([#4312](https://github.com/MetaMask/core/pull/4312)) +- Add `NftControllerMessenger`, `NftControllerGetStateAction`, `NftControllerActions`, `NftControllerStateChangeEvent`, and `NftControllerEvents` types ([#4310](https://github.com/MetaMask/core/pull/4310)) +- Add `NftController:getState` and `NftController:stateChange` as an available action and event to the `NftController` messenger ([#4310](https://github.com/MetaMask/core/pull/4310)) ### Changed - **BREAKING:** Change `TokensController` to inherit from `BaseController` rather than `BaseControllerV1` ([#4304](https://github.com/MetaMask/core/pull/4304)) - - The constructor arguments have changed: rather than accepting `config`, the constructor takes `selectedAddress` and `provider` instead. + - The constructor now takes a single options object rather than three arguments, and all properties in `config` are now part of options. - **BREAKING:** Rename `TokensState` type to `TokensControllerState` ([#4304](https://github.com/MetaMask/core/pull/4304)) -- **BREAKING:** Make all `TokensController` methods and properties in starting with `_` private ([#4304](https://github.com/MetaMask/core/pull/4304)) +- **BREAKING:** Make all `TokensController` methods and properties starting with `_` private ([#4304](https://github.com/MetaMask/core/pull/4304)) - **BREAKING:** Convert `Token` from `interface` to `type` ([#4304](https://github.com/MetaMask/core/pull/4304)) - **BREAKING:** Replace `balanceError` property in `Token` with `hasBalanceError`; update `TokenBalancesController` so that it no longer captures the error resulting from getting the balance of an ERC-20 token ([#4304](https://github.com/MetaMask/core/pull/4304)) - **BREAKING:** Change `NftDetectionController` to inherit from `StaticIntervalPollingController` rather than `StaticIntervalPollingControllerV1` ([#4312](https://github.com/MetaMask/core/pull/4312)) - - The constructor now takes a single options object rather than three arguments. -- **BREAKING:** Convert `ApiNft` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) -- **BREAKING:** Convert `ApiNftContract` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) -- **BREAKING:** Convert `ApiNftLastSale` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) -- **BREAKING:** Convert `ApiNftCreator` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) + - The constructor now takes a single options object rather than three arguments, and all properties in `config` are now part of options. +- **BREAKING:** Convert `ApiNft`, `ApiNftContract`, `ApiNftLastSale`, and `ApiNftCreator` from `interface` to `type` ([#4312](https://github.com/MetaMask/core/pull/4312)) +- **BREAKING:** Change `NftController` to inherit from `BaseController` rather than `BaseControllerV1` ([#4310](https://github.com/MetaMask/core/pull/4310)) + - The constructor now takes a single options object rather than three arguments, and all properties in `config` are now part of options. +- **BREAKING:** Convert `Nft`, `NftContract`, and `NftMetadata` from `interface` to `type` ([#4310](https://github.com/MetaMask/core/pull/4310)) +- **BREAKING:** Rename `NftState` to `NftControllerState`, and convert to `type` ([#4310](https://github.com/MetaMask/core/pull/4310)) +- **BREAKING:** Rename `getDefaultNftState` to `getDefaultNftControllerState` ([#4310](https://github.com/MetaMask/core/pull/4310)) - **BREAKING:** Bump dependency and peer dependency `@metamask/accounts-controller` to `^15.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING:** Bump dependency and peer dependency `@metamask/approval-controller` to `^6.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING:** Bump dependency and peer dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) @@ -40,13 +45,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed - **BREAKING:** Remove `config` property and `configure` method from `TokensController` ([#4304](https://github.com/MetaMask/core/pull/4304)) - - The `TokensController` takes a single options object which can be used for configuration, and configuration is now kept internal. + - The `TokensController` now takes a single options object which can be used for configuration, and configuration is now kept internally. - **BREAKING:** Remove `notify`, `subscribe`, and `unsubscribe` methods from `TokensController` ([#4304](https://github.com/MetaMask/core/pull/4304)) - Use the controller messenger for subscribing to and publishing events instead. - **BREAKING:** Remove `TokensConfig` type ([#4304](https://github.com/MetaMask/core/pull/4304)) - These properties have been merged into the options that `TokensController` takes. - **BREAKING:** Remove `config` property and `configure` method from `TokensController` ([#4312](https://github.com/MetaMask/core/pull/4312)) - - The `TokensController` takes a single options object which can be used for configuration, and configuration is now kept internal. + - `TokensController` now takes a single options object which can be used for configuration, and configuration is now kept internally. - **BREAKING:** Remove `notify`, `subscribe`, and `unsubscribe` methods from `NftDetectionController` ([#4312](https://github.com/MetaMask/core/pull/4312)) - Use the controller messenger for subscribing to and publishing events instead. - **BREAKING:** Remove `chainId` as a `NftDetectionController` constructor argument ([#4312](https://github.com/MetaMask/core/pull/4312)) @@ -63,6 +68,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - This was never used. - **BREAKING:** Remove `NftDetectionConfig` type ([#4312](https://github.com/MetaMask/core/pull/4312)) - These properties have been merged into the options that `NftDetectionController` takes. +- **BREAKING:** Remove `config` property and `configure` method from `NftController` ([#4310](https://github.com/MetaMask/core/pull/4310)) + - `NftController` now takes a single options object which can be used for configuration, and configuration is now kept internally. +- **BREAKING:** Remove `notify`, `subscribe`, and `unsubscribe` methods from `NftController` ([#4310](https://github.com/MetaMask/core/pull/4310)) + - Use the controller messenger for subscribing to and publishing events instead. +- **BREAKING:** Remove `onPreferencesStateChange` as a `NftController` constructor argument ([#4310](https://github.com/MetaMask/core/pull/4310)) + - The controller will now call `PreferencesController:stateChange` through the messenger object. +- **BREAKING:** Remove `onNetworkStateChange` as a `NftController` constructor argument ([#4310](https://github.com/MetaMask/core/pull/4310)) + - The controller will now call `NetworkController:stateChange` through the messenger object. +- **BREAKING:** Remove `NftConfig` type ([#4310](https://github.com/MetaMask/core/pull/4310)) + - These properties have been merged into the options that `NftController` takes. +- **BREAKING:** Remove `config` property and `configure` method from `NftController` ([#4310](https://github.com/MetaMask/core/pull/4310)) + - `NftController` now takes a single options object which can be used for configuration, and configuration is now kept internally. +- **BREAKING:** Remove `hub` property from `NftController` ([#4310](https://github.com/MetaMask/core/pull/4310)) + - Use the controller messenger for subscribing to and publishing events instead. ## [30.0.0] From cd3082dceabf5db4791f6a216f81c64c4ba924c6 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 30 May 2024 21:33:28 -0600 Subject: [PATCH 06/18] Update changelogs for PR 4319 --- packages/controller-utils/CHANGELOG.md | 5 +++++ packages/logging-controller/CHANGELOG.md | 12 ++++++++---- packages/logging-controller/package.json | 2 +- packages/message-manager/CHANGELOG.md | 11 ++++++++--- packages/message-manager/package.json | 2 +- packages/preferences-controller/CHANGELOG.md | 11 ++++++++--- packages/preferences-controller/package.json | 2 +- packages/signature-controller/CHANGELOG.md | 10 ++++++++++ packages/transaction-controller/CHANGELOG.md | 5 +++++ 9 files changed, 47 insertions(+), 13 deletions(-) diff --git a/packages/controller-utils/CHANGELOG.md b/packages/controller-utils/CHANGELOG.md index dc40a38b13..e7af4da31b 100644 --- a/packages/controller-utils/CHANGELOG.md +++ b/packages/controller-utils/CHANGELOG.md @@ -17,6 +17,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Changed price and token API endpoints from `*.metafi.codefi.network` to `*.api.cx.metamask.io` ([#4301](https://github.com/MetaMask/core/pull/4301)) +### Removed + +- **BREAKING:** Remove `EthSign` from `ApprovalType` ([#4319](https://github.com/MetaMask/core/pull/4319)) + - This represented an `eth_sign` approval, but support for that RPC method is being removed, so this is no longer needed. + ## [9.1.0] ### Added diff --git a/packages/logging-controller/CHANGELOG.md b/packages/logging-controller/CHANGELOG.md index 384aec2860..7ce4a5fc51 100644 --- a/packages/logging-controller/CHANGELOG.md +++ b/packages/logging-controller/CHANGELOG.md @@ -7,13 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [3.0.2] +## [4.0.0] -### Uncategorized +### Changed - Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +### Removed + +- **BREAKING:** Remove `EthSign` from `SigningMethod` ([#4319](https://github.com/MetaMask/core/pull/4319)) + ## [3.0.1] ### Fixed @@ -94,8 +98,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial Release - Add logging controller ([#1089](https://github.com/MetaMask/core.git/pull/1089)) -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.2...HEAD -[3.0.2]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.1...@metamask/logging-controller@3.0.2 +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@4.0.0...HEAD +[4.0.0]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.1...@metamask/logging-controller@4.0.0 [3.0.1]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@3.0.0...@metamask/logging-controller@3.0.1 [3.0.0]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@2.0.3...@metamask/logging-controller@3.0.0 [2.0.3]: https://github.com/MetaMask/core/compare/@metamask/logging-controller@2.0.2...@metamask/logging-controller@2.0.3 diff --git a/packages/logging-controller/package.json b/packages/logging-controller/package.json index 43a1e31bc3..0aaeff0caa 100644 --- a/packages/logging-controller/package.json +++ b/packages/logging-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/logging-controller", - "version": "3.0.2", + "version": "4.0.0", "description": "Manages logging data to assist users and support staff", "keywords": [ "MetaMask", diff --git a/packages/message-manager/CHANGELOG.md b/packages/message-manager/CHANGELOG.md index f55f0aa63e..df863a4c90 100644 --- a/packages/message-manager/CHANGELOG.md +++ b/packages/message-manager/CHANGELOG.md @@ -7,12 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [8.0.3] +## [9.0.0] ### Changed - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +### Removed + +- **BREAKING:** Remove `Message`, `MessageParams`, `MessageParamsMetamask`, and `MessageManager` ([#4319](https://github.com/MetaMask/core/pull/4319)) + - Support for `eth_sign` is being removed, so these are no longer needed. + ## [8.0.2] ### Changed @@ -242,8 +247,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.3...HEAD -[8.0.3]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.2...@metamask/message-manager@8.0.3 +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/message-manager@9.0.0...HEAD +[9.0.0]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.2...@metamask/message-manager@9.0.0 [8.0.2]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.1...@metamask/message-manager@8.0.2 [8.0.1]: https://github.com/MetaMask/core/compare/@metamask/message-manager@8.0.0...@metamask/message-manager@8.0.1 [8.0.0]: https://github.com/MetaMask/core/compare/@metamask/message-manager@7.3.9...@metamask/message-manager@8.0.0 diff --git a/packages/message-manager/package.json b/packages/message-manager/package.json index 158da25007..1347064bcd 100644 --- a/packages/message-manager/package.json +++ b/packages/message-manager/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/message-manager", - "version": "8.0.3", + "version": "9.0.0", "description": "Stores and manages interactions with signing requests", "keywords": [ "MetaMask", diff --git a/packages/preferences-controller/CHANGELOG.md b/packages/preferences-controller/CHANGELOG.md index 63e98f5cac..9a21ba3a23 100644 --- a/packages/preferences-controller/CHANGELOG.md +++ b/packages/preferences-controller/CHANGELOG.md @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -## [11.1.0] +## [12.0.0] ### Added @@ -22,6 +22,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +### Removed + +- **BREAKING:** Remove state property `disabledRpcMethodPreferences` along with `setDisabledRpcMethodPreferences` method ([#4319](https://github.com/MetaMask/core/pull/4319)) + - These were for disabling the `eth_sign` RPC method, but support for this method is being removed, so this preference is no longer needed. + ## [11.0.0] ### Added @@ -234,8 +239,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 All changes listed after this point were applied to this package following the monorepo conversion. -[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@11.1.0...HEAD -[11.1.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@11.0.0...@metamask/preferences-controller@11.1.0 +[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@12.0.0...HEAD +[12.0.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@11.0.0...@metamask/preferences-controller@12.0.0 [11.0.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@10.0.0...@metamask/preferences-controller@11.0.0 [10.0.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@9.0.1...@metamask/preferences-controller@10.0.0 [9.0.1]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@9.0.0...@metamask/preferences-controller@9.0.1 diff --git a/packages/preferences-controller/package.json b/packages/preferences-controller/package.json index a1c28c828d..077bd6de2d 100644 --- a/packages/preferences-controller/package.json +++ b/packages/preferences-controller/package.json @@ -1,6 +1,6 @@ { "name": "@metamask/preferences-controller", - "version": "11.1.0", + "version": "12.0.0", "description": "Manages user-configurable settings for MetaMask", "keywords": [ "MetaMask", diff --git a/packages/signature-controller/CHANGELOG.md b/packages/signature-controller/CHANGELOG.md index b0b1ccdcca..e93cac2449 100644 --- a/packages/signature-controller/CHANGELOG.md +++ b/packages/signature-controller/CHANGELOG.md @@ -11,11 +11,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- **BREAKING:** Update `messages` getter to return `Record` instead of `Record` ([#4319](https://github.com/MetaMask/core/pull/4319)) - **BREAKING** Bump `@metamask/keyring-controller` peer dependency to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING** Bump `@metamask/logging-controller` peer dependency to `^3.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump `@metamask/message-manager` to `^8.0.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +### Removed + +- **BREAKING:** Remove state properties `unapprovedMsgs` and `unapprovedMsgCount` ([#4319](https://github.com/MetaMask/core/pull/4319)) + - These properties were related to handling of the `eth_sign` RPC method, but support for that is being removed, so these are no longer needed. +- **BREAKING:** Remove `isEthSignEnabled` option from constructor ([#4319](https://github.com/MetaMask/core/pull/4319)) + - This option governed whether handling of the `eth_sign` RPC method was enabled, but support for that method is being removed, so this is no longer needed. +- **BREAKING:** Remove `newUnsignedMessage` method ([#4319](https://github.com/MetaMask/core/pull/4319)) + - This method was called when a dapp used the `eth_sign` RPC method, but support for that method is being removed, so this is no longer needed. + ## [16.0.0] ### Changed diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index 32feb7d5b2..6433c0bf06 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -16,6 +16,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +### Removed + +- **BREAKING:** Remove `sign` from `TransactionType` ([#4319](https://github.com/MetaMask/core/pull/4319)) + - This represented an `eth_sign` transaction, but support for that RPC method is being removed, so this is no longer needed. + ## [30.0.0] ### Fixed From 73d9d77f5ab187c580ac41c9a58ae8993eac4db6 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 30 May 2024 21:35:58 -0600 Subject: [PATCH 07/18] Update references to versions in changelogs --- packages/assets-controllers/CHANGELOG.md | 2 +- packages/assets-controllers/package.json | 4 ++-- packages/keyring-controller/CHANGELOG.md | 2 +- packages/keyring-controller/package.json | 2 +- packages/signature-controller/CHANGELOG.md | 4 ++-- packages/signature-controller/package.json | 6 +++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/assets-controllers/CHANGELOG.md b/packages/assets-controllers/CHANGELOG.md index 20f98be335..23f0b07e7d 100644 --- a/packages/assets-controllers/CHANGELOG.md +++ b/packages/assets-controllers/CHANGELOG.md @@ -37,7 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Bump dependency and peer dependency `@metamask/approval-controller` to `^6.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING:** Bump dependency and peer dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) -- **BREAKING:** Bump dependency and peer dependency `@metamask/preferences-controller` to `^11.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** Bump dependency and peer dependency `@metamask/preferences-controller` to `^12.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Change `NftDetectionController` method `detectNfts` so that `userAddress` option is optional ([#4312](https://github.com/MetaMask/core/pull/4312)) - This will default to the currently selected address as kept by PreferencesController. - Bump dependency `@metamask/polling-controller` to `^7.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) diff --git a/packages/assets-controllers/package.json b/packages/assets-controllers/package.json index 2391a69a05..2d05282e9d 100644 --- a/packages/assets-controllers/package.json +++ b/packages/assets-controllers/package.json @@ -57,7 +57,7 @@ "@metamask/metamask-eth-abis": "^3.1.1", "@metamask/network-controller": "^18.1.3", "@metamask/polling-controller": "^7.0.0", - "@metamask/preferences-controller": "^11.1.0", + "@metamask/preferences-controller": "^12.0.0", "@metamask/rpc-errors": "^6.2.1", "@metamask/utils": "^8.3.0", "@types/bn.js": "^5.1.5", @@ -92,7 +92,7 @@ "@metamask/approval-controller": "^6.0.2", "@metamask/keyring-controller": "^16.1.0", "@metamask/network-controller": "^18.1.3", - "@metamask/preferences-controller": "^11.1.0" + "@metamask/preferences-controller": "^12.0.0" }, "engines": { "node": ">=16.0.0" diff --git a/packages/keyring-controller/CHANGELOG.md b/packages/keyring-controller/CHANGELOG.md index db683f1f0b..46c1e22771 100644 --- a/packages/keyring-controller/CHANGELOG.md +++ b/packages/keyring-controller/CHANGELOG.md @@ -21,7 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump `@metamask/keyring-api` to `^6.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) - Bump `@keystonehq/metamask-airgapped-keyring` to `^0.14.1` ([#4277](https://github.com/MetaMask/core/pull/4277)) -- Bump `@metamask/message-manager` to `^8.0.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/message-manager` to `^9.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) ### Fixed diff --git a/packages/keyring-controller/package.json b/packages/keyring-controller/package.json index 40d296b221..a2cb8f04df 100644 --- a/packages/keyring-controller/package.json +++ b/packages/keyring-controller/package.json @@ -49,7 +49,7 @@ "@metamask/eth-sig-util": "^7.0.1", "@metamask/eth-simple-keyring": "^6.0.1", "@metamask/keyring-api": "^6.1.1", - "@metamask/message-manager": "^8.0.3", + "@metamask/message-manager": "^9.0.0", "@metamask/utils": "^8.3.0", "async-mutex": "^0.2.6", "ethereumjs-wallet": "^1.0.1", diff --git a/packages/signature-controller/CHANGELOG.md b/packages/signature-controller/CHANGELOG.md index e93cac2449..cfe194fb39 100644 --- a/packages/signature-controller/CHANGELOG.md +++ b/packages/signature-controller/CHANGELOG.md @@ -13,9 +13,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Update `messages` getter to return `Record` instead of `Record` ([#4319](https://github.com/MetaMask/core/pull/4319)) - **BREAKING** Bump `@metamask/keyring-controller` peer dependency to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) -- **BREAKING** Bump `@metamask/logging-controller` peer dependency to `^3.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING** Bump `@metamask/logging-controller` peer dependency to `^4.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) -- Bump `@metamask/message-manager` to `^8.0.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `@metamask/message-manager` to `^9.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) ### Removed diff --git a/packages/signature-controller/package.json b/packages/signature-controller/package.json index 7f061dd05d..a932ba1980 100644 --- a/packages/signature-controller/package.json +++ b/packages/signature-controller/package.json @@ -45,8 +45,8 @@ "@metamask/base-controller": "^5.0.2", "@metamask/controller-utils": "^10.0.0", "@metamask/keyring-controller": "^16.1.0", - "@metamask/logging-controller": "^3.0.2", - "@metamask/message-manager": "^8.0.3", + "@metamask/logging-controller": "^4.0.0", + "@metamask/message-manager": "^9.0.0", "@metamask/rpc-errors": "^6.2.1", "@metamask/utils": "^8.3.0", "lodash": "^4.17.21" @@ -64,7 +64,7 @@ "peerDependencies": { "@metamask/approval-controller": "^6.0.0", "@metamask/keyring-controller": "^16.1.0", - "@metamask/logging-controller": "^3.0.2" + "@metamask/logging-controller": "^4.0.0" }, "engines": { "node": ">=16.0.0" From 2064bbadc8de377950d4f18469c9186104181e9c Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 30 May 2024 21:38:09 -0600 Subject: [PATCH 08/18] Update changelogs for PR 4335 --- packages/assets-controllers/CHANGELOG.md | 3 ++- packages/keyring-controller/CHANGELOG.md | 1 + packages/name-controller/CHANGELOG.md | 1 + packages/network-controller/CHANGELOG.md | 1 + packages/transaction-controller/CHANGELOG.md | 1 + 5 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/assets-controllers/CHANGELOG.md b/packages/assets-controllers/CHANGELOG.md index 23f0b07e7d..2f99546055 100644 --- a/packages/assets-controllers/CHANGELOG.md +++ b/packages/assets-controllers/CHANGELOG.md @@ -40,7 +40,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Bump dependency and peer dependency `@metamask/preferences-controller` to `^12.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - Change `NftDetectionController` method `detectNfts` so that `userAddress` option is optional ([#4312](https://github.com/MetaMask/core/pull/4312)) - This will default to the currently selected address as kept by PreferencesController. -- Bump dependency `@metamask/polling-controller` to `^7.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `async-mutex` to `^0.5.0` ([#4335](https://github.com/MetaMask/core/pull/4335)) +- Bump `@metamask/polling-controller` to `^7.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) ### Removed diff --git a/packages/keyring-controller/CHANGELOG.md b/packages/keyring-controller/CHANGELOG.md index 46c1e22771..019d78f3ac 100644 --- a/packages/keyring-controller/CHANGELOG.md +++ b/packages/keyring-controller/CHANGELOG.md @@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump `@metamask/keyring-api` to `^6.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) - Bump `@keystonehq/metamask-airgapped-keyring` to `^0.14.1` ([#4277](https://github.com/MetaMask/core/pull/4277)) +- Bump `async-mutex` to `^0.5.0` ([#4335](https://github.com/MetaMask/core/pull/4335)) - Bump `@metamask/message-manager` to `^9.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) ### Fixed diff --git a/packages/name-controller/CHANGELOG.md b/packages/name-controller/CHANGELOG.md index 61e79d7191..805202531c 100644 --- a/packages/name-controller/CHANGELOG.md +++ b/packages/name-controller/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Changed token API endpoint from `*.metafi.codefi.network` to `*.api.cx.metamask.io` ([#4301](https://github.com/MetaMask/core/pull/4301)) - Bump `@metamask/base-controller` to `^5.0.2` ([#4232](https://github.com/MetaMask/core/pull/4232)) +- Bump `async-mutex` to `^0.5.0` ([#4335](https://github.com/MetaMask/core/pull/4335)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) ### Fixed diff --git a/packages/network-controller/CHANGELOG.md b/packages/network-controller/CHANGELOG.md index 9b94d83554..51af38e73e 100644 --- a/packages/network-controller/CHANGELOG.md +++ b/packages/network-controller/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Bump `async-mutex` to `^0.5.0` ([#4335](https://github.com/MetaMask/core/pull/4335)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) ## [18.1.2] diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index 6433c0bf06..cc54f9021c 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** Bump dependency and peer dependency `@metamask/approval-controller` to `^6.0.2` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING:** Bump dependency and peer dependency `@metamask/gas-fee-controller` to `^16.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) - **BREAKING:** Bump dependency and peer dependency `@metamask/network-controller` to `^18.1.3` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- Bump `async-mutex` to `^0.5.0` ([#4335](https://github.com/MetaMask/core/pull/4335)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) ### Removed From 23ad3988ca74637e17173504bd3cc37d1a27fcd0 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Thu, 30 May 2024 21:40:48 -0600 Subject: [PATCH 09/18] Update lockfile --- yarn.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index a7ba4ab20b..9c0126e9f2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1728,7 +1728,7 @@ __metadata: "@metamask/metamask-eth-abis": ^3.1.1 "@metamask/network-controller": ^18.1.3 "@metamask/polling-controller": ^7.0.0 - "@metamask/preferences-controller": ^11.1.0 + "@metamask/preferences-controller": ^12.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 "@types/bn.js": ^5.1.5 @@ -1757,7 +1757,7 @@ __metadata: "@metamask/approval-controller": ^6.0.2 "@metamask/keyring-controller": ^16.1.0 "@metamask/network-controller": ^18.1.3 - "@metamask/preferences-controller": ^11.1.0 + "@metamask/preferences-controller": ^12.0.0 languageName: unknown linkType: soft @@ -2434,7 +2434,7 @@ __metadata: "@metamask/eth-sig-util": ^7.0.1 "@metamask/eth-simple-keyring": ^6.0.1 "@metamask/keyring-api": ^6.1.1 - "@metamask/message-manager": ^8.0.3 + "@metamask/message-manager": ^9.0.0 "@metamask/scure-bip39": ^2.1.1 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 @@ -2453,7 +2453,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/logging-controller@^3.0.2, @metamask/logging-controller@workspace:packages/logging-controller": +"@metamask/logging-controller@^4.0.0, @metamask/logging-controller@workspace:packages/logging-controller": version: 0.0.0-use.local resolution: "@metamask/logging-controller@workspace:packages/logging-controller" dependencies: @@ -2471,7 +2471,7 @@ __metadata: languageName: unknown linkType: soft -"@metamask/message-manager@^8.0.3, @metamask/message-manager@workspace:packages/message-manager": +"@metamask/message-manager@^9.0.0, @metamask/message-manager@workspace:packages/message-manager": version: 0.0.0-use.local resolution: "@metamask/message-manager@workspace:packages/message-manager" dependencies: @@ -2720,7 +2720,7 @@ __metadata: languageName: node linkType: hard -"@metamask/preferences-controller@^11.1.0, @metamask/preferences-controller@workspace:packages/preferences-controller": +"@metamask/preferences-controller@^12.0.0, @metamask/preferences-controller@workspace:packages/preferences-controller": version: 0.0.0-use.local resolution: "@metamask/preferences-controller@workspace:packages/preferences-controller" dependencies: @@ -2894,8 +2894,8 @@ __metadata: "@metamask/base-controller": ^5.0.2 "@metamask/controller-utils": ^10.0.0 "@metamask/keyring-controller": ^16.1.0 - "@metamask/logging-controller": ^3.0.2 - "@metamask/message-manager": ^8.0.3 + "@metamask/logging-controller": ^4.0.0 + "@metamask/message-manager": ^9.0.0 "@metamask/rpc-errors": ^6.2.1 "@metamask/utils": ^8.3.0 "@types/jest": ^27.4.1 @@ -2909,7 +2909,7 @@ __metadata: peerDependencies: "@metamask/approval-controller": ^6.0.0 "@metamask/keyring-controller": ^16.1.0 - "@metamask/logging-controller": ^3.0.2 + "@metamask/logging-controller": ^4.0.0 languageName: unknown linkType: soft From 2d49b6830d5f21fa19f0f7a56ef450e3babde701 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Fri, 31 May 2024 09:19:48 -0600 Subject: [PATCH 10/18] Remove mention of NftControllerMessenger Co-authored-by: Jongsun Suh --- packages/assets-controllers/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/assets-controllers/CHANGELOG.md b/packages/assets-controllers/CHANGELOG.md index 2f99546055..d44448577a 100644 --- a/packages/assets-controllers/CHANGELOG.md +++ b/packages/assets-controllers/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **BREAKING:** The `NftDetectionController` now takes a `messenger`, which can be used for communication ([#4312](https://github.com/MetaMask/core/pull/4312)) - This messenger must allow the following actions `ApprovalController:addRequest`, `NetworkController:getState`, `NetworkController:getNetworkClientById`, and `PreferencesController:getState`, and must allow the events `PreferencesController:stateChange` and `NetworkController:stateChange` - Add `NftDetectionControllerMessenger` type ([#4312](https://github.com/MetaMask/core/pull/4312)) -- Add `NftControllerMessenger`, `NftControllerGetStateAction`, `NftControllerActions`, `NftControllerStateChangeEvent`, and `NftControllerEvents` types ([#4310](https://github.com/MetaMask/core/pull/4310)) +- Add `NftControllerGetStateAction`, `NftControllerActions`, `NftControllerStateChangeEvent`, and `NftControllerEvents` types ([#4310](https://github.com/MetaMask/core/pull/4310)) - Add `NftController:getState` and `NftController:stateChange` as an available action and event to the `NftController` messenger ([#4310](https://github.com/MetaMask/core/pull/4310)) ### Changed From 5ab41c6b09c47801940f2b178541f3e0bcc26210 Mon Sep 17 00:00:00 2001 From: Monte Lai Date: Fri, 31 May 2024 17:51:18 +0800 Subject: [PATCH 11/18] feat: add getSelectedMultichainAccount and listMultichainAccounts (#4330) ## Explanation This pull request adds two new methods `getSelectedMultichainAccount`, `listMultichainAccounts` and `selectedEvmAccountChange` event. The optional arguments are to make the changes backwards compatible when used with evm specific controllers. ## References Related to: - [381](https://github.com/MetaMask/accounts-planning/issues/381) - [419](https://github.com/MetaMask/accounts-planning/issues/419) ## Changelog ### `@metamask/accounts-controller` - ****: Adds two new methods `getSelectedMultichainAccount`, `listMultichainAccounts`, and `selectedEvmAccountChange` event ## 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: Charly Chevalier --- packages/accounts-controller/jest.config.js | 2 + .../src/AccountsController.test.ts | 613 ++++++++++++++---- .../src/AccountsController.ts | 154 ++++- packages/accounts-controller/src/index.ts | 2 + .../src/tests/mocks.test.ts | 77 +++ .../accounts-controller/src/tests/mocks.ts | 79 +++ 6 files changed, 798 insertions(+), 129 deletions(-) create mode 100644 packages/accounts-controller/src/tests/mocks.test.ts create mode 100644 packages/accounts-controller/src/tests/mocks.ts diff --git a/packages/accounts-controller/jest.config.js b/packages/accounts-controller/jest.config.js index ca08413339..d6e04ca78a 100644 --- a/packages/accounts-controller/jest.config.js +++ b/packages/accounts-controller/jest.config.js @@ -14,6 +14,8 @@ module.exports = merge(baseConfig, { // The display name when running multiple projects displayName, + coveragePathIgnorePatterns: ['./src/tests'], + // An object that configures minimum threshold enforcement for coverage results coverageThreshold: { global: { diff --git a/packages/accounts-controller/src/AccountsController.test.ts b/packages/accounts-controller/src/AccountsController.test.ts index 270274973e..385bf21187 100644 --- a/packages/accounts-controller/src/AccountsController.test.ts +++ b/packages/accounts-controller/src/AccountsController.test.ts @@ -1,9 +1,19 @@ import { ControllerMessenger } from '@metamask/base-controller'; -import type { InternalAccount } from '@metamask/keyring-api'; -import { EthAccountType, EthMethod } from '@metamask/keyring-api'; +import type { + InternalAccount, + InternalAccountType, +} from '@metamask/keyring-api'; +import { + BtcAccountType, + BtcMethod, + EthAccountType, + EthErc4337Method, + EthMethod, +} from '@metamask/keyring-api'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { SnapControllerState } from '@metamask/snaps-controllers'; import { SnapStatus } from '@metamask/snaps-utils'; +import type { CaipChainId } from '@metamask/utils'; import * as uuid from 'uuid'; import type { V4Options } from 'uuid'; @@ -15,6 +25,7 @@ import type { AllowedEvents, } from './AccountsController'; import { AccountsController } from './AccountsController'; +import { createMockInternalAccount } from './tests/mocks'; import { getUUIDOptionsFromAddressOfNormalAccount, keyringTypeToName, @@ -145,6 +156,9 @@ class MockNormalAccountUUID { * @param props.keyringType - The type of the keyring associated with the account. * @param props.snapId - The id of the snap. * @param props.snapEnabled - The status of the snap + * @param props.type - Account Type to create + * @param props.importTime - The import time of the account. + * @param props.lastSelected - The last selected time of the account. * @returns The `InternalAccount` object created from the normal account properties. */ function createExpectedInternalAccount({ @@ -154,6 +168,9 @@ function createExpectedInternalAccount({ keyringType, snapId, snapEnabled = true, + type = EthAccountType.Eoa, + importTime, + lastSelected, }: { id: string; name: string; @@ -161,20 +178,32 @@ function createExpectedInternalAccount({ keyringType: string; snapId?: string; snapEnabled?: boolean; + type?: InternalAccountType; + importTime?: number; + lastSelected?: number; }): InternalAccount { - const account: InternalAccount = { + const accountTypeToMethods = { + [`${EthAccountType.Eoa}`]: [...Object.values(EthMethod)], + [`${EthAccountType.Erc4337}`]: [...Object.values(EthErc4337Method)], + [`${BtcAccountType.P2wpkh}`]: [...Object.values(BtcMethod)], + }; + + const methods = + accountTypeToMethods[type as unknown as keyof typeof accountTypeToMethods]; + + const account = { id, address, options: {}, - methods: [...EOA_METHODS], - type: EthAccountType.Eoa, + methods, + type, metadata: { name, keyring: { type: keyringType }, - importTime: expect.any(Number), - lastSelected: expect.any(Number), + importTime: importTime || expect.any(Number), + lastSelected: lastSelected || expect.any(Number), }, - }; + } as InternalAccount; if (snapId) { account.metadata.snap = { @@ -259,7 +288,13 @@ function setupAccountsController({ AccountsControllerActions | AllowedActions, AccountsControllerEvents | AllowedEvents >; -}): AccountsController { +}): { + accountsController: AccountsController; + messenger: ControllerMessenger< + AccountsControllerActions | AllowedActions, + AccountsControllerEvents | AllowedEvents + >; +} { const accountsControllerMessenger = buildAccountsControllerMessenger(messenger); @@ -267,7 +302,7 @@ function setupAccountsController({ messenger: accountsControllerMessenger, state: { ...defaultState, ...initialState }, }); - return accountsController; + return { accountsController, messenger }; } describe('AccountsController', () => { @@ -276,7 +311,7 @@ describe('AccountsController', () => { }); describe('onSnapStateChange', () => { - it('should be used enable an account if the snap is enabled and not blocked', async () => { + it('be used enable an account if the Snap is enabled and not blocked', async () => { const messenger = buildMessenger(); const mockSnapAccount = createExpectedInternalAccount({ id: 'mock-id', @@ -298,7 +333,7 @@ describe('AccountsController', () => { // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any as SnapControllerState; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -319,7 +354,7 @@ describe('AccountsController', () => { expect(updatedAccount.metadata.snap?.enabled).toBe(true); }); - it('should be used disable an account if the snap is disabled', async () => { + it('be used disable an account if the Snap is disabled', async () => { const messenger = buildMessenger(); const mockSnapAccount = createExpectedInternalAccount({ id: 'mock-id', @@ -340,7 +375,7 @@ describe('AccountsController', () => { // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any as SnapControllerState; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -361,7 +396,7 @@ describe('AccountsController', () => { expect(updatedAccount.metadata.snap?.enabled).toBe(false); }); - it('should be used disable an account if the snap is blocked', async () => { + it('be used disable an account if the Snap is blocked', async () => { const messenger = buildMessenger(); const mockSnapAccount = createExpectedInternalAccount({ id: 'mock-id', @@ -382,7 +417,7 @@ describe('AccountsController', () => { // TODO: Replace `any` with type // eslint-disable-next-line @typescript-eslint/no-explicit-any } as any as SnapControllerState; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -408,9 +443,9 @@ describe('AccountsController', () => { afterEach(() => { jest.clearAllMocks(); }); - it('should not update state when only keyring is unlocked without any keyrings', async () => { + it('not update state when only keyring is unlocked without any keyrings', async () => { const messenger = buildMessenger(); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -431,7 +466,7 @@ describe('AccountsController', () => { expect(accounts).toStrictEqual([]); }); - it('should only update if the keyring is unlocked and when there are keyrings', async () => { + it('only update if the keyring is unlocked and when there are keyrings', async () => { const messenger = buildMessenger(); const mockNewKeyringState = { @@ -443,7 +478,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -465,7 +500,7 @@ describe('AccountsController', () => { }); describe('adding accounts', () => { - it('should add new accounts', async () => { + it('add new accounts', async () => { const messenger = buildMessenger(); mockUUID .mockReturnValueOnce('mock-id') // call to check if its a new account @@ -481,7 +516,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -508,7 +543,7 @@ describe('AccountsController', () => { ]); }); - it('should add snap accounts', async () => { + it('add Snap accounts', async () => { mockUUID.mockReturnValueOnce('mock-id'); // call to check if its a new account const messenger = buildMessenger(); @@ -539,7 +574,7 @@ describe('AccountsController', () => { ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -575,7 +610,7 @@ describe('AccountsController', () => { ]); }); - it('should handle the event when a snap deleted the account before the it was added', async () => { + it('handle the event when a Snap deleted the account before the it was added', async () => { mockUUID.mockReturnValueOnce('mock-id'); // call to check if its a new account const messenger = buildMessenger(); messenger.registerActionHandler( @@ -605,7 +640,7 @@ describe('AccountsController', () => { ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -632,7 +667,7 @@ describe('AccountsController', () => { ]); }); - it('should increment the default account number when adding an account', async () => { + it('increment the default account number when adding an account', async () => { const messenger = buildMessenger(); mockUUID .mockReturnValueOnce('mock-id') // call to check if its a new account @@ -653,7 +688,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -688,7 +723,7 @@ describe('AccountsController', () => { ]); }); - it('should use the next number after the total number of accounts of a keyring when adding an account, if the index is lower', async () => { + it('use the next number after the total number of accounts of a keyring when adding an account, if the index is lower', async () => { const messenger = buildMessenger(); mockUUID .mockReturnValueOnce('mock-id') // call to check if its a new account @@ -701,6 +736,8 @@ describe('AccountsController', () => { name: 'Custom Name', address: mockAccount2.address, keyringType: KeyringTypes.hd, + importTime: 1955565967656, + lastSelected: 1955565967656, }); const mockNewKeyringState = { @@ -716,7 +753,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -749,7 +786,7 @@ describe('AccountsController', () => { ]); }); - it('should handle when the account to set as selectedAccount is undefined', async () => { + it('handle when the account to set as selectedAccount is undefined', async () => { mockUUID.mockReturnValueOnce('mock-id'); // call to check if its a new account const messenger = buildMessenger(); @@ -777,7 +814,7 @@ describe('AccountsController', () => { ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -800,7 +837,7 @@ describe('AccountsController', () => { }); describe('deleting account', () => { - it('should delete accounts if its gone from the keyring state', async () => { + it('delete accounts if its gone from the keyring state', async () => { const messenger = buildMessenger(); mockUUID.mockReturnValueOnce('mock-id2'); @@ -813,7 +850,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -840,7 +877,7 @@ describe('AccountsController', () => { ); }); - it('should delete accounts and set the most recent lastSelected account', async () => { + it('delete accounts and set the most recent lastSelected account', async () => { const messenger = buildMessenger(); mockUUID .mockReturnValueOnce('mock-id') @@ -857,7 +894,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -896,7 +933,7 @@ describe('AccountsController', () => { ); }); - it('should delete accounts and set the most recent lastSelected account when there are accounts that have never been selected', async () => { + it('delete accounts and set the most recent lastSelected account when there are accounts that have never been selected', async () => { const messenger = buildMessenger(); mockUUID .mockReturnValueOnce('mock-id') @@ -920,7 +957,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -959,7 +996,7 @@ describe('AccountsController', () => { ); }); - it('should delete the account and select the account with the most recent lastSelected', async () => { + it('delete the account and select the account with the most recent lastSelected', async () => { const messenger = buildMessenger(); mockUUID.mockReturnValueOnce('mock-id').mockReturnValueOnce('mock-id2'); @@ -991,7 +1028,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -1023,16 +1060,16 @@ describe('AccountsController', () => { const accounts = accountsController.listAccounts(); expect(accounts).toStrictEqual([ - setLastSelectedAsAny(mockAccountWithoutLastSelected), + mockAccountWithoutLastSelected, mockAccount2WithoutLastSelected, ]); expect(accountsController.getSelectedAccount()).toStrictEqual( - setLastSelectedAsAny(mockAccountWithoutLastSelected), + mockAccountWithoutLastSelected, ); }); }); - it('should handle keyring reinitialization', async () => { + it('handle keyring reinitialization', async () => { const messenger = buildMessenger(); const mockInitialAccount = createExpectedInternalAccount({ id: 'mock-id', @@ -1059,7 +1096,7 @@ describe('AccountsController', () => { }, ], }; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -1084,6 +1121,90 @@ describe('AccountsController', () => { expect(selectedAccount).toStrictEqual(expectedAccount); expect(accounts).toStrictEqual([expectedAccount]); }); + + it.each([ + { + lastSelectedForAccount1: 1111, + lastSelectedForAccount2: 9999, + expectedSelectedId: 'mock-id2', + }, + { + lastSelectedForAccount1: undefined, + lastSelectedForAccount2: 9999, + expectedSelectedId: 'mock-id2', + }, + { + lastSelectedForAccount1: 1111, + lastSelectedForAccount2: undefined, + expectedSelectedId: 'mock-id', + }, + { + lastSelectedForAccount1: 1111, + lastSelectedForAccount2: 0, + expectedSelectedId: 'mock-id', + }, + ])( + 'handle keyring reinitialization with multiple accounts. Account 1 lastSelected $lastSelectedForAccount1, Account 2 lastSelected $lastSelectedForAccount2. Expected selected account: $expectedSelectedId', + async ({ + lastSelectedForAccount1, + lastSelectedForAccount2, + expectedSelectedId, + }) => { + const messenger = buildMessenger(); + const mockExistingAccount1 = createExpectedInternalAccount({ + id: 'mock-id', + name: 'Account 1', + address: '0x123', + keyringType: KeyringTypes.hd, + }); + mockExistingAccount1.metadata.lastSelected = lastSelectedForAccount1; + const mockExistingAccount2 = createExpectedInternalAccount({ + id: 'mock-id2', + name: 'Account 2', + address: '0x456', + keyringType: KeyringTypes.hd, + }); + mockExistingAccount2.metadata.lastSelected = lastSelectedForAccount2; + + mockUUID + .mockReturnValueOnce('mock-id') // call to check if its a new account + .mockReturnValueOnce('mock-id2'); // call to check if its a new account + + const { accountsController } = setupAccountsController({ + initialState: { + internalAccounts: { + accounts: { + [mockExistingAccount1.id]: mockExistingAccount1, + [mockExistingAccount2.id]: mockExistingAccount2, + }, + selectedAccount: 'unknown', + }, + }, + messenger, + }); + const mockNewKeyringState = { + isUnlocked: true, + keyrings: [ + { + type: KeyringTypes.hd, + accounts: [ + mockExistingAccount1.address, + mockExistingAccount2.address, + ], + }, + ], + }; + messenger.publish( + 'KeyringController:stateChange', + mockNewKeyringState, + [], + ); + + const selectedAccount = accountsController.getSelectedAccount(); + + expect(selectedAccount.id).toStrictEqual(expectedSelectedId); + }, + ); }); describe('updateAccounts', () => { @@ -1134,7 +1255,7 @@ describe('AccountsController', () => { jest.clearAllMocks(); }); - it('should update accounts with normal accounts', async () => { + it('update accounts with normal accounts', async () => { mockUUID.mockReturnValueOnce('mock-id').mockReturnValueOnce('mock-id2'); const messenger = buildMessenger(); messenger.registerActionHandler( @@ -1157,7 +1278,7 @@ describe('AccountsController', () => { ]), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -1186,7 +1307,7 @@ describe('AccountsController', () => { expect(accountsController.listAccounts()).toStrictEqual(expectedAccounts); }); - it('should update accounts with snap accounts when snap keyring is defined and has accounts', async () => { + it('update accounts with Snap accounts when snap keyring is defined and has accounts', async () => { const messenger = buildMessenger(); messenger.registerActionHandler( 'KeyringController:getAccounts', @@ -1203,7 +1324,7 @@ describe('AccountsController', () => { ]), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -1242,7 +1363,7 @@ describe('AccountsController', () => { ).toStrictEqual(expectedAccounts); }); - it('should return an empty array if the snap keyring is not defined', async () => { + it('return an empty array if the Snap keyring is not defined', async () => { const messenger = buildMessenger(); messenger.registerActionHandler( 'KeyringController:getAccounts', @@ -1254,7 +1375,7 @@ describe('AccountsController', () => { mockGetKeyringByType.mockReturnValueOnce([undefined]), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -1271,7 +1392,7 @@ describe('AccountsController', () => { expect(accountsController.listAccounts()).toStrictEqual(expectedAccounts); }); - it('should set the account with the correct index', async () => { + it('set the account with the correct index', async () => { mockUUID.mockReturnValueOnce('mock-id').mockReturnValueOnce('mock-id2'); const messenger = buildMessenger(); messenger.registerActionHandler( @@ -1294,7 +1415,7 @@ describe('AccountsController', () => { ]), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -1320,7 +1441,7 @@ describe('AccountsController', () => { expect(accountsController.listAccounts()).toStrictEqual(expectedAccounts); }); - it('should filter snap accounts from normalAccounts', async () => { + it('filter Snap accounts from normalAccounts', async () => { mockUUID.mockReturnValueOnce('mock-id'); const messenger = buildMessenger(); messenger.registerActionHandler( @@ -1345,7 +1466,7 @@ describe('AccountsController', () => { .mockResolvedValueOnce({ type: KeyringTypes.snap }), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -1375,7 +1496,7 @@ describe('AccountsController', () => { expect(accountsController.listAccounts()).toStrictEqual(expectedAccounts); }); - it('should filter snap accounts from normalAccounts even if the snap account is listed before normal accounts', async () => { + it('filter Snap accounts from normalAccounts even if the snap account is listed before normal accounts', async () => { mockUUID.mockReturnValue('mock-id'); const messenger = buildMessenger(); messenger.registerActionHandler( @@ -1400,7 +1521,7 @@ describe('AccountsController', () => { .mockResolvedValueOnce({ type: KeyringTypes.hd }), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -1462,7 +1583,7 @@ describe('AccountsController', () => { ]), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -1488,7 +1609,7 @@ describe('AccountsController', () => { ).toStrictEqual(expectedAccounts); }); - it('should throw an error if the keyring type is unknown', async () => { + it('throw an error if the keyring type is unknown', async () => { mockUUID.mockReturnValue('mock-id'); const messenger = buildMessenger(); @@ -1511,7 +1632,7 @@ describe('AccountsController', () => { ]), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -1528,8 +1649,8 @@ describe('AccountsController', () => { }); describe('loadBackup', () => { - it('should load a backup', async () => { - const accountsController = setupAccountsController({ + it('load a backup', async () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: {}, @@ -1557,8 +1678,8 @@ describe('AccountsController', () => { }); }); - it('should not load backup if the data is undefined', () => { - const accountsController = setupAccountsController({ + it('not load backup if the data is undefined', () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1582,8 +1703,8 @@ describe('AccountsController', () => { }); describe('getAccount', () => { - it('should return an account by ID', () => { - const accountsController = setupAccountsController({ + it('return an account by ID', () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1598,8 +1719,8 @@ describe('AccountsController', () => { setLastSelectedAsAny(mockAccount as InternalAccount), ); }); - it('should return undefined for an unknown account ID', () => { - const accountsController = setupAccountsController({ + it('return undefined for an unknown account ID', () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1614,32 +1735,260 @@ describe('AccountsController', () => { }); }); + describe('getSelectedAccount', () => { + const mockNonEvmAccount = createExpectedInternalAccount({ + id: 'mock-non-evm', + name: 'non-evm', + address: 'bc1qzqc2aqlw8nwa0a05ehjkk7dgt8308ac7kzw9a6', + keyringType: KeyringTypes.snap, + type: BtcAccountType.P2wpkh, + }); + + const mockOlderEvmAccount = createExpectedInternalAccount({ + id: 'mock-id-1', + name: 'mock account 1', + address: 'mock-address-1', + keyringType: KeyringTypes.hd, + lastSelected: 11111, + }); + const mockNewerEvmAccount = createExpectedInternalAccount({ + id: 'mock-id-2', + name: 'mock account 2', + address: 'mock-address-2', + keyringType: KeyringTypes.hd, + lastSelected: 22222, + }); + + it.each([ + { + lastSelectedAccount: mockNewerEvmAccount, + expected: mockNewerEvmAccount, + }, + { + lastSelectedAccount: mockOlderEvmAccount, + expected: mockOlderEvmAccount, + }, + { + lastSelectedAccount: mockNonEvmAccount, + expected: mockNewerEvmAccount, + }, + ])( + 'last selected account type is $lastSelectedAccount.type should return the selectedAccount with id $expected.id', + ({ lastSelectedAccount, expected }) => { + const { accountsController } = setupAccountsController({ + initialState: { + internalAccounts: { + accounts: { + [mockOlderEvmAccount.id]: mockOlderEvmAccount, + [mockNewerEvmAccount.id]: mockNewerEvmAccount, + [mockNonEvmAccount.id]: mockNonEvmAccount, + }, + selectedAccount: lastSelectedAccount.id, + }, + }, + }); + + expect(accountsController.getSelectedAccount()).toStrictEqual(expected); + }, + ); + + it("throw error if there aren't any EVM accounts", () => { + const { accountsController } = setupAccountsController({ + initialState: { + internalAccounts: { + accounts: { + [mockNonEvmAccount.id]: mockNonEvmAccount, + }, + selectedAccount: mockNonEvmAccount.id, + }, + }, + }); + + expect(() => accountsController.getSelectedAccount()).toThrow( + 'No EVM accounts', + ); + }); + }); + + describe('getSelectedMultichainAccount', () => { + const mockNonEvmAccount = createExpectedInternalAccount({ + id: 'mock-non-evm', + name: 'non-evm', + address: 'bc1qzqc2aqlw8nwa0a05ehjkk7dgt8308ac7kzw9a6', + keyringType: KeyringTypes.snap, + type: BtcAccountType.P2wpkh, + }); + + const mockOlderEvmAccount = createExpectedInternalAccount({ + id: 'mock-id-1', + name: 'mock account 1', + address: 'mock-address-1', + keyringType: KeyringTypes.hd, + lastSelected: 11111, + }); + const mockNewerEvmAccount = createExpectedInternalAccount({ + id: 'mock-id-2', + name: 'mock account 2', + address: 'mock-address-2', + keyringType: KeyringTypes.hd, + lastSelected: 22222, + }); + + it.each([ + { + chainId: undefined, + selectedAccount: mockNewerEvmAccount, + expected: mockNewerEvmAccount, + }, + { + chainId: undefined, + selectedAccount: mockNonEvmAccount, + expected: mockNonEvmAccount, + }, + { + chainId: 'eip155:1', + selectedAccount: mockNonEvmAccount, + expected: mockNewerEvmAccount, + }, + { + chainId: 'bip122:000000000019d6689c085ae165831e93', + selectedAccount: mockNonEvmAccount, + expected: mockNonEvmAccount, + }, + ])( + "chainId $chainId with selectedAccount '$selectedAccount.id' should return $expected.id", + ({ chainId, selectedAccount, expected }) => { + const { accountsController } = setupAccountsController({ + initialState: { + internalAccounts: { + accounts: { + [mockOlderEvmAccount.id]: mockOlderEvmAccount, + [mockNewerEvmAccount.id]: mockNewerEvmAccount, + [mockNonEvmAccount.id]: mockNonEvmAccount, + }, + selectedAccount: selectedAccount.id, + }, + }, + }); + + expect( + accountsController.getSelectedMultichainAccount( + chainId as CaipChainId, + ), + ).toStrictEqual(expected); + }, + ); + + // Testing error cases + it.each([['eip155.'], ['bip122'], ['bip122:...']])( + 'invalid chainId %s will throw', + (chainId) => { + const { accountsController } = setupAccountsController({ + initialState: { + internalAccounts: { + accounts: { + [mockOlderEvmAccount.id]: mockOlderEvmAccount, + [mockNewerEvmAccount.id]: mockNewerEvmAccount, + [mockNonEvmAccount.id]: mockNonEvmAccount, + }, + selectedAccount: mockNonEvmAccount.id, + }, + }, + }); + + expect(() => + accountsController.getSelectedMultichainAccount( + chainId as CaipChainId, + ), + ).toThrow(`Invalid CAIP-2 chain ID: ${chainId}`); + }, + ); + }); + describe('listAccounts', () => { - it('should return a list of accounts', () => { - const accountsController = setupAccountsController({ + it('returns a list of evm accounts', () => { + const mockNonEvmAccount = createMockInternalAccount({ + id: 'mock-id-non-evm', + address: 'mock-non-evm-address', + type: BtcAccountType.P2wpkh, + keyringType: KeyringTypes.snap, + }); + + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount, [mockAccount2.id]: mockAccount2, + [mockNonEvmAccount.id]: mockNonEvmAccount, }, selectedAccount: mockAccount.id, }, }, }); - const result = accountsController.listAccounts(); - - expect(result).toStrictEqual([ - setLastSelectedAsAny(mockAccount as InternalAccount), - setLastSelectedAsAny(mockAccount2 as InternalAccount), + expect(accountsController.listAccounts()).toStrictEqual([ + mockAccount, + mockAccount2, ]); }); }); + describe('listMultichainAccounts', () => { + const mockNonEvmAccount = createMockInternalAccount({ + id: 'mock-id-non-evm', + address: 'mock-non-evm-address', + type: BtcAccountType.P2wpkh, + keyringType: KeyringTypes.snap, + }); + + it.each([ + [undefined, [mockAccount, mockAccount2, mockNonEvmAccount]], + ['eip155:1', [mockAccount, mockAccount2]], + ['bip122:000000000019d6689c085ae165831e93', [mockNonEvmAccount]], + ])(`%s should return %s`, (chainId, expected) => { + const { accountsController } = setupAccountsController({ + initialState: { + internalAccounts: { + accounts: { + [mockAccount.id]: mockAccount, + [mockAccount2.id]: mockAccount2, + [mockNonEvmAccount.id]: mockNonEvmAccount, + }, + selectedAccount: mockAccount.id, + }, + }, + }); + expect( + accountsController.listMultichainAccounts(chainId as CaipChainId), + ).toStrictEqual(expected); + }); + + it('throw if invalid CAIP-2 was passed', () => { + const { accountsController } = setupAccountsController({ + initialState: { + internalAccounts: { + accounts: { + [mockAccount.id]: mockAccount, + [mockAccount2.id]: mockAccount2, + }, + selectedAccount: mockAccount.id, + }, + }, + }); + + const invalidCaip2 = 'ethereum'; + + expect(() => + // @ts-expect-error testing invalid caip2 + accountsController.listMultichainAccounts(invalidCaip2), + ).toThrow(`Invalid CAIP-2 chain ID: ${invalidCaip2}`); + }); + }); + describe('getAccountExpect', () => { - it('should return an account by ID', () => { - const accountsController = setupAccountsController({ + it('return an account by ID', () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1654,9 +2003,9 @@ describe('AccountsController', () => { ); }); - it('should throw an error for an unknown account ID', () => { + it('throw an error for an unknown account ID', () => { const accountId = 'unknown id'; - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1670,8 +2019,8 @@ describe('AccountsController', () => { ); }); - it('should handle the edge case of undefined accountId during onboarding', async () => { - const accountsController = setupAccountsController({ + it('handle the edge case of undefined accountId during onboarding', async () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1698,49 +2047,72 @@ describe('AccountsController', () => { }); }); - describe('getSelectedAccount', () => { - it('should return the selected account', () => { - const accountsController = setupAccountsController({ + describe('setSelectedAccount', () => { + it('set the selected account', () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { - accounts: { [mockAccount.id]: mockAccount }, + accounts: { + [mockAccount.id]: mockAccount, + [mockAccount2.id]: mockAccount2, + }, selectedAccount: mockAccount.id, }, }, }); - const result = accountsController.getAccountExpect(mockAccount.id); - expect(result).toStrictEqual( - setLastSelectedAsAny(mockAccount as InternalAccount), - ); + accountsController.setSelectedAccount(mockAccount2.id); + + expect( + accountsController.state.internalAccounts.selectedAccount, + ).toStrictEqual(mockAccount2.id); }); - }); - describe('setSelectedAccount', () => { - it('should set the selected account', () => { - const accountsController = setupAccountsController({ + it('not emit setSelectedEvmAccountChange if the account is non-EVM', () => { + const mockNonEvmAccount = createExpectedInternalAccount({ + id: 'mock-non-evm', + name: 'non-evm', + address: 'bc1qzqc2aqlw8nwa0a05ehjkk7dgt8308ac7kzw9a6', + keyringType: KeyringTypes.snap, + type: BtcAccountType.P2wpkh, + }); + const { accountsController, messenger } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount, - [mockAccount2.id]: mockAccount2, + [mockNonEvmAccount.id]: mockNonEvmAccount, }, selectedAccount: mockAccount.id, }, }, }); - accountsController.setSelectedAccount(mockAccount2.id); + const messengerSpy = jest.spyOn(messenger, 'publish'); + + accountsController.setSelectedAccount(mockNonEvmAccount.id); expect( accountsController.state.internalAccounts.selectedAccount, - ).toStrictEqual(mockAccount2.id); + ).toStrictEqual(mockNonEvmAccount.id); + + expect(messengerSpy.mock.calls).toHaveLength(2); // state change and then selectedAccountChange + + expect(messengerSpy).not.toHaveBeenCalledWith( + 'AccountsController:selectedEvmAccountChange', + mockNonEvmAccount, + ); + + expect(messengerSpy).toHaveBeenCalledWith( + 'AccountsController:selectedAccountChange', + mockNonEvmAccount, + ); }); }); describe('setAccountName', () => { - it('should set the name of an existing account', () => { - const accountsController = setupAccountsController({ + it('set the name of an existing account', () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1755,8 +2127,8 @@ describe('AccountsController', () => { ).toBe('new name'); }); - it('should throw an error if the account name already exists', () => { - const accountsController = setupAccountsController({ + it('throw an error if the account name already exists', () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -1812,7 +2184,7 @@ describe('AccountsController', () => { }; }; - it('should return the next account number', async () => { + it('return the next account number', async () => { const messenger = buildMessenger(); mockUUID .mockReturnValueOnce('mock-id') // call to check if its a new account @@ -1821,7 +2193,7 @@ describe('AccountsController', () => { .mockReturnValueOnce('mock-id2') // call to add account .mockReturnValueOnce('mock-id3'); // call to add account - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -1850,7 +2222,7 @@ describe('AccountsController', () => { ]); }); - it('should return the next account number even with an index gap', async () => { + it('return the next account number even with an index gap', async () => { const messenger = buildMessenger(); const mockAccountUUIDs = new MockNormalAccountUUID([ mockAccount, @@ -1860,7 +2232,7 @@ describe('AccountsController', () => { ]); mockUUID.mockImplementation(mockAccountUUIDs.mock.bind(mockAccountUUIDs)); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { @@ -1909,8 +2281,8 @@ describe('AccountsController', () => { }); describe('getAccountByAddress', () => { - it('should return an account by address', async () => { - const accountsController = setupAccountsController({ + it('return an account by address', async () => { + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1927,7 +2299,7 @@ describe('AccountsController', () => { }); it("should return undefined if there isn't an account with the address", () => { - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1951,13 +2323,12 @@ describe('AccountsController', () => { jest.spyOn(AccountsController.prototype, 'getAccountByAddress'); jest.spyOn(AccountsController.prototype, 'getSelectedAccount'); jest.spyOn(AccountsController.prototype, 'getAccount'); - jest.spyOn(AccountsController.prototype, 'getNextAvailableAccountName'); }); describe('setSelectedAccount', () => { - it('should set the selected account', async () => { + it('set the selected account', async () => { const messenger = buildMessenger(); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1975,9 +2346,9 @@ describe('AccountsController', () => { }); describe('listAccounts', () => { - it('should retrieve a list of accounts', async () => { + it('retrieve a list of accounts', async () => { const messenger = buildMessenger(); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -1993,9 +2364,9 @@ describe('AccountsController', () => { }); describe('setAccountName', () => { - it('should set the account name', async () => { + it('set the account name', async () => { const messenger = buildMessenger(); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -2018,7 +2389,7 @@ describe('AccountsController', () => { }); describe('updateAccounts', () => { - it('should update accounts', async () => { + it('update accounts', async () => { const messenger = buildMessenger(); messenger.registerActionHandler( 'KeyringController:getAccounts', @@ -2033,7 +2404,7 @@ describe('AccountsController', () => { mockGetKeyringForAccount.mockResolvedValueOnce([]), ); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -2049,10 +2420,10 @@ describe('AccountsController', () => { }); describe('getAccountByAddress', () => { - it('should get account by address', async () => { + it('get account by address', async () => { const messenger = buildMessenger(); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -2074,10 +2445,10 @@ describe('AccountsController', () => { }); describe('getSelectedAccount', () => { - it('should get account by address', async () => { + it('get account by address', async () => { const messenger = buildMessenger(); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, @@ -2094,10 +2465,10 @@ describe('AccountsController', () => { }); describe('getAccount', () => { - it('should get account by id', async () => { + it('get account by id', async () => { const messenger = buildMessenger(); - const accountsController = setupAccountsController({ + const { accountsController } = setupAccountsController({ initialState: { internalAccounts: { accounts: { [mockAccount.id]: mockAccount }, diff --git a/packages/accounts-controller/src/AccountsController.ts b/packages/accounts-controller/src/AccountsController.ts index 8fec7bc333..820ab6447f 100644 --- a/packages/accounts-controller/src/AccountsController.ts +++ b/packages/accounts-controller/src/AccountsController.ts @@ -6,7 +6,11 @@ import type { import { BaseController } from '@metamask/base-controller'; import { SnapKeyring } from '@metamask/eth-snap-keyring'; import type { InternalAccount } from '@metamask/keyring-api'; -import { EthAccountType, EthMethod } from '@metamask/keyring-api'; +import { + EthAccountType, + EthMethod, + isEvmAccountType, +} from '@metamask/keyring-api'; import { KeyringTypes } from '@metamask/keyring-controller'; import type { KeyringControllerState, @@ -21,7 +25,13 @@ import type { } from '@metamask/snaps-controllers'; import type { SnapId } from '@metamask/snaps-sdk'; import type { Snap } from '@metamask/snaps-utils'; -import type { Keyring, Json } from '@metamask/utils'; +import type { CaipChainId } from '@metamask/utils'; +import { + type Keyring, + type Json, + isCaipChainId, + parseCaipChainId, +} from '@metamask/utils'; import type { Draft } from 'immer'; import { @@ -70,6 +80,11 @@ export type AccountsControllerGetSelectedAccountAction = { handler: AccountsController['getSelectedAccount']; }; +export type AccountsControllerGetSelectedMultichainAccountAction = { + type: `${typeof controllerName}:getSelectedMultichainAccount`; + handler: AccountsController['getSelectedMultichainAccount']; +}; + export type AccountsControllerGetAccountByAddressAction = { type: `${typeof controllerName}:getAccountByAddress`; handler: AccountsController['getAccountByAddress']; @@ -99,7 +114,8 @@ export type AccountsControllerActions = | AccountsControllerGetAccountByAddressAction | AccountsControllerGetSelectedAccountAction | AccountsControllerGetNextAvailableAccountNameAction - | AccountsControllerGetAccountAction; + | AccountsControllerGetAccountAction + | AccountsControllerGetSelectedMultichainAccountAction; export type AccountsControllerChangeEvent = ControllerStateChangeEvent< typeof controllerName, @@ -111,11 +127,17 @@ export type AccountsControllerSelectedAccountChangeEvent = { payload: [InternalAccount]; }; +export type AccountsControllerSelectedEvmAccountChangeEvent = { + type: `${typeof controllerName}:selectedEvmAccountChange`; + payload: [InternalAccount]; +}; + export type AllowedEvents = SnapStateChange | KeyringControllerStateChangeEvent; export type AccountsControllerEvents = | AccountsControllerChangeEvent - | AccountsControllerSelectedAccountChangeEvent; + | AccountsControllerSelectedAccountChangeEvent + | AccountsControllerSelectedEvmAccountChangeEvent; export type AccountsControllerMessenger = RestrictedControllerMessenger< typeof controllerName, @@ -205,12 +227,34 @@ export class AccountsController extends BaseController< } /** - * Returns an array of all internal accounts. + * Returns an array of all evm internal accounts. * * @returns An array of InternalAccount objects. */ listAccounts(): InternalAccount[] { - return Object.values(this.state.internalAccounts.accounts); + const accounts = Object.values(this.state.internalAccounts.accounts); + return accounts.filter((account) => isEvmAccountType(account.type)); + } + + /** + * Returns an array of all internal accounts. + * + * @param chainId - The chain ID. + * @returns An array of InternalAccount objects. + */ + listMultichainAccounts(chainId?: CaipChainId): InternalAccount[] { + const accounts = Object.values(this.state.internalAccounts.accounts); + if (!chainId) { + return accounts; + } + + if (!isCaipChainId(chainId)) { + throw new Error(`Invalid CAIP-2 chain ID: ${String(chainId)}`); + } + + return accounts.filter((account) => + this.#isAccountCompatibleWithChain(account, chainId), + ); } /** @@ -248,12 +292,54 @@ export class AccountsController extends BaseController< } /** - * Returns the selected internal account. + * Returns the last selected evm account. * * @returns The selected internal account. */ getSelectedAccount(): InternalAccount { - return this.getAccountExpect(this.state.internalAccounts.selectedAccount); + const selectedAccount = this.getAccountExpect( + this.state.internalAccounts.selectedAccount, + ); + if (isEvmAccountType(selectedAccount.type)) { + return selectedAccount; + } + + const accounts = this.listAccounts(); + + if (!accounts.length) { + // ! Should never reach this. + throw new Error('No EVM accounts'); + } + + // This will never be undefined because we have already checked if accounts.length is > 0 + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return this.#getLastSelectedAccount(accounts)!; + } + + /** + * __WARNING The return value may be undefined if there isn't an account for that chain id.__ + * + * Retrieves the last selected account by chain ID. + * + * @param chainId - The chain ID to filter the accounts. + * @returns The last selected account compatible with the specified chain ID or undefined. + */ + getSelectedMultichainAccount( + chainId?: CaipChainId, + ): InternalAccount | undefined { + if (!chainId) { + return this.getAccountExpect(this.state.internalAccounts.selectedAccount); + } + + if (!isCaipChainId(chainId)) { + throw new Error(`Invalid CAIP-2 chain ID: ${chainId as string}`); + } + + const accounts = Object.values(this.state.internalAccounts.accounts).filter( + (account) => this.#isAccountCompatibleWithChain(account, chainId), + ); + + return this.#getLastSelectedAccount(accounts); } /** @@ -282,6 +368,13 @@ export class AccountsController extends BaseController< currentState.internalAccounts.selectedAccount = account.id; }); + if (isEvmAccountType(account.type)) { + this.messagingSystem.publish( + 'AccountsController:selectedEvmAccountChange', + account, + ); + } + this.messagingSystem.publish( 'AccountsController:selectedAccountChange', account, @@ -707,6 +800,30 @@ export class AccountsController extends BaseController< }); } + /** + * Returns the last selected account from the given array of accounts. + * + * @param accounts - An array of InternalAccount objects. + * @returns The InternalAccount object that was last selected, or undefined if the array is empty. + */ + #getLastSelectedAccount( + accounts: InternalAccount[], + ): InternalAccount | undefined { + return accounts.reduce((prevAccount, currentAccount) => { + if ( + // When the account is added, lastSelected will be set + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + currentAccount.metadata.lastSelected! > + // When the account is added, lastSelected will be set + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + prevAccount.metadata.lastSelected! + ) { + return currentAccount; + } + return prevAccount; + }, accounts[0]); + } + /** * Returns the next account number for a given keyring type. * @param keyringType - The type of keyring. @@ -745,6 +862,22 @@ export class AccountsController extends BaseController< return `${keyringName} ${index}`; } + /** + * Checks if an account is compatible with a given chain namespace. + * @private + * @param account - The account to check compatibility for. + * @param chainId - The CAIP2 to check compatibility with. + * @returns Returns true if the account is compatible with the chain namespace, otherwise false. + */ + #isAccountCompatibleWithChain( + account: InternalAccount, + chainId: CaipChainId, + ): boolean { + // TODO: Change this logic to not use account's type + // Because we currently only use type, we can only use namespace for now. + return account.type.startsWith(parseCaipChainId(chainId).namespace); + } + /** * Handles the addition of a new account to the controller. * If the account is not a Snap Keyring account, generates an internal account for it and adds it to the controller. @@ -853,6 +986,11 @@ export class AccountsController extends BaseController< this.getSelectedAccount.bind(this), ); + this.messagingSystem.registerActionHandler( + `${controllerName}:getSelectedMultichainAccount`, + this.getSelectedMultichainAccount.bind(this), + ); + this.messagingSystem.registerActionHandler( `${controllerName}:getAccountByAddress`, this.getAccountByAddress.bind(this), diff --git a/packages/accounts-controller/src/index.ts b/packages/accounts-controller/src/index.ts index 274efa5d5b..29505118b6 100644 --- a/packages/accounts-controller/src/index.ts +++ b/packages/accounts-controller/src/index.ts @@ -11,8 +11,10 @@ export type { AccountsControllerActions, AccountsControllerChangeEvent, AccountsControllerSelectedAccountChangeEvent, + AccountsControllerSelectedEvmAccountChangeEvent, AccountsControllerEvents, AccountsControllerMessenger, } from './AccountsController'; export { AccountsController } from './AccountsController'; export { keyringTypeToName, getUUIDFromAddressOfNormalAccount } from './utils'; +export { createMockInternalAccount } from './tests/mocks'; diff --git a/packages/accounts-controller/src/tests/mocks.test.ts b/packages/accounts-controller/src/tests/mocks.test.ts new file mode 100644 index 0000000000..972b3356a5 --- /dev/null +++ b/packages/accounts-controller/src/tests/mocks.test.ts @@ -0,0 +1,77 @@ +import { BtcAccountType, EthAccountType } from '@metamask/keyring-api'; + +import { createMockInternalAccount } from './mocks'; + +describe('createMockInternalAccount', () => { + it('create a mock internal account', () => { + const account = createMockInternalAccount(); + expect(account).toStrictEqual({ + id: expect.any(String), + address: expect.any(String), + type: expect.any(String), + options: expect.any(Object), + methods: expect.any(Array), + metadata: { + name: expect.any(String), + keyring: { type: expect.any(String) }, + importTime: expect.any(Number), + lastSelected: expect.any(Number), + snap: undefined, + }, + }); + }); + + it('create a mock internal account with custom values', () => { + const customSnap = { + id: '1', + enabled: true, + name: 'Snap 1', + }; + const account = createMockInternalAccount({ + id: '1', + address: '0x123', + type: EthAccountType.Erc4337, + name: 'Custom Account', + snap: customSnap, + }); + expect(account).toStrictEqual({ + id: '1', + address: '0x123', + type: EthAccountType.Erc4337, + options: expect.any(Object), + methods: expect.any(Array), + metadata: { + name: 'Custom Account', + keyring: { type: expect.any(String) }, + importTime: expect.any(Number), + lastSelected: expect.any(Number), + snap: customSnap, + }, + }); + }); + + it('create a non-EVM account', () => { + const account = createMockInternalAccount({ type: BtcAccountType.P2wpkh }); + expect(account).toStrictEqual({ + id: expect.any(String), + address: expect.any(String), + type: BtcAccountType.P2wpkh, + options: expect.any(Object), + methods: expect.any(Array), + metadata: { + name: expect.any(String), + keyring: { type: expect.any(String) }, + importTime: expect.any(Number), + lastSelected: expect.any(Number), + snap: undefined, + }, + }); + }); + + it('will throw if an unknown account type was passed', () => { + // @ts-expect-error testing unknown account type + expect(() => createMockInternalAccount({ type: 'unknown' })).toThrow( + 'Unknown account type: unknown', + ); + }); +}); diff --git a/packages/accounts-controller/src/tests/mocks.ts b/packages/accounts-controller/src/tests/mocks.ts new file mode 100644 index 0000000000..59a9892a1a --- /dev/null +++ b/packages/accounts-controller/src/tests/mocks.ts @@ -0,0 +1,79 @@ +import type { + InternalAccount, + InternalAccountType, +} from '@metamask/keyring-api'; +import { + BtcAccountType, + BtcMethod, + EthAccountType, + EthErc4337Method, + EthMethod, +} from '@metamask/keyring-api'; +import { KeyringTypes } from '@metamask/keyring-controller'; +import { v4 } from 'uuid'; + +export const createMockInternalAccount = ({ + id = v4(), + address = '0x2990079bcdee240329a520d2444386fc119da21a', + type = EthAccountType.Eoa, + name = 'Account 1', + keyringType = KeyringTypes.hd, + snap, + importTime = Date.now(), + lastSelected = Date.now(), +}: { + id?: string; + address?: string; + type?: InternalAccountType; + name?: string; + keyringType?: KeyringTypes; + snap?: { + id: string; + enabled: boolean; + name: string; + }; + importTime?: number; + lastSelected?: number; +} = {}): InternalAccount => { + let methods; + + switch (type) { + case EthAccountType.Eoa: + methods = [ + EthMethod.PersonalSign, + EthMethod.Sign, + EthMethod.SignTransaction, + EthMethod.SignTypedDataV1, + EthMethod.SignTypedDataV3, + EthMethod.SignTypedDataV4, + ]; + break; + case EthAccountType.Erc4337: + methods = [ + EthErc4337Method.PatchUserOperation, + EthErc4337Method.PrepareUserOperation, + EthErc4337Method.SignUserOperation, + ]; + break; + case BtcAccountType.P2wpkh: + methods = [BtcMethod.SendMany]; + break; + default: + throw new Error(`Unknown account type: ${type as string}`); + } + + return { + id, + address, + options: {}, + methods, + type, + metadata: { + name, + keyring: { type: keyringType }, + importTime, + lastSelected, + snap, + }, + } as InternalAccount; +}; From 7e117aca30d429996df361c94fae04b7169b8b47 Mon Sep 17 00:00:00 2001 From: Derek Brans Date: Fri, 31 May 2024 10:14:57 -0400 Subject: [PATCH 12/18] fix: TransactionController afterSign hook should be allowed to modify the transaction (#4343) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > [!NOTE] > This change is intended to be cherry-picked into MetaMask/extension v11.17.0 via an upgrade to the @metamask/transaction-controller package. ## Explanation **Issue:** A recent update to the transaction-controller has made the TransactionMeta object passed to the `afterSign` hook frozen. This change prevents adding new properties, leading to the error: “Cannot add property custodyId, object is not extensible.” This bug is breaking all transactions for MMI as the original txMeta cannot store required properties like custodyId. **Fix:** We deep clone the transaction meta before passing it to the hook. A deep clone is used because transactionMeta is recursively frozen by immer. This fix was intended to minimize the change for the cherry-pick going into v11.17.0. A longer term solution might involve using immer more throughout the TransactionController.ts file to make it clearer when a transactionMeta is being mutated and how. **Testing:** This fix was applied to and verified with the MMI extension. ## References ## Changelog ### `@metamask/transaction-controller` - **FIXED**: afterSign hook is now able to modify the transaction ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate --- .../transaction-controller/src/TransactionController.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/transaction-controller/src/TransactionController.ts b/packages/transaction-controller/src/TransactionController.ts index 76a8158ddf..06010fc314 100644 --- a/packages/transaction-controller/src/TransactionController.ts +++ b/packages/transaction-controller/src/TransactionController.ts @@ -3289,9 +3289,10 @@ export class TransactionController extends BaseController< return undefined; } - if (!this.afterSign(transactionMeta, signedTx)) { + const transactionMetaFromHook = cloneDeep(transactionMeta); + if (!this.afterSign(transactionMetaFromHook, signedTx)) { this.updateTransaction( - transactionMeta, + transactionMetaFromHook, 'TransactionController#signTransaction - Update after sign', ); @@ -3301,7 +3302,7 @@ export class TransactionController extends BaseController< } const transactionMetaWithRsv = { - ...this.updateTransactionMetaRSV(transactionMeta, signedTx), + ...this.updateTransactionMetaRSV(transactionMetaFromHook, signedTx), status: TransactionStatus.signed as const, }; From 18b9b62e44e5fb74c7057a1c3a5c6691bd0fdd2f Mon Sep 17 00:00:00 2001 From: Brian Bergeron Date: Fri, 31 May 2024 07:28:50 -0700 Subject: [PATCH 13/18] exclude fields from token list fetch (#4235) ## Explanation Adds 2 query parameters when fetching token lists: - `includeERC20Permit=false` - `includeStorage=false` The best I can tell, neither field is used by extension or mobile. So we'll instead take the reduction in network usage (~5KB on mainnet) and controller state. ## References https://consensyssoftware.atlassian.net/browse/API-1186 ## Changelog ### `@metamask/assets-controllers` - **BREAKING**: `TokenListController` no longer includes the fields `storage` and `erc20Permit` in its state. ## Checklist - [ ] I've updated the test suite for new or updated code as appropriate - [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [ ] I've highlighted breaking changes using the "BREAKING" category above as appropriate --- .../src/TokenListController.test.ts | 2 +- .../assets-controllers/src/token-service.test.ts | 12 ++++++------ packages/assets-controllers/src/token-service.ts | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/assets-controllers/src/TokenListController.test.ts b/packages/assets-controllers/src/TokenListController.test.ts index f52b91a0c7..163a4ab3b1 100644 --- a/packages/assets-controllers/src/TokenListController.test.ts +++ b/packages/assets-controllers/src/TokenListController.test.ts @@ -1343,5 +1343,5 @@ describe('TokenListController', () => { function getTokensPath(chainId: Hex) { return `/tokens/${convertHexToDecimal( chainId, - )}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false`; + )}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`; } diff --git a/packages/assets-controllers/src/token-service.test.ts b/packages/assets-controllers/src/token-service.test.ts index 21908dd428..26ff3aa8fb 100644 --- a/packages/assets-controllers/src/token-service.test.ts +++ b/packages/assets-controllers/src/token-service.test.ts @@ -243,7 +243,7 @@ describe('Token service', () => { const { signal } = new AbortController(); nock(TOKEN_END_POINT_API) .get( - `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false`, + `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`, ) .reply(200, sampleTokenList) .persist(); @@ -260,7 +260,7 @@ describe('Token service', () => { nock(TOKEN_END_POINT_API) .get( - `/tokens/${lineaChainId}?occurrenceFloor=1&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false`, + `/tokens/${lineaChainId}?occurrenceFloor=1&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`, ) .reply(200, sampleTokenListLinea) .persist(); @@ -274,7 +274,7 @@ describe('Token service', () => { const abortController = new AbortController(); nock(TOKEN_END_POINT_API) .get( - `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false`, + `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`, ) // well beyond time it will take to abort .delay(ONE_SECOND_IN_MILLISECONDS) @@ -294,7 +294,7 @@ describe('Token service', () => { const { signal } = new AbortController(); nock(TOKEN_END_POINT_API) .get( - `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false`, + `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`, ) .replyWithError('Example network error') .persist(); @@ -308,7 +308,7 @@ describe('Token service', () => { const { signal } = new AbortController(); nock(TOKEN_END_POINT_API) .get( - `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false`, + `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`, ) .reply(500) .persist(); @@ -322,7 +322,7 @@ describe('Token service', () => { const { signal } = new AbortController(); nock(TOKEN_END_POINT_API) .get( - `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false`, + `/tokens/${sampleDecimalChainId}?occurrenceFloor=3&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`, ) // well beyond timeout .delay(ONE_SECOND_IN_MILLISECONDS) diff --git a/packages/assets-controllers/src/token-service.ts b/packages/assets-controllers/src/token-service.ts index becedb8200..dd3bc1f915 100644 --- a/packages/assets-controllers/src/token-service.ts +++ b/packages/assets-controllers/src/token-service.ts @@ -21,7 +21,7 @@ function getTokensURL(chainId: Hex) { const occurrenceFloor = chainId === ChainId['linea-mainnet'] ? 1 : 3; return `${TOKEN_END_POINT_API}/tokens/${convertHexToDecimal( chainId, - )}?occurrenceFloor=${occurrenceFloor}&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false`; + )}?occurrenceFloor=${occurrenceFloor}&includeNativeAssets=false&includeDuplicateSymbolAssets=false&includeTokenFees=false&includeAssetType=false&includeERC20Permit=false&includeStorage=false`; } /** From d28191e949315018506811bff9da4d48051220fe Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Fri, 31 May 2024 09:05:53 -0600 Subject: [PATCH 14/18] Add changelog entries for PR 4330 --- packages/accounts-controller/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/accounts-controller/CHANGELOG.md b/packages/accounts-controller/CHANGELOG.md index 88b435f8e0..67d3736262 100644 --- a/packages/accounts-controller/CHANGELOG.md +++ b/packages/accounts-controller/CHANGELOG.md @@ -12,11 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Add `getNextAvailableAccountName` method and `AccountsController:getNextAvailableAccountName` controller action ([#4326](https://github.com/MetaMask/core/pull/4326)) +- Add `listMultichainAccounts` method for getting accounts on a specific chain or the default chain ([#4330](https://github.com/MetaMask/core/pull/4330)) +- Add `getSelectedMultichainAccount` method and `AccountsController:getSelectedMultichainAccount` controller action for getting the selected account on a specific chain or the default chain ([#4330](https://github.com/MetaMask/core/pull/4330)) ### Changed - **BREAKING:** Bump peer dependency `@metamask/snaps-controllers` to `^8.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) - **BREAKING:** Bump peer dependency `@metamask/keyring-controller` to `^16.1.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +- **BREAKING:** `listAccounts` now filters the list of accounts in state to EVM accounts ([#4330](https://github.com/MetaMask/core/pull/4330)) +- **BREAKING:** `getSelectedAccount` now throws if the selected account is not an EVM account ([#4330](https://github.com/MetaMask/core/pull/4330)) - Bump `@metamask/eth-snap-keyring` to `^4.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) - Bump `@metamask/keyring-api` to `^6.1.1` ([#4262](https://github.com/MetaMask/core/pull/4262)) - Bump `@metamask/snaps-sdk` to `^4.2.0` ([#4262](https://github.com/MetaMask/core/pull/4262)) From 2780b4761ea308a6cc15a79b8b1b0b02d3175034 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Fri, 31 May 2024 09:08:09 -0600 Subject: [PATCH 15/18] Add changelog entries for PR 4343 --- packages/transaction-controller/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index cc54f9021c..3a48c0bd85 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -17,6 +17,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump `async-mutex` to `^0.5.0` ([#4335](https://github.com/MetaMask/core/pull/4335)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) +### Fixed + +- Pass an unfrozen transaction to the `afterSign` hook so that it is able to modify the transaction ([#4343](https://github.com/MetaMask/core/pull/4343)) + ### Removed - **BREAKING:** Remove `sign` from `TransactionType` ([#4319](https://github.com/MetaMask/core/pull/4319)) From 2b9b0a483708a2635165821fb1b81c9421c82510 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Fri, 31 May 2024 09:30:33 -0600 Subject: [PATCH 16/18] Add changelog entry for PR 4235 --- packages/assets-controllers/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/assets-controllers/CHANGELOG.md b/packages/assets-controllers/CHANGELOG.md index d44448577a..00222b4afb 100644 --- a/packages/assets-controllers/CHANGELOG.md +++ b/packages/assets-controllers/CHANGELOG.md @@ -83,6 +83,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `NftController` now takes a single options object which can be used for configuration, and configuration is now kept internally. - **BREAKING:** Remove `hub` property from `NftController` ([#4310](https://github.com/MetaMask/core/pull/4310)) - Use the controller messenger for subscribing to and publishing events instead. +- Modify `TokenListController` so that tokens fetched from the API and stored in state will no longer have `storage` and `erc20` properties ([#4235](https://github.com/MetaMask/core/pull/4235)) + - These properties were never supported, but may have shown up in state anyway. ## [30.0.0] From 4856c6c7d0bd9f9cd6bfbe9c9f9f420c94aa4918 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Fri, 31 May 2024 09:31:22 -0600 Subject: [PATCH 17/18] Fix lint violation --- packages/transaction-controller/CHANGELOG.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/transaction-controller/CHANGELOG.md b/packages/transaction-controller/CHANGELOG.md index 3a48c0bd85..2e2c82f5cf 100644 --- a/packages/transaction-controller/CHANGELOG.md +++ b/packages/transaction-controller/CHANGELOG.md @@ -17,15 +17,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Bump `async-mutex` to `^0.5.0` ([#4335](https://github.com/MetaMask/core/pull/4335)) - Bump `@metamask/controller-utils` to `^10.0.0` ([#4342](https://github.com/MetaMask/core/pull/4342)) -### Fixed - -- Pass an unfrozen transaction to the `afterSign` hook so that it is able to modify the transaction ([#4343](https://github.com/MetaMask/core/pull/4343)) - ### Removed - **BREAKING:** Remove `sign` from `TransactionType` ([#4319](https://github.com/MetaMask/core/pull/4319)) - This represented an `eth_sign` transaction, but support for that RPC method is being removed, so this is no longer needed. +### Fixed + +- Pass an unfrozen transaction to the `afterSign` hook so that it is able to modify the transaction ([#4343](https://github.com/MetaMask/core/pull/4343)) + ## [30.0.0] ### Fixed From f45ee7f1d402673f408b5c3476efb27faf81be99 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Fri, 31 May 2024 09:56:57 -0600 Subject: [PATCH 18/18] Mark PR 4235 as breaking --- packages/assets-controllers/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/assets-controllers/CHANGELOG.md b/packages/assets-controllers/CHANGELOG.md index 00222b4afb..364e9f87f9 100644 --- a/packages/assets-controllers/CHANGELOG.md +++ b/packages/assets-controllers/CHANGELOG.md @@ -83,8 +83,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `NftController` now takes a single options object which can be used for configuration, and configuration is now kept internally. - **BREAKING:** Remove `hub` property from `NftController` ([#4310](https://github.com/MetaMask/core/pull/4310)) - Use the controller messenger for subscribing to and publishing events instead. -- Modify `TokenListController` so that tokens fetched from the API and stored in state will no longer have `storage` and `erc20` properties ([#4235](https://github.com/MetaMask/core/pull/4235)) - - These properties were never supported, but may have shown up in state anyway. +- **BREAKING:** Modify `TokenListController` so that tokens fetched from the API and stored in state will no longer have `storage` and `erc20` properties ([#4235](https://github.com/MetaMask/core/pull/4235)) + - These properties were never officially supported, but they were present in state anyway. ## [30.0.0]