@metamask-previews/assets-controllers 36.0.0-preview-5492a3a → 37.0.0-preview-ea7e75d5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/CHANGELOG.md +58 -1
  2. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -7,10 +7,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [37.0.0]
11
+
12
+ ### Added
13
+
14
+ - Add elements to the `AssetsContractController` class: ([#4397](https://github.com/MetaMask/core/pull/4397))
15
+ - Add class field `messagingSystem`.
16
+ - Add getters for `ipfsGateway` and `chainId`. As corresponding setters have not been defined, these properties are not externally mutable.
17
+ - Add and export the `AssetsContractControllerMessenger` type ([#4397](https://github.com/MetaMask/core/pull/4397))
18
+ - `AssetsContractControllerMessenger` must allow the external actions `NetworkController:getNetworkClientById`, `NetworkController:getNetworkConfigurationByNetworkClientId`, `NetworkController:getSelectedNetworkClient`, `NetworkController:getState`.
19
+ - `AssetsContractControllerMessenger` must allow the external events `PreferencesController:stateChange`, `NetworkController:networkDidChange`.
20
+ - Add and export new types: `AssetsContractControllerActions`, `AssetsContractControllerEvents`, `AssetsContractControllerGetERC20StandardAction`, `AssetsContractControllerGetERC721StandardAction`, `AssetsContractControllerGetERC1155StandardAction`, `AssetsContractControllerGetERC20BalanceOfAction`, `AssetsContractControllerGetERC20TokenDecimalsAction`, `AssetsContractControllerGetERC20TokenNameAction`, `AssetsContractControllerGetERC721NftTokenIdAction`, `AssetsContractControllerGetERC721TokenURIAction`, `AssetsContractControllerGetERC721AssetNameAction`, `AssetsContractControllerGetERC721AssetSymbolAction`, `AssetsContractControllerGetERC721OwnerOfAction`, `AssetsContractControllerGetERC1155TokenURIAction`, `AssetsContractControllerGetERC1155BalanceOfAction`, `AssetsContractControllerTransferSingleERC1155Action`, `AssetsContractControllerGetTokenStandardAndDetailsAction`, `AssetsContractControllerGetBalancesInSingleCallAction` ([#4397](https://github.com/MetaMask/core/pull/4397))
21
+ - Add a new `setProvider` method to `AssetsContractController` ([#4397](https://github.com/MetaMask/core/pull/4397))
22
+ - Replaces the removed `provider` setter method, and widens the `provider` function parameter type from `Provider` to `Provider | undefined`.
23
+ - Export `TokenBalancesControllerState` type ([#4535](https://github.com/MetaMask/core/pull/4535))
24
+ - This was defined but not exported in v34.0.0.
25
+ - Add `getNFTContractInfo` method to the `NFTController` for fetching NFT Collection Metadata from the NFT API ([#4524](https://github.com/MetaMask/core/pull/4524))
26
+
10
27
  ### Changed
11
28
 
29
+ - **BREAKING:** Add required constructor option `messenger` to the `AssetsContractController` class ([#4397](https://github.com/MetaMask/core/pull/4397))
30
+ - **BREAKING:** `TokenBalancesControllerMessenger` must allow the `AssetsContractController:getERC20BalanceOf` action in addition to its previous allowed actions ([#4397](https://github.com/MetaMask/core/pull/4397))
31
+ - **BREAKING:** `NftControllerMessenger` must allow the following actions in addition to its previous allowed actions: `AssetsContractController:getERC721AssetName`, `AssetsContractController:getERC721AssetSymbol`, `AssetsContractController:getERC721TokenURI`, `AssetsContractController:getERC721OwnerOf`, `AssetsContractController:getERC1155BalanceOf`, `AssetsContractController:getERC1155TokenURI` ([#4397](https://github.com/MetaMask/core/pull/4397))
32
+ - **BREAKING:** The type of `SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID` is narrowed from `Record<Hex, string>` to the const-asserted literal properties of the `SINGLE_CALL_BALANCES_ADDRESS_BY_CHAINID` object ([#4397](https://github.com/MetaMask/core/pull/4397))
33
+ - The index signature is restricted to the union of the enum keys of `SupportedTokenDetectionNetworks`.
34
+ - The property value type is restricted to the type union of the addresses defined in the object.
35
+ - The object type is constrained by `Record<Hex, string>` using the `satisfies` keyword.
36
+ - **BREAKING:** Convert the `BalanceMap` type from an `interface` into a type alias ([#4397](https://github.com/MetaMask/core/pull/4397))
37
+ - Type aliases have an index signature of `string` by default, and are compatible with the `StateConstraint` type defined in the `@metamask/base-controller` package.
38
+ - **BREAKING:** `getIpfsCIDv1AndPath`, `getFormattedIpfsUrl` are now async functions ([#3645](https://github.com/MetaMask/core/pull/3645))
39
+ - **BREAKING:** Bump peerDependency `@metamask/accounts-controller` from `^17.0.0` to `^18.0.0` ([#4548](https://github.com/MetaMask/core/pull/4548))
12
40
  - Remove `@metamask/accounts-controller`, `@metamask/approval-controller`, `@metamask/keyring-controller`, and `@metamask/preferences-controller` dependencies [#4556](https://github.com/MetaMask/core/pull/4556)
13
41
  - These were listed under `peerDependencies` already, so they were redundant as dependencies.
42
+ - Add `immer` `^9.0.6` as a new dependency ([#3645](https://github.com/MetaMask/core/pull/3645))
43
+ - Bump `@metamask/abi-utils` from `^2.0.2` to `^2.0.3` ([#3645](https://github.com/MetaMask/core/pull/3645))
44
+ - Bump `@metamask/base-controller` from `^6.0.0` to `^6.0.2` ([#4517](https://github.com/MetaMask/core/pull/4517), [#4544](https://github.com/MetaMask/core/pull/4544))
45
+ - Bump `@metamask/controller-utils` from `^11.0.1` to `^11.0.2` ([#4544](https://github.com/MetaMask/core/pull/4544))
46
+ - Bump `@metamask/utils` from `^9.0.0` to `^9.1.0` ([#4529](https://github.com/MetaMask/core/pull/4529))
47
+ - Bump `multiformats` from `^9.5.2` to `^13.1.0` ([#3645](https://github.com/MetaMask/core/pull/3645))
48
+ - Bump `@metamask/polling-controller` from `^9.0.0` to `^9.0.1` ([#4548](https://github.com/MetaMask/core/pull/4548))
49
+
50
+ ### Removed
51
+
52
+ - **BREAKING:** Remove elements from the `AssetsContractController` class: ([#4397](https://github.com/MetaMask/core/pull/4397))
53
+ - **BREAKING:** `AssetsContractController` no longer inherits from `BaseControllerV1`.
54
+ - **BREAKING:** Remove constructor option callbacks `onPreferencesStateChange`, `onNetworkDidChange`, `getNetworkClientById`, and replace with corresponding messenger actions and events.
55
+ - **BREAKING:** Remove class fields: `name`, `config` (along with its properties `provider`, `ipfsGateway`, `chainId`).
56
+ - **BREAKING:** Remove methods: `getProvider`, `getChainId`.
57
+ - Use the getters `provider` and `chainId` instead.
58
+ - **BREAKING:** Remove the `provider` setter method.
59
+ - Use the `setProvider` method instead.
60
+ - **BREAKING:** Remove the `getERC20BalanceOf` constructor option callback from the `TokenBalancesControllerOptions` type and the `TokenBalancesController` constructor ([#4397](https://github.com/MetaMask/core/pull/4397))
61
+ - The messenger is expected to allow `AssetsContractController:getERC20BalanceOf` messenger action so that it can be used instead.
62
+ - **BREAKING:** Remove `NftController` constructor option callbacks: `getERC721AssetName`, `getERC721AssetSymbol`, `getERC721TokenURI`, `getERC721OwnerOf`, `getERC1155BalanceOf`, `getERC1155TokenURI` ([#4397](https://github.com/MetaMask/core/pull/4397))
63
+ - These are accessed through the messenger instead.
64
+ - **BREAKING:** Remove the `AssetsContractConfig` type ([#4397](https://github.com/MetaMask/core/pull/4397))
65
+ - **BREAKING:** Remove export for `MISSING_PROVIDER_ERROR` ([#4397](https://github.com/MetaMask/core/pull/4397))
66
+
67
+ ### Fixed
68
+
69
+ - **BREAKING:** Convert the `getERC721NftTokenId` method of the `AssetsContractController` into an async function. ([#4397](https://github.com/MetaMask/core/pull/4397))
14
70
 
15
71
  ## [36.0.0]
16
72
 
@@ -1018,7 +1074,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1018
1074
 
1019
1075
  - Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))
1020
1076
 
1021
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@36.0.0...HEAD
1077
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@37.0.0...HEAD
1078
+ [37.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@36.0.0...@metamask/assets-controllers@37.0.0
1022
1079
  [36.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@35.0.0...@metamask/assets-controllers@36.0.0
1023
1080
  [35.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@34.0.0...@metamask/assets-controllers@35.0.0
1024
1081
  [34.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@33.0.0...@metamask/assets-controllers@34.0.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/assets-controllers",
3
- "version": "36.0.0-preview-5492a3a",
3
+ "version": "37.0.0-preview-ea7e75d5",
4
4
  "description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -52,7 +52,7 @@
52
52
  "@metamask/controller-utils": "^11.0.2",
53
53
  "@metamask/eth-query": "^4.0.0",
54
54
  "@metamask/metamask-eth-abis": "^3.1.1",
55
- "@metamask/polling-controller": "^9.0.0",
55
+ "@metamask/polling-controller": "^9.0.1",
56
56
  "@metamask/rpc-errors": "^6.3.1",
57
57
  "@metamask/utils": "^9.1.0",
58
58
  "@types/bn.js": "^5.1.5",
@@ -67,14 +67,14 @@
67
67
  "uuid": "^8.3.2"
68
68
  },
69
69
  "devDependencies": {
70
- "@metamask/accounts-controller": "^17.2.0",
70
+ "@metamask/accounts-controller": "^18.0.0",
71
71
  "@metamask/approval-controller": "^7.0.2",
72
72
  "@metamask/auto-changelog": "^3.4.4",
73
73
  "@metamask/ethjs-provider-http": "^0.3.0",
74
74
  "@metamask/keyring-api": "^8.0.1",
75
- "@metamask/keyring-controller": "^17.1.1",
76
- "@metamask/network-controller": "^20.0.0",
77
- "@metamask/preferences-controller": "^13.0.0",
75
+ "@metamask/keyring-controller": "^17.1.2",
76
+ "@metamask/network-controller": "^20.1.0",
77
+ "@metamask/preferences-controller": "^13.0.1",
78
78
  "@types/jest": "^27.4.1",
79
79
  "@types/lodash": "^4.14.191",
80
80
  "@types/node": "^16.18.54",
@@ -89,7 +89,7 @@
89
89
  "typescript": "~5.0.4"
90
90
  },
91
91
  "peerDependencies": {
92
- "@metamask/accounts-controller": "^17.0.0",
92
+ "@metamask/accounts-controller": "^18.0.0",
93
93
  "@metamask/approval-controller": "^7.0.0",
94
94
  "@metamask/keyring-controller": "^17.0.0",
95
95
  "@metamask/network-controller": "^20.0.0",