@metamask/assets-controllers 25.0.0 → 26.0.0
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.
- package/CHANGELOG.md +189 -39
- package/dist/AssetsContractController.d.ts +5 -6
- package/dist/AssetsContractController.d.ts.map +1 -1
- package/dist/AssetsContractController.js +1 -2
- package/dist/AssetsContractController.js.map +1 -1
- package/dist/NftController.d.ts.map +1 -1
- package/dist/NftController.js +18 -16
- package/dist/NftController.js.map +1 -1
- package/dist/NftDetectionController.d.ts.map +1 -1
- package/dist/NftDetectionController.js +0 -2
- package/dist/NftDetectionController.js.map +1 -1
- package/dist/Standards/ERC20Standard.d.ts +1 -2
- package/dist/Standards/ERC20Standard.d.ts.map +1 -1
- package/dist/Standards/ERC20Standard.js +6 -8
- package/dist/Standards/ERC20Standard.js.map +1 -1
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.d.ts +1 -2
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.d.ts.map +1 -1
- package/dist/Standards/NftStandards/ERC1155/ERC1155Standard.js.map +1 -1
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.d.ts.map +1 -1
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.js +2 -3
- package/dist/Standards/NftStandards/ERC721/ERC721Standard.js.map +1 -1
- package/dist/TokenBalancesController.d.ts +12 -10
- package/dist/TokenBalancesController.d.ts.map +1 -1
- package/dist/TokenBalancesController.js +13 -16
- package/dist/TokenBalancesController.js.map +1 -1
- package/dist/TokenDetectionController.d.ts +47 -24
- package/dist/TokenDetectionController.d.ts.map +1 -1
- package/dist/TokenDetectionController.js +228 -111
- package/dist/TokenDetectionController.js.map +1 -1
- package/dist/TokensController.d.ts +20 -20
- package/dist/TokensController.d.ts.map +1 -1
- package/dist/TokensController.js +16 -23
- package/dist/TokensController.js.map +1 -1
- package/dist/assetsUtil.d.ts +1 -2
- package/dist/assetsUtil.d.ts.map +1 -1
- package/dist/assetsUtil.js +7 -3
- package/dist/assetsUtil.js.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/token-prices-service/codefi-v2.d.ts.map +1 -1
- package/dist/token-prices-service/codefi-v2.js +1 -1
- package/dist/token-prices-service/codefi-v2.js.map +1 -1
- package/package.json +17 -10
- package/dist/Standards/standards-types.d.ts +0 -15
- package/dist/Standards/standards-types.d.ts.map +0 -1
- package/dist/Standards/standards-types.js +0 -3
- package/dist/Standards/standards-types.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
# Changelog
|
|
2
|
+
|
|
2
3
|
All notable changes to this project will be documented in this file.
|
|
3
4
|
|
|
4
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
@@ -6,14 +7,66 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
6
7
|
|
|
7
8
|
## [Unreleased]
|
|
8
9
|
|
|
10
|
+
## [26.0.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **BREAKING:** `TokenDetectionController` newly subscribes to the `PreferencesController:stateChange`, `AccountsController:selectedAccountChange`, `KeyringController:lock`, and `KeyringController:unlock` events, and allows messenger actions `AccountsController:getSelectedAccount`, `NetworkController:getNetworkClientById`, `NetworkController:getNetworkConfigurationByNetworkClientId`, `NetworkController:getState`, `KeyringController:getState`, `PreferencesController:getState`, `TokenListController:getState`, `TokensController:getState`, and `TokensController:addDetectedTokens` ([#3775](https://github.com/MetaMask/core/pull/3775/), [#3923](https://github.com/MetaMask/core/pull/3923/), [#3938](https://github.com/MetaMask/core/pull/3938))
|
|
15
|
+
- `TokensController` now exports `TokensControllerActions`, `TokensControllerGetStateAction`, `TokensControllerAddDetectedTokensAction`, `TokensControllerEvents`, and `TokensControllerStateChangeEvent` ([#3690](https://github.com/MetaMask/core/pull/3690/))
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **BREAKING:** Add `@metamask/accounts-controller` `^11.0.0` as dependency and peer dependency ([#3775](https://github.com/MetaMask/core/pull/3775/), [#4007](https://github.com/MetaMask/core/pull/4007))
|
|
20
|
+
- **BREAKING:** Add `@metamask/keyring-controller` `^13.0.0` as dependency and peer dependency ([#3775](https://github.com/MetaMask/core/pull/3775), [#4007](https://github.com/MetaMask/core/pull/4007))
|
|
21
|
+
- **BREAKING:** Bump `@metamask/preferences-controller` dependency and peer dependency to `^8.0.0` ([#4007](https://github.com/MetaMask/core/pull/4007))
|
|
22
|
+
- **BREAKING:** `TokenDetectionController` is merged with `DetectTokensController` from the `metamask-extension` repo ([#3775](https://github.com/MetaMask/core/pull/3775/), [#3923](https://github.com/MetaMask/core/pull/3923)), ([#3938](https://github.com/MetaMask/core/pull/3938))
|
|
23
|
+
- **BREAKING:** `TokenDetectionController` now resets its polling interval to the default value of 3 minutes when token detection is triggered by external controller events `KeyringController:unlock`, `TokenListController:stateChange`, `PreferencesController:stateChange`, `AccountsController:selectedAccountChange`.
|
|
24
|
+
- **BREAKING:** `TokenDetectionController` now refetches tokens on `NetworkController:networkDidChange` if the `networkClientId` is changed instead of `chainId`.
|
|
25
|
+
- **BREAKING:** `TokenDetectionController` cannot initiate polling or token detection if `KeyringController` state is locked.
|
|
26
|
+
- **BREAKING:** The `detectTokens` method input option `accountAddress` has been renamed to `selectedAddress`.
|
|
27
|
+
- **BREAKING:** The `detectTokens` method now excludes tokens that are already included in the `TokensController`'s `detectedTokens` list from the batch of incoming tokens it sends to the `TokensController` `addDetectedTokens` method.
|
|
28
|
+
- **BREAKING:** The constructor for `TokenDetectionController` expects a new required property `trackMetaMetricsEvent`, which defines the callback that is called in the `detectTokens` method.
|
|
29
|
+
- **BREAKING:** In Mainnet, even if the `PreferenceController`'s `useTokenDetection` option is set to false, automatic token detection is performed on the legacy token list (token data from the contract-metadata repo).
|
|
30
|
+
- **BREAKING:** The `TokensState` type is now defined as a type alias rather than an interface. ([#3690](https://github.com/MetaMask/core/pull/3690/))
|
|
31
|
+
- This is breaking because it could affect how this type is used with other types, such as `Json`, which does not support TypeScript interfaces.
|
|
32
|
+
- The constructor option `selectedAddress` no longer defaults to `''` if omitted. Instead, the correct address is assigned using the `AccountsController:getSelectedAccount` messenger action.
|
|
33
|
+
- **BREAKING:** Change type of `provider` property in `AssetsContractController` from `any` to `Provider` from `@metamask/network-controller` ([#3818](https://github.com/MetaMask/core/pull/3818))
|
|
34
|
+
- **BREAKING:** Change type of `provider` property in `TokensController` from `any` to `Provider` from `@metamask/network-controller` ([#3818](https://github.com/MetaMask/core/pull/3818))
|
|
35
|
+
- Bump `@metamask/approval-controller` to `^5.1.3` ([#4007](https://github.com/MetaMask/core/pull/4007))
|
|
36
|
+
- Bump `@metamask/controller-utils` to `^8.0.4` ([#4007](https://github.com/MetaMask/core/pull/4007))
|
|
37
|
+
- Bump `@metamask/ethjs-unit` to `^0.3.0` ([#3897](https://github.com/MetaMask/core/pull/3897))
|
|
38
|
+
- Bump `@metamask/network-controller` to `^17.2.1` ([#4007](https://github.com/MetaMask/core/pull/4007))
|
|
39
|
+
- Bump `@metamask/polling-controller` to `^5.0.1` ([#4007](https://github.com/MetaMask/core/pull/4007))
|
|
40
|
+
- Bump `@metamask/rpc-errors` to `^6.2.1` ([#3970](https://github.com/MetaMask/core/pull/3970), [#3954](https://github.com/MetaMask/core/pull/3954))
|
|
41
|
+
- Replace `ethereumjs-util` with `@ethereumjs/util` and `bn.js` ([#3943](https://github.com/MetaMask/core/pull/3943))
|
|
42
|
+
- Update `CodefiTokenPricesServiceV2` so that requests to the price API now use the `No-Cache` HTTP header ([#3939](https://github.com/MetaMask/core/pull/3939))
|
|
43
|
+
|
|
44
|
+
### Removed
|
|
45
|
+
|
|
46
|
+
- **BREAKING:** `TokenDetectionController` constructor no longer accepts options `networkClientId`, `onPreferencesStateChange`, `getPreferencesState`, `getTokensState`, or `addDetectedTokens` ([#3690](https://github.com/MetaMask/core/pull/3690/), [#3775](https://github.com/MetaMask/core/pull/3775/), [#3938](https://github.com/MetaMask/core/pull/3938))
|
|
47
|
+
- **BREAKING:** `TokenDetectionController` no longer allows the `NetworkController:stateChange` event. ([#3775](https://github.com/MetaMask/core/pull/3775/))
|
|
48
|
+
- The `NetworkController:networkDidChange` event can be used instead.
|
|
49
|
+
- **BREAKING:** `TokenDetectionController` constructor no longer accepts options `networkClientId`, `onPreferencesStateChange`, `getPreferencesState`, `getTokensState`, or `addDetectedTokens` ([#3690](https://github.com/MetaMask/core/pull/3690/), [#3775](https://github.com/MetaMask/core/pull/3775/), [#3938](https://github.com/MetaMask/core/pull/3938))
|
|
50
|
+
- **BREAKING:** `TokenBalancesController` constructor no longer accepts options `onTokensStateChange`, `getSelectedAddress` ([#3690](https://github.com/MetaMask/core/pull/3690/))
|
|
51
|
+
|
|
52
|
+
### Fixed
|
|
53
|
+
|
|
54
|
+
- `TokenDetectionController.detectTokens()` now reads the chain ID keyed state properties from `TokenListController` and `TokensController` rather than incorrectly using the globally selected state properties when a network client ID is passed ([#3914](https://github.com/MetaMask/core/pull/3914))
|
|
55
|
+
- Fix `PreferencesController` state listener in `NftDetectionController` so that NFT detection is not run when any preference changes, but only when NFT detection is enabled ([#3917](https://github.com/MetaMask/core/pull/3917))
|
|
56
|
+
- Fix `isTokenListSupportedForNetwork` so that it returns false for chain 1337 ([#3777](https://github.com/MetaMask/core/pull/3777))
|
|
57
|
+
- When used in combination with `TokensController`, this makes it possible to import an ERC-20 token on a locally run chain.
|
|
58
|
+
|
|
9
59
|
## [25.0.0]
|
|
60
|
+
|
|
10
61
|
### Added
|
|
62
|
+
|
|
11
63
|
- Add Linea to price api supported chains ([#3797](https://github.com/MetaMask/core/pull/3797))
|
|
12
64
|
|
|
13
65
|
### Changed
|
|
66
|
+
|
|
14
67
|
- **BREAKING:** Convert `TokenBalancesController` to `BaseControllerV2` ([#3750](https://github.com/MetaMask/core/pull/3750))
|
|
15
|
-
- The constructor parameters have changed; rather than accepting a "config" parameter for interval and tokens we now pass both values as controller options, and a "state" parameter, there is now just a single object for all constructor arguments. This object has a mandatory `messenger` and an optional `state`, `tokens`, `interval`
|
|
16
|
-
- State now saves tokens
|
|
68
|
+
- The constructor parameters have changed; rather than accepting a "config" parameter for interval and tokens we now pass both values as controller options, and a "state" parameter, there is now just a single object for all constructor arguments. This object has a mandatory `messenger` and an optional `state`, `tokens`, `interval` properties a disabled property has also been added.
|
|
69
|
+
- State now saves tokens balances as strings and not as a BNs.
|
|
17
70
|
- Additional BN export has been removed as it was intended to be removed in the next major release.
|
|
18
71
|
- **BREAKING:** Bump `@metamask/approval-controller` peer dependency to `^5.1.2` ([#3821](https://github.com/MetaMask/core/pull/3821))
|
|
19
72
|
- **BREAKING:** Bump `@metamask/network-controller` peer dependency to `^17.2.0` ([#3821](https://github.com/MetaMask/core/pull/3821))
|
|
@@ -24,33 +77,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
24
77
|
- Bump `@metamask/polling-controller` to `^5.0.0` ([#3821](https://github.com/MetaMask/core/pull/3821))
|
|
25
78
|
|
|
26
79
|
## [24.0.0]
|
|
80
|
+
|
|
27
81
|
### Added
|
|
82
|
+
|
|
28
83
|
- Add `getDefaultTokenListState` function to `TokenListController` ([#3744](https://github.com/MetaMask/core/pull/3744))
|
|
29
84
|
- Add `getDefaultNftState` function to the `NftController` ([#3742](https://github.com/MetaMask/core/pull/3742))
|
|
30
85
|
- Add `getDefaultTokensState` function to the `TokensController` ([#3743](https://github.com/MetaMask/core/pull/3743))
|
|
31
86
|
|
|
32
87
|
### Changed
|
|
88
|
+
|
|
33
89
|
- **BREAKING:** Bump `@metamask/preferences-controller` to ^6.0.0
|
|
34
90
|
- Price API perf improvements ([#3753](https://github.com/MetaMask/core/pull/3753), [#3755](https://github.com/MetaMask/core/pull/3755))
|
|
35
91
|
- Reduce token batch size from 100 to 30
|
|
36
92
|
- Sort token addresses in query params for more cache hits
|
|
37
93
|
|
|
38
94
|
## [23.1.0]
|
|
95
|
+
|
|
39
96
|
### Added
|
|
97
|
+
|
|
40
98
|
- Add support to `CodefiTokenPricesServiceV2` for tracking degraded service ([#3691](https://github.com/MetaMask/core/pull/3691))
|
|
41
99
|
- The constructor has two new options: `onDegraded` and `degradedThreshold`. `onDegraded` is an event handler for instances of degraded service (i.e. failed or slow requests), and `degradedThreshold` determines how slow a request has to be before we consider service to be degraded.
|
|
42
100
|
|
|
43
101
|
## [23.0.0]
|
|
102
|
+
|
|
44
103
|
### Added
|
|
104
|
+
|
|
45
105
|
- Add `onBreak` handler to `CodefiTokenPricesServiceV2` ([#3677](https://github.com/MetaMask/core/pull/3677))
|
|
46
106
|
- This allows listening for "circuit breaks", which can indicate an outage. Useful for metrics.
|
|
47
107
|
- Add `fetchTokenContractExchangeRates` utility method ([#3657](https://github.com/MetaMask/core/pull/3657))
|
|
48
108
|
- `TokenListController` now exports a `TokenListControllerMessenger` type ([#3609](https://github.com/MetaMask/core/pull/3609)).
|
|
49
109
|
- `TokenDetectionController` exports types `TokenDetectionControllerMessenger`, `TokenDetectionControllerActions`, `TokenDetectionControllerGetStateAction`, `TokenDetectionControllerEvents`, `TokenDetectionControllerStateChangeEvent` ([#3609](https://github.com/MetaMask/core/pull/3609)).
|
|
50
|
-
- Add `enable` and `disable` methods to `TokenDetectionController`, which control whether the controller is able to make polling requests or all of its network calls are blocked.
|
|
110
|
+
- Add `enable` and `disable` methods to `TokenDetectionController`, which control whether the controller is able to make polling requests or all of its network calls are blocked. ([#3609](https://github.com/MetaMask/core/pull/3609)).
|
|
51
111
|
- Note that if the controller is initiated without the `disabled` constructor option set to `false`, the `enable` method will need to be called before the controller can make polling requests in response to subscribed events.
|
|
52
112
|
|
|
53
113
|
### Changed
|
|
114
|
+
|
|
54
115
|
- **BREAKING:** Bump `@metamask/approval-controller` dependency and peer dependency from `^5.1.0` to `^5.1.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
|
|
55
116
|
- **BREAKING:** Bump `@metamask/network-controller` dependency and peer dependency from `^17.0.0` to `^17.1.0` ([#3695](https://github.com/MetaMask/core/pull/3695))
|
|
56
117
|
- **BREAKING:** Bump `@metamask/preferences-controller` dependency and peer dependency from `^5.0.0` to `^5.0.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
|
|
@@ -63,19 +124,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
63
124
|
- Bump `@metamask/controller-utils` from `8.0.0` to `^8.0.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
|
|
64
125
|
|
|
65
126
|
### Fixed
|
|
127
|
+
|
|
66
128
|
- Fix error caused by OpenSea API rename of `supply` to `total_supply` ([#3692](https://github.com/MetaMask/core/pull/3692))
|
|
67
129
|
- Fix `CodefiTokenPricesServiceV2` support for Shiden ([#3683](https://github.com/MetaMask/core/pull/3683))
|
|
68
130
|
- Improve how `CodefiTokenPricesServiceV2` handles token price update failures ([#3687](https://github.com/MetaMask/core/pull/3687))
|
|
69
131
|
- Previously a single failed token price update would prevent all other token prices from updating as well. With this update, we log and error and continue when we fail to update a token price, ensuring the others still get updated.
|
|
70
132
|
|
|
71
133
|
## [22.0.0]
|
|
134
|
+
|
|
72
135
|
### Changed
|
|
136
|
+
|
|
73
137
|
- **BREAKING:** OpenSea V2 API is used instead of V1 ([#3654](https://github.com/MetaMask/core/pull/3654))
|
|
74
|
-
- `NftDetectionController` constructor now requires
|
|
138
|
+
- `NftDetectionController` constructor now requires the `NftController.getNftApi` function.
|
|
75
139
|
- NFT controllers will no longer return `last_sale` information for NFTs fetched after the OpenSea V2 update
|
|
76
140
|
|
|
77
141
|
## [21.0.0]
|
|
142
|
+
|
|
78
143
|
### Added
|
|
144
|
+
|
|
79
145
|
- Add `CodefiTokenPricesServiceV2` ([#3600](https://github.com/MetaMask/core/pull/3600), [#3655](https://github.com/MetaMask/core/pull/3655), [#3655](https://github.com/MetaMask/core/pull/3655))
|
|
80
146
|
- This class can be used for the new `tokenPricesService` argument for TokenRatesController. It uses a MetaMask API to fetch prices for tokens instead of CoinGecko.
|
|
81
147
|
- The `CodefiTokenPricesServiceV2` will retry if the token price update fails
|
|
@@ -90,6 +156,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
90
156
|
- Support token detection on Arbitrum and Optimism ([#2035](https://github.com/MetaMask/core/pull/2035))
|
|
91
157
|
|
|
92
158
|
### Changed
|
|
159
|
+
|
|
93
160
|
- **BREAKING:** `TokenRatesController` now takes a required argument `tokenPricesService` ([#3600](https://github.com/MetaMask/core/pull/3600))
|
|
94
161
|
- This object is responsible for fetching the prices for tokens held by this controller.
|
|
95
162
|
- **BREAKING:** Update signature of `TokenRatesController.updateExchangeRatesByChainId` ([#3600](https://github.com/MetaMask/core/pull/3600), [#3653](https://github.com/MetaMask/core/pull/3653))
|
|
@@ -98,8 +165,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
98
165
|
- These are needed for the new "polling by `networkClientId`" feature
|
|
99
166
|
- **BREAKING:** `AccountTrackerController` has a new required state property, `accountByChainId`([#3586](https://github.com/MetaMask/core/pull/3586))
|
|
100
167
|
- This is needed to track balances accross chains. It was introduced for the "polling by `networkClientId`" feature, but is useful on its own as well.
|
|
101
|
-
- **BREAKING
|
|
102
|
-
- **BREAKING
|
|
168
|
+
- **BREAKING:** `AccountTrackerController` adds a mutex to `refresh` making it only possible for one call to be executed at time ([#3586](https://github.com/MetaMask/core/pull/3586))
|
|
169
|
+
- **BREAKING:** `TokensController.watchAsset` now performs on-chain validation of the asset's symbol and decimals, if they're defined in the contract ([#1745](https://github.com/MetaMask/core/pull/1745))
|
|
103
170
|
- The `TokensController` constructor no longer accepts a `getERC20TokenName` option. It was no longer needed due to this change.
|
|
104
171
|
- Add new method `_getProvider`, though this is intended for internal use and should not be called externally.
|
|
105
172
|
- Additionally, if the symbol and decimals are defined in the contract, they are no longer required to be passed to `watchAsset`
|
|
@@ -123,18 +190,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
123
190
|
- Add dependencies `cockatiel` and `lodash` ([#3586](https://github.com/MetaMask/core/pull/3586), [#3655](https://github.com/MetaMask/core/pull/3655))
|
|
124
191
|
|
|
125
192
|
### Removed
|
|
193
|
+
|
|
126
194
|
- **BREAKING:** Remove `fetchExchangeRate` method from TokenRatesController ([#3600](https://github.com/MetaMask/core/pull/3600))
|
|
127
195
|
- This method (not to be confused with `updateExchangeRate`, which is still present) was only ever intended to be used internally and should not be accessed directly.
|
|
128
196
|
- **BREAKING:** Remove `getChainSlug` method from TokenRatesController ([#3600](https://github.com/MetaMask/core/pull/3600))
|
|
129
197
|
- This method was previously used in TokenRatesController to access the CoinGecko API. There is no equivalent.
|
|
130
198
|
- **BREAKING:** Remove `CoinGeckoResponse` and `CoinGeckoPlatform` types ([#3600](https://github.com/MetaMask/core/pull/3600))
|
|
131
199
|
- These types were previously used in TokenRatesController to represent data returned from the CoinGecko API. There is no equivalent.
|
|
132
|
-
- **BREAKING
|
|
200
|
+
- **BREAKING:** The TokenRatesController now only supports updating and polling rates for tokens tracked by the TokensController ([#3639](https://github.com/MetaMask/core/pull/3639))
|
|
133
201
|
- The `tokenAddresses` option has been removed from `startPollingByNetworkClientId`
|
|
134
202
|
- The `tokenContractAddresses` option has been removed from `updateExchangeRatesByChainId`
|
|
135
|
-
- **BREAKING
|
|
203
|
+
- **BREAKING:** `TokenRatesController.fetchAndMapExchangeRates` is no longer exposed publicly ([#3621](https://github.com/MetaMask/core/pull/3621))
|
|
136
204
|
|
|
137
205
|
### Fixed
|
|
206
|
+
|
|
138
207
|
- Prevent `TokenRatesController` from making redundant token rate updates when tokens change ([#3647](https://github.com/MetaMask/core/pull/3647), [#3663](https://github.com/MetaMask/core/pull/3663))
|
|
139
208
|
- Previously, token rates would be re-fetched for the globally selected network on all TokensController state changes, but now token rates are always performed for a deduplicated and normalized set of addresses, and changes to this set determine whether rates should be re-fetched.
|
|
140
209
|
- Prevent redundant overlapping token rate updates in `TokenRatesController` ([#3635](https://github.com/MetaMask/core/pull/3635))
|
|
@@ -146,7 +215,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
146
215
|
- This affects `watchNft` and `addNft` methods
|
|
147
216
|
|
|
148
217
|
## [20.0.0]
|
|
218
|
+
|
|
149
219
|
### Added
|
|
220
|
+
|
|
150
221
|
- **BREAKING**: `TokenRatesControllerState` now has required `contractExchangeRatesByChainId` property which an object keyed by `chainId` and `nativeCurrency` ([#2015](https://github.com/MetaMask/core/pull/2015))
|
|
151
222
|
- **BREAKING**: `TokenRatesController` constructor params now requires `getNetworkClientById` ([#2015](https://github.com/MetaMask/core/pull/2015))
|
|
152
223
|
- Add types `CurrencyRateControllerEvents` and `CurrencyRateControllerActions` ([#2029](https://github.com/MetaMask/core/pull/2029))
|
|
@@ -163,6 +234,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
163
234
|
- `TokenRatesController.fetchAndMapExchangeRates()` now accepts an optional `tokenAddresses` as the last parameter ([#2015](https://github.com/MetaMask/core/pull/2015))
|
|
164
235
|
|
|
165
236
|
### Changed
|
|
237
|
+
|
|
166
238
|
- **BREAKING:** Bump dependency on `@metamask/base-controller` to ^4.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
167
239
|
- This is breaking because the type of the `messenger` has backward-incompatible changes. See the changelog for this package for more.
|
|
168
240
|
- Bump `@metamask/approval-controller` to ^5.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
@@ -172,14 +244,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
172
244
|
- Bump `@metamask/preferences-controller` to ^5.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
173
245
|
|
|
174
246
|
## [19.0.0]
|
|
247
|
+
|
|
175
248
|
### Changed
|
|
249
|
+
|
|
176
250
|
- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^16.0.0
|
|
177
251
|
- Add optional `networkClientId` and `userAddress` args to remaining `NftController` public methods ([#2006](https://github.com/MetaMask/core/pull/2006))
|
|
178
252
|
- `watchNft`, `removeNft`, `removeAndIgnoreNft`, `removeNftContract`, `updateNftFavoriteStatus`, and `checkAndUpdateAllNftsOwnershipStatus` methods on `NftController` all now accept an optional options object argument containing `networkClientId` and `userAddress` to identify where in state to mutate.
|
|
179
253
|
- **BREAKING**: `addNft` no longer accepts a `chainId` property in its options argument since this value can be retrieved by the `networkClientId` property and is therefore redundant.
|
|
180
254
|
- **BREAKING**: The third and fourth arguments on NftController's `addNftVerifyOwnership` method, have been replaced with an options object containing optional properties `networkClientId`, `userAddress` and `source`. This method signature is more aligned with the options pattern for passing `networkClientId` and `userAddress` on this controller and elsewhere.
|
|
181
255
|
- **BREAKING**: `checkAndUpdateSingleNftOwnershipStatus` on NftController no longer accepts a `chainId` in its options argument. This is replaced with an optional `networkClientId` property which can be used to fetch chainId.
|
|
182
|
-
|
|
256
|
+
**\*BREAKING**: The fourth argument of the `isNftOwner` method on `NftController` is now an options object with an optional `networkClientId` property. This method signature is more aligned with the options pattern for passing `networkClientId` on this controller and elsewhere.
|
|
183
257
|
- **BREAKING**: `validateWatchNft` method on `NftController` is now private.
|
|
184
258
|
- **BREAKING**: `detectNfts` on `NftDetectionController` now accepts a single object argument with optional properties `networkClientId` and `userAddress`, rather than taking these as two sequential arguments.
|
|
185
259
|
- Bump dependency `@metamask/eth-query` from ^3.0.1 to ^4.0.0 ([#2028](https://github.com/MetaMask/core/pull/2028))
|
|
@@ -187,10 +261,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
187
261
|
- Bump `@metamask/utils` from 8.1.0 to 8.2.0 ([#1957](https://github.com/MetaMask/core/pull/1957))
|
|
188
262
|
|
|
189
263
|
### Fixed
|
|
264
|
+
|
|
190
265
|
- Add name and symbol to the payload returned by the `ERC1155Standard` class `getDetails` method for `ERC1155` contracts ([#1727](https://github.com/MetaMask/core/pull/1727))
|
|
191
266
|
|
|
192
267
|
## [18.0.0]
|
|
268
|
+
|
|
193
269
|
### Changed
|
|
270
|
+
|
|
194
271
|
- **BREAKING**: `CurrencyRateController` is now keyed by `nativeCurrency` (i.e. ticker) for `conversionDate`, `conversionRate`, and `usdConversionRate` in the `currencyRates` object. `nativeCurrency`, `pendingNativeCurrency`, and `pendingCurrentCurrency` have been removed.
|
|
195
272
|
- ```
|
|
196
273
|
export type CurrencyRateState = {
|
|
@@ -205,27 +282,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
205
282
|
>;
|
|
206
283
|
};
|
|
207
284
|
```
|
|
208
|
-
- **BREAKING**: `CurrencyRateController` now extends `PollingController`
|
|
285
|
+
- **BREAKING**: `CurrencyRateController` now extends `PollingController` ([#1805](https://github.com/MetaMask/core/pull/1805))
|
|
209
286
|
- `start()` and `stop()` methods replaced with `startPollingByNetworkClientId()`, `stopPollingByPollingToken()`, and `stopAllPolling()`
|
|
210
|
-
- **BREAKING
|
|
287
|
+
- **BREAKING:** `CurrencyRateController` now sends the `NetworkController:getNetworkClientById` action via messaging controller ([#1805](https://github.com/MetaMask/core/pull/1805))
|
|
211
288
|
|
|
212
289
|
### Fixed
|
|
290
|
+
|
|
213
291
|
- Parallelize network requests in assets controllers for performance enhancement ([#1801](https://github.com/MetaMask/core/pull/1801))
|
|
214
292
|
- Fix token detection on accounts when user changes account after token detection request is inflight ([#1848](https://github.com/MetaMask/core/pull/1848))
|
|
215
293
|
|
|
216
294
|
## [17.0.0]
|
|
295
|
+
|
|
217
296
|
### Changed
|
|
297
|
+
|
|
218
298
|
- **BREAKING:** Bump dependency on `@metamask/polling-controller` to ^1.0.0
|
|
219
299
|
- Bump dependency and peer dependency on `@metamask/network-controller` to ^15.1.0
|
|
220
300
|
|
|
221
301
|
## [16.0.0]
|
|
302
|
+
|
|
222
303
|
### Added
|
|
304
|
+
|
|
223
305
|
- Add way to start and stop different polling sessions for the same network client ID by providing extra scoping data ([#1776](https://github.com/MetaMask/core/pull/1776))
|
|
224
306
|
- Add optional second argument to `stopPollingByPollingToken` (formerly `stopPollingByNetworkClientId`)
|
|
225
307
|
- Add optional second argument to `onPollingCompleteByNetworkClientId`
|
|
226
308
|
- Add support for token detection for Linea mainnet and Linea Goerli ([#1799](https://github.com/MetaMask/core/pull/1799))
|
|
227
309
|
|
|
228
310
|
### Changed
|
|
311
|
+
|
|
229
312
|
- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^15.0.0
|
|
230
313
|
- **BREAKING:** Make `executePoll` in TokenListController private ([#1810](https://github.com/MetaMask/core/pull/1810))
|
|
231
314
|
- **BREAKING:** Update TokenListController to rename `stopPollingByNetworkClientId` to `stopPollingByPollingToken` ([#1810](https://github.com/MetaMask/core/pull/1810))
|
|
@@ -235,7 +318,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
235
318
|
- Fix support for NFT metadata stored outside IPFS ([#1772](https://github.com/MetaMask/core/pull/1772))
|
|
236
319
|
|
|
237
320
|
## [15.0.0]
|
|
321
|
+
|
|
238
322
|
### Changed
|
|
323
|
+
|
|
239
324
|
- **BREAKING**: `NftController` now expects `getNetworkClientById` in constructor options ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
240
325
|
- **BREAKING**: `NftController.addNft` function signature has changed ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
241
326
|
- Previously
|
|
@@ -261,7 +346,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
261
346
|
networkClientId?: NetworkClientId; // new
|
|
262
347
|
},
|
|
263
348
|
```
|
|
264
|
-
- `NftController.addNftVerifyOwnership`: Now accepts optional 3rd argument `networkClientId` which is used to fetch NFT metadata and determine by which chainId the added NFT should be stored in state. Also accepts optional 4th argument `source` used for metrics to identify the flow in which the NFT was added to the wallet.
|
|
349
|
+
- `NftController.addNftVerifyOwnership`: Now accepts optional 3rd argument `networkClientId` which is used to fetch NFT metadata and determine by which chainId the added NFT should be stored in state. Also accepts optional 4th argument `source` used for metrics to identify the flow in which the NFT was added to the wallet. ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
265
350
|
- `NftController.isNftOwner`: Now accepts optional `networkClientId` which is used to instantiate the provider for the correct chain and call the NFT contract to verify ownership ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
266
351
|
- `NftController.addNft` will use the chainId value derived from `networkClientId` if provided ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
267
352
|
- `NftController.watchNft` options now accepts optional `networkClientId` which is used to fetch NFT metadata and determine by which chainId the added NFT should be stored in state ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
@@ -272,19 +357,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
272
357
|
- Bump dependency and peer dependency on `@metamask/network-controller` to ^14.0.0
|
|
273
358
|
|
|
274
359
|
### Fixed
|
|
360
|
+
|
|
275
361
|
- Fix bug in TokensController where batched `addToken` overwrote each other because mutex was acquired after reading state ([#1768](https://github.com/MetaMask/core/pull/1768))
|
|
276
362
|
|
|
277
363
|
## [14.0.0]
|
|
364
|
+
|
|
278
365
|
### Changed
|
|
366
|
+
|
|
279
367
|
- Update TypeScript to v4.8.x ([#1718](https://github.com/MetaMask/core/pull/1718))
|
|
280
368
|
- Update `@metamask/rpc-errors` to `^6.0.0` ([#1690](https://github.com/MetaMask/core/pull/1690))
|
|
281
369
|
|
|
282
370
|
### Removed
|
|
371
|
+
|
|
283
372
|
- **BREAKING:** Remove AbortController polyfill
|
|
284
373
|
- This package now assumes that the AbortController global exists
|
|
285
374
|
|
|
286
375
|
## [13.0.0]
|
|
376
|
+
|
|
287
377
|
### Changed
|
|
378
|
+
|
|
288
379
|
- **BREAKING**: `TokensController` now expects `getNetworkClientById` in constructor options ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
289
380
|
- **BREAKING**: `TokensController.addToken` now accepts a single options object ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
290
381
|
```
|
|
@@ -298,7 +389,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
298
389
|
networkClientId?: NetworkClientId;
|
|
299
390
|
}
|
|
300
391
|
```
|
|
301
|
-
- **BREAKING
|
|
392
|
+
- **BREAKING:** Bump peer dependency on `@metamask/network-controller` to ^13.0.0 ([#1633](https://github.com/MetaMask/core/pull/1633))
|
|
302
393
|
- **CHANGED**: `TokensController.addToken` will use the chain ID value derived from state for `networkClientId` if provided ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
303
394
|
- **CHANGED**: `TokensController.addTokens` now accepts an optional `networkClientId` as the last parameter ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
304
395
|
- **CHANGED**: `TokensController.addTokens` will use the chain ID value derived from state for `networkClientId` if provided ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
@@ -307,33 +398,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
307
398
|
- Bump dependency on `@metamask/preferences-controller` to ^4.4.1 ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
308
399
|
|
|
309
400
|
## [12.0.0]
|
|
401
|
+
|
|
310
402
|
### Added
|
|
403
|
+
|
|
311
404
|
- Add `AssetsContractController` methods `getProvider`, `getChainId`, `getERC721Standard`, and `getERC1155Standard` ([#1638](https://github.com/MetaMask/core/pull/1638))
|
|
312
405
|
|
|
313
406
|
### Changed
|
|
407
|
+
|
|
314
408
|
- **BREAKING**: Add `getNetworkClientById` to `AssetsContractController` constructor options ([#1638](https://github.com/MetaMask/core/pull/1638))
|
|
315
|
-
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
409
|
+
- Add optional `networkClientId` parameter to various `AssetContractController` methods ([#1638](https://github.com/MetaMask/core/pull/1638))
|
|
410
|
+
- The affected methods are:
|
|
411
|
+
- `getERC20BalanceOf`
|
|
412
|
+
- `getERC20TokenDecimals`
|
|
413
|
+
- `getERC20TokenName`
|
|
414
|
+
- `getERC721NftTokenId`
|
|
415
|
+
- `getTokenStandardAndDetails`
|
|
416
|
+
- `getERC721TokenURI`
|
|
417
|
+
- `getERC721AssetName`
|
|
418
|
+
- `getERC721AssetSymbol`
|
|
419
|
+
- `getERC721OwnerOf`
|
|
420
|
+
- `getERC1155TokenURI`
|
|
421
|
+
- `getERC1155BalanceOf`
|
|
422
|
+
- `transferSingleERC1155`
|
|
423
|
+
- `getBalancesInSingleCall`
|
|
330
424
|
|
|
331
425
|
## [11.1.0]
|
|
426
|
+
|
|
332
427
|
### Added
|
|
428
|
+
|
|
333
429
|
- Add `tokenURI` to `NftMetadata` type ([#1577](https://github.com/MetaMask/core/pull/1577))
|
|
334
430
|
- Populate token URL for NFT metadata under `tokenURI` ([#1577](https://github.com/MetaMask/core/pull/1577))
|
|
335
431
|
|
|
336
432
|
### Changed
|
|
433
|
+
|
|
337
434
|
- Bump dependency and peer dependency on `@metamask/approval-controller` to ^3.5.1
|
|
338
435
|
- Bump dependency on `@metamask/base-controller` to ^3.2.1
|
|
339
436
|
- Bump dependency on `@metamask/controller-utils` to ^4.3.2
|
|
@@ -342,38 +439,47 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
342
439
|
- Update NftController to add fallback for when IPFS gateway is disabled ([#1577](https://github.com/MetaMask/core/pull/1577))
|
|
343
440
|
|
|
344
441
|
## [11.0.1]
|
|
442
|
+
|
|
345
443
|
### Changed
|
|
444
|
+
|
|
346
445
|
- Replace `eth-query` ^2.1.2 with `@metamask/eth-query` ^3.0.1 ([#1546](https://github.com/MetaMask/core/pull/1546))
|
|
347
446
|
|
|
348
447
|
## [11.0.0]
|
|
448
|
+
|
|
349
449
|
### Added
|
|
450
|
+
|
|
350
451
|
- Add a `stop` method to stop polling
|
|
351
452
|
|
|
352
453
|
### Changed
|
|
454
|
+
|
|
353
455
|
- **BREAKING**: New required constructor parameters for the `TokenRatesController` ([#1497](https://github.com/MetaMask/core/pull/1497), [#1511](https://github.com/MetaMask/core/pull/1511))
|
|
354
456
|
- The new required parameters are `ticker`, `onSelectedAddress`, and `onPreferencesStateChange`
|
|
355
|
-
- **BREAKING
|
|
356
|
-
- **BREAKING
|
|
457
|
+
- **BREAKING:** Remove `onCurrencyRateStateChange` constructor parameter from `TokenRatesController` ([#1496](https://github.com/MetaMask/core/pull/1496))
|
|
458
|
+
- **BREAKING:** Disable `TokenRatesController` automatic polling ([#1501](https://github.com/MetaMask/core/pull/1501))
|
|
357
459
|
- Polling must be started explicitly by calling the `start` method
|
|
358
460
|
- The token rates are not updated upon state changes when polling is disabled.
|
|
359
|
-
- **BREAKING
|
|
461
|
+
- **BREAKING:** Replace the `poll` method with `start` ([#1501](https://github.com/MetaMask/core/pull/1501))
|
|
360
462
|
- The `start` method does not offer a way to change the interval. That must be done by calling `.configure` instead
|
|
361
|
-
- **BREAKING
|
|
463
|
+
- **BREAKING:** Remove `TokenRatecontroller` setter for `chainId` and `tokens` properties ([#1505](https://github.com/MetaMask/core/pull/1505))
|
|
362
464
|
- Bump @metamask/abi-utils from 1.2.0 to 2.0.1 ([#1525](https://github.com/MetaMask/core/pull/1525))
|
|
363
465
|
- Update `@metamask/utils` to `^6.2.0` ([#1514](https://github.com/MetaMask/core/pull/1514))
|
|
364
466
|
- Remove unnecessary `babel-runtime` dependency ([#1504](https://github.com/MetaMask/core/pull/1504))
|
|
365
467
|
|
|
366
468
|
### Fixed
|
|
469
|
+
|
|
367
470
|
- Fix bug where token rates were incorrect after first update if initialized with a non-Ethereum selected network ([#1497](https://github.com/MetaMask/core/pull/1497))
|
|
368
471
|
- Fix bug where token rates would be invalid if event handlers were triggered in the wrong order ([#1496](https://github.com/MetaMask/core/pull/1496), [#1511](https://github.com/MetaMask/core/pull/1511))
|
|
369
472
|
- Prevent redundant token rate updates ([#1512](https://github.com/MetaMask/core/pull/1512))
|
|
370
473
|
|
|
371
474
|
## [10.0.0]
|
|
475
|
+
|
|
372
476
|
### Added
|
|
477
|
+
|
|
373
478
|
- The method `getERC20TokenName` has been added to `AssetsContractController` ([#1127](https://github.com/MetaMask/core/pull/1127))
|
|
374
479
|
- This method gets the token name from the token contract
|
|
375
480
|
|
|
376
481
|
### Changed
|
|
482
|
+
|
|
377
483
|
- **BREAKING:** The tokens controller now requires `onTokenListStateChange` and `getERC20TokenName` as constructor parameters ([#1127](https://github.com/MetaMask/core/pull/1127))
|
|
378
484
|
- The `getERC20TokenName` method is used to get the token name for tokens added via `wallet_watchAsset`
|
|
379
485
|
- The `onTokenListStateChange` method is used to trigger a name update when the token list changes. On each change, token names are copied from the token list if they're missing from token controller state.
|
|
@@ -384,19 +490,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
384
490
|
- The `Token` type now includes an optional `name` field ([#1127](https://github.com/MetaMask/core/pull/1127))
|
|
385
491
|
|
|
386
492
|
## [9.2.0]
|
|
493
|
+
|
|
387
494
|
### Added
|
|
495
|
+
|
|
388
496
|
- Add validation that the nft standard matches the type argument of a `wallet_watchAsset` request when type is 'ERC721' or 'ERC1155' ([#1455](https://github.com/MetaMask/core/pull/1455))
|
|
389
497
|
|
|
390
498
|
## [9.1.0]
|
|
499
|
+
|
|
391
500
|
### Added
|
|
501
|
+
|
|
392
502
|
- Add a fifth argument, `source`, to NftController's `addNft` method ([#1417](https://github.com/MetaMask/core/pull/1417))
|
|
393
503
|
- This argument can be used to specify whether the NFT was detected, added manually, or suggested by a dapp
|
|
394
504
|
|
|
395
505
|
### Fixed
|
|
506
|
+
|
|
396
507
|
- Fix `watchNft` in NftController to ensure that if the network changes before the user accepts the request, the NFT is added to the chain ID and address before the request was initiated ([#1417](https://github.com/MetaMask/core/pull/1417))
|
|
397
508
|
|
|
398
509
|
## [9.0.0]
|
|
510
|
+
|
|
399
511
|
### Added
|
|
512
|
+
|
|
400
513
|
- **BREAKING**: Add required options `getSelectedAddress` and `getMultiAccountBalancesEnabled` to AccountTrackerController constructor and make use of them when refreshing account balances ([#1146](https://github.com/MetaMask/core/pull/1146))
|
|
401
514
|
- Previously, the controller would refresh all account balances, but these options can be used to only refresh the currently selected account
|
|
402
515
|
- **BREAKING:** Add logic to support validating and adding ERC721 and ERC1155 tokens to NFTController state via `wallet_watchAsset` API. ([#1173](https://github.com/MetaMask/core/pull/1173), [#1406](https://github.com/MetaMask/core/pull/1406))
|
|
@@ -404,15 +517,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
404
517
|
- The `NFTController` now requires an instance of a ControllerMessenger to be passed to its constructor. This is messenger is used to pass the `watchNFT` message to the `ApprovalController`.
|
|
405
518
|
|
|
406
519
|
### Changed
|
|
520
|
+
|
|
407
521
|
- Add dependency on `@ethersproject/address` ([#1173](https://github.com/MetaMask/core/pull/1173))
|
|
408
522
|
- Replace `eth-rpc-errors` with `@metamask/rpc-errors` ([#1173](https://github.com/MetaMask/core/pull/1173))
|
|
409
523
|
|
|
410
524
|
## [8.0.0]
|
|
525
|
+
|
|
411
526
|
### Added
|
|
527
|
+
|
|
412
528
|
- Support NFT detection on Ethereum Mainnet custom RPC endpoints ([#1360](https://github.com/MetaMask/core/pull/1360))
|
|
413
529
|
- Enable token detection for the Aurora network ([#1327](https://github.com/MetaMask/core/pull/1327))
|
|
414
530
|
|
|
415
531
|
### Changed
|
|
532
|
+
|
|
416
533
|
- **BREAKING:** Bump to Node 16 ([#1262](https://github.com/MetaMask/core/pull/1262))
|
|
417
534
|
- **BREAKING:** Change format of chain ID in state to 0x-prefixed hex string ([#1367](https://github.com/MetaMask/core/pull/1367))
|
|
418
535
|
- The functions `isTokenDetectionSupportedForNetwork` and `formatIconUrlWithProxy` now expect a chain ID as type `Hex` rather than as a decimal `string`
|
|
@@ -432,17 +549,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
432
549
|
- The tokens controller `addDetectedTokens` method now accepts the `chainId` property of the `detectionDetails` parameter to be of type `Hex` rather than decimal `string`.
|
|
433
550
|
- The tokens controller state properties `allTokens`, `allIgnoredTokens`, and `allDetectedTokens` are now keyed by chain ID in `Hex` format rather than decimal `string`.
|
|
434
551
|
- This requires a state migration
|
|
435
|
-
- **BREAKING
|
|
552
|
+
- **BREAKING:** Use approval controller for suggested assets ([#1261](https://github.com/MetaMask/core/pull/1261), [#1268](https://github.com/MetaMask/core/pull/1268))
|
|
436
553
|
- The actions `ApprovalController:acceptRequest` and `ApprovalController:rejectRequest` are no longer required by the token controller messenger.
|
|
437
554
|
- The `suggestedAssets` state has been removed, which means that suggested assets are no longer persisted in state
|
|
438
555
|
- The return type for `watchAsset` has changed. It now returns a Promise that settles after the request has been confirmed or rejected.
|
|
439
556
|
- **BREAKING:** Initialize controllers with the current network ([#1361](https://github.com/MetaMask/core/pull/1361))
|
|
440
557
|
- The following controllers now have a new `chainId` required constructor parameter:
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
558
|
+
- `AssetsContractController`
|
|
559
|
+
- `NftController`
|
|
560
|
+
- `NftDetectionController`
|
|
561
|
+
- `TokenRatesController`
|
|
562
|
+
- `TokensController`
|
|
446
563
|
- **BREAKING:** The token list controller messenger requires the `NetworkController:stateChange` event instead of the `NetworkController:providerConfigChange` event ([#1329](https://github.com/MetaMask/core/pull/1329))
|
|
447
564
|
- **BREAKING:** The token list controller `onNetworkStateChange` option now has a more restrictive type ([#1329](https://github.com/MetaMask/core/pull/1329))
|
|
448
565
|
- The event handler parameter type has been changed from `NetworkState | ProviderConfig` to `NetworkState`
|
|
@@ -454,42 +571,58 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
454
571
|
- Bump @metamask/utils from 5.0.1 to 5.0.2 ([#1271](https://github.com/MetaMask/core/pull/1271))
|
|
455
572
|
|
|
456
573
|
### Removed
|
|
574
|
+
|
|
457
575
|
- **BREAKING:** Remove the `networkType` configuration option from the NFT detection controller, NFT controller, and tokens controller ([#1360](https://github.com/MetaMask/core/pull/1360), [#1359](https://github.com/MetaMask/core/pull/1359))
|
|
458
576
|
- **BREAKING:** Remove the `SuggestedAssetMeta` and `SuggestedAssetMetaBase` types from the token controller ([#1268](https://github.com/MetaMask/core/pull/1268))
|
|
459
577
|
- **BREAKING:** Remove the `acceptWatchAsset` and `rejectWatchAsset` methods from the token controller ([#1268](https://github.com/MetaMask/core/pull/1268))
|
|
460
578
|
- Suggested assets can be accepted or rejected using the approval controller instead
|
|
461
579
|
|
|
462
580
|
## [7.0.0]
|
|
581
|
+
|
|
463
582
|
### Changed
|
|
583
|
+
|
|
464
584
|
- **BREAKING**: peerDeps: @metamask/network-controller@6.0.0->8.0.0 ([#1196](https://github.com/MetaMask/core/pull/1196))
|
|
465
585
|
|
|
466
586
|
## [6.0.0]
|
|
587
|
+
|
|
467
588
|
### Changed
|
|
589
|
+
|
|
468
590
|
- **BREAKING:** Create approval requests using `@metamask/approval-controller` ([#1166](https://github.com/MetaMask/core/pull/1166))
|
|
469
591
|
|
|
470
592
|
## [5.1.0]
|
|
593
|
+
|
|
471
594
|
### Added
|
|
595
|
+
|
|
472
596
|
- Support watching assets on a specific account ([#1124](https://github.com/MetaMask/core/pull/1124))
|
|
473
597
|
|
|
474
598
|
## [5.0.1]
|
|
599
|
+
|
|
475
600
|
### Changed
|
|
601
|
+
|
|
476
602
|
- Update `@metamask/contract-metadata` from 2.1.0 to 2.3.1 ([#1141](https://github.com/MetaMask/core/pull/1141))
|
|
477
603
|
|
|
478
604
|
## [5.0.0]
|
|
605
|
+
|
|
479
606
|
### Removed
|
|
607
|
+
|
|
480
608
|
- **BREAKING:** Remove `isomorphic-fetch` ([#1106](https://github.com/MetaMask/controllers/pull/1106))
|
|
481
609
|
- Consumers must now import `isomorphic-fetch` or another polyfill themselves if they are running in an environment without `fetch`
|
|
482
610
|
|
|
483
611
|
## [4.0.1]
|
|
612
|
+
|
|
484
613
|
### Fixed
|
|
614
|
+
|
|
485
615
|
- Update Nft Controller to add the NFT back to its own group if we are re-importing it ([#1082](https://github.com/MetaMask/core/pull/1082))
|
|
486
616
|
|
|
487
617
|
## [4.0.0]
|
|
618
|
+
|
|
488
619
|
### Added
|
|
620
|
+
|
|
489
621
|
- Add Sepolia support to the currency rate controller ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
490
622
|
- The currency rate controller will now treat Sepolia as a testnet, and return the Mainnet exchange rate when asked for the Sepolia exchange rate.
|
|
491
623
|
|
|
492
624
|
### Changed
|
|
625
|
+
|
|
493
626
|
- **BREAKING:** Update `@metamask/network-controller` peer dependency to v3 ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
494
627
|
- **BREAKING:** Migrate from `metaswap` to `metafi` subdomain for OpenSea proxy and token icons API ([#1060](https://github.com/MetaMask/core/pull/1060))
|
|
495
628
|
- Rename this repository to `core` ([#1031](https://github.com/MetaMask/controllers/pull/1031))
|
|
@@ -497,29 +630,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
497
630
|
- Update `@metamask/controller-utils` package ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
498
631
|
|
|
499
632
|
## Removed
|
|
633
|
+
|
|
500
634
|
- **BREAKING**: Drop support for Ropsten, Rinkeby, and Kovan ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
501
635
|
- The currency rate controller no longer has special handling of these three networks. It used to return the Mainnet exchange rate for these three networks, but now it includes no special handling for them.
|
|
502
636
|
- The NFT controller no longer supports the Rinkeby OpenSea test API.
|
|
503
637
|
|
|
504
638
|
## [3.0.1]
|
|
639
|
+
|
|
505
640
|
### Changed
|
|
641
|
+
|
|
506
642
|
- Export `isTokenDetectionSupportedForNetwork` function ([#1034](https://github.com/MetaMask/controllers/pull/1034))
|
|
507
643
|
- Update `@metamask/contract-metadata` from 1.35.0 to 2.1.0 ([#1013](https://github.com/MetaMask/controllers/pull/1013))
|
|
508
644
|
|
|
509
645
|
### Fixed
|
|
646
|
+
|
|
510
647
|
- Fix token controller state updates ([#1015](https://github.com/MetaMask/controllers/pull/1015))
|
|
511
648
|
- Attempts to empty the list of "added", "ignored", or "detected" tokens were not saved in state correctly, resulting in that operation being undone after switching account or network.
|
|
512
649
|
|
|
513
650
|
## [3.0.0]
|
|
651
|
+
|
|
514
652
|
### Changed
|
|
653
|
+
|
|
515
654
|
- **BREAKING:** A new private property, controlled by the `start` and `stop` methods, is added to the CurrencyRateController: `enabled`. When this is false, no network requests will be made from the controller. Previously, setNativeCurrency or setCurrentCurrency would trigger a network request. That is now prevented if `enabled` is false. ([#1002](https://github.com/MetaMask/core/pull/1002))
|
|
516
655
|
|
|
517
656
|
### Fixed
|
|
657
|
+
|
|
518
658
|
- The TokenRatesController no longer overwrites the `disabled` config property passed to the constructor, allowing the controller to be instantiated with `config.disabled` set to either true or false. ([#1002](https://github.com/MetaMask/core/pull/1002))
|
|
519
659
|
- This package will now warn if a required package is not present ([#1003](https://github.com/MetaMask/core/pull/1003))
|
|
520
660
|
|
|
521
661
|
## [2.0.0]
|
|
662
|
+
|
|
522
663
|
### Changed
|
|
664
|
+
|
|
523
665
|
- **BREAKING:** Update `onNetworkStateChange`, a constructor option for several controllers, to take an object with a `providerConfig` property instead of `provider` ([#995](https://github.com/MetaMask/core/pull/995))
|
|
524
666
|
- This affects:
|
|
525
667
|
- AssetsContractController
|
|
@@ -533,22 +675,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
533
675
|
- Relax dependencies on `@metamask/base-controller`, `@metamask/controller-utils`, `@metamask/network-controller`, and `@metamask/preferences-controller` (use `^` instead of `~`) ([#998](https://github.com/MetaMask/core/pull/998))
|
|
534
676
|
|
|
535
677
|
## [1.0.1]
|
|
678
|
+
|
|
536
679
|
### Fixed
|
|
680
|
+
|
|
537
681
|
- Fix race condition where some token detections can get mistakenly added to the wrong account ([#956](https://github.com/MetaMask/core/pull/956))
|
|
538
682
|
|
|
539
683
|
## [1.0.0]
|
|
684
|
+
|
|
540
685
|
### Added
|
|
686
|
+
|
|
541
687
|
- Initial release
|
|
688
|
+
|
|
542
689
|
- As a result of converting our shared controllers repo into a monorepo ([#831](https://github.com/MetaMask/core/pull/831)), we've created this package from select parts of [`@metamask/controllers` v33.0.0](https://github.com/MetaMask/core/tree/v33.0.0), namely:
|
|
690
|
+
|
|
543
691
|
- Everything in `src/assets`
|
|
544
692
|
- Asset-related functions from `src/util.ts` and accompanying tests
|
|
545
693
|
|
|
546
694
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
547
695
|
|
|
548
696
|
### Changed
|
|
697
|
+
|
|
549
698
|
- Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))
|
|
550
699
|
|
|
551
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@
|
|
700
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@26.0.0...HEAD
|
|
701
|
+
[26.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@25.0.0...@metamask/assets-controllers@26.0.0
|
|
552
702
|
[25.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@24.0.0...@metamask/assets-controllers@25.0.0
|
|
553
703
|
[24.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@23.1.0...@metamask/assets-controllers@24.0.0
|
|
554
704
|
[23.1.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@23.0.0...@metamask/assets-controllers@23.1.0
|