@metamask-previews/assets-controllers 25.0.0-preview.8cdddaf → 25.0.0-preview.cbe2fbb7
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 +127 -27
- package/package.json +1 -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/),
|
|
@@ -7,13 +8,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
8
|
## [Unreleased]
|
|
8
9
|
|
|
9
10
|
## [25.0.0]
|
|
11
|
+
|
|
10
12
|
### Added
|
|
13
|
+
|
|
11
14
|
- Add Linea to price api supported chains ([#3797](https://github.com/MetaMask/core/pull/3797))
|
|
12
15
|
|
|
13
16
|
### Changed
|
|
17
|
+
|
|
14
18
|
- **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
|
|
19
|
+
- 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.
|
|
20
|
+
- State now saves tokens balances as strings and not as a BNs.
|
|
17
21
|
- Additional BN export has been removed as it was intended to be removed in the next major release.
|
|
18
22
|
- **BREAKING:** Bump `@metamask/approval-controller` peer dependency to `^5.1.2` ([#3821](https://github.com/MetaMask/core/pull/3821))
|
|
19
23
|
- **BREAKING:** Bump `@metamask/network-controller` peer dependency to `^17.2.0` ([#3821](https://github.com/MetaMask/core/pull/3821))
|
|
@@ -24,33 +28,41 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
24
28
|
- Bump `@metamask/polling-controller` to `^5.0.0` ([#3821](https://github.com/MetaMask/core/pull/3821))
|
|
25
29
|
|
|
26
30
|
## [24.0.0]
|
|
31
|
+
|
|
27
32
|
### Added
|
|
33
|
+
|
|
28
34
|
- Add `getDefaultTokenListState` function to `TokenListController` ([#3744](https://github.com/MetaMask/core/pull/3744))
|
|
29
35
|
- Add `getDefaultNftState` function to the `NftController` ([#3742](https://github.com/MetaMask/core/pull/3742))
|
|
30
36
|
- Add `getDefaultTokensState` function to the `TokensController` ([#3743](https://github.com/MetaMask/core/pull/3743))
|
|
31
37
|
|
|
32
38
|
### Changed
|
|
39
|
+
|
|
33
40
|
- **BREAKING:** Bump `@metamask/preferences-controller` to ^6.0.0
|
|
34
41
|
- Price API perf improvements ([#3753](https://github.com/MetaMask/core/pull/3753), [#3755](https://github.com/MetaMask/core/pull/3755))
|
|
35
42
|
- Reduce token batch size from 100 to 30
|
|
36
43
|
- Sort token addresses in query params for more cache hits
|
|
37
44
|
|
|
38
45
|
## [23.1.0]
|
|
46
|
+
|
|
39
47
|
### Added
|
|
48
|
+
|
|
40
49
|
- Add support to `CodefiTokenPricesServiceV2` for tracking degraded service ([#3691](https://github.com/MetaMask/core/pull/3691))
|
|
41
50
|
- 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
51
|
|
|
43
52
|
## [23.0.0]
|
|
53
|
+
|
|
44
54
|
### Added
|
|
55
|
+
|
|
45
56
|
- Add `onBreak` handler to `CodefiTokenPricesServiceV2` ([#3677](https://github.com/MetaMask/core/pull/3677))
|
|
46
57
|
- This allows listening for "circuit breaks", which can indicate an outage. Useful for metrics.
|
|
47
58
|
- Add `fetchTokenContractExchangeRates` utility method ([#3657](https://github.com/MetaMask/core/pull/3657))
|
|
48
59
|
- `TokenListController` now exports a `TokenListControllerMessenger` type ([#3609](https://github.com/MetaMask/core/pull/3609)).
|
|
49
60
|
- `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.
|
|
61
|
+
- 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
62
|
- 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
63
|
|
|
53
64
|
### Changed
|
|
65
|
+
|
|
54
66
|
- **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
67
|
- **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
68
|
- **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 +75,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
63
75
|
- Bump `@metamask/controller-utils` from `8.0.0` to `^8.0.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
|
|
64
76
|
|
|
65
77
|
### Fixed
|
|
78
|
+
|
|
66
79
|
- Fix error caused by OpenSea API rename of `supply` to `total_supply` ([#3692](https://github.com/MetaMask/core/pull/3692))
|
|
67
80
|
- Fix `CodefiTokenPricesServiceV2` support for Shiden ([#3683](https://github.com/MetaMask/core/pull/3683))
|
|
68
81
|
- Improve how `CodefiTokenPricesServiceV2` handles token price update failures ([#3687](https://github.com/MetaMask/core/pull/3687))
|
|
69
82
|
- 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
83
|
|
|
71
84
|
## [22.0.0]
|
|
85
|
+
|
|
72
86
|
### Changed
|
|
87
|
+
|
|
73
88
|
- **BREAKING:** OpenSea V2 API is used instead of V1 ([#3654](https://github.com/MetaMask/core/pull/3654))
|
|
74
|
-
- `NftDetectionController` constructor now requires
|
|
89
|
+
- `NftDetectionController` constructor now requires the `NftController.getNftApi` function.
|
|
75
90
|
- NFT controllers will no longer return `last_sale` information for NFTs fetched after the OpenSea V2 update
|
|
76
91
|
|
|
77
92
|
## [21.0.0]
|
|
93
|
+
|
|
78
94
|
### Added
|
|
95
|
+
|
|
79
96
|
- 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
97
|
- 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
98
|
- The `CodefiTokenPricesServiceV2` will retry if the token price update fails
|
|
@@ -90,6 +107,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
90
107
|
- Support token detection on Arbitrum and Optimism ([#2035](https://github.com/MetaMask/core/pull/2035))
|
|
91
108
|
|
|
92
109
|
### Changed
|
|
110
|
+
|
|
93
111
|
- **BREAKING:** `TokenRatesController` now takes a required argument `tokenPricesService` ([#3600](https://github.com/MetaMask/core/pull/3600))
|
|
94
112
|
- This object is responsible for fetching the prices for tokens held by this controller.
|
|
95
113
|
- **BREAKING:** Update signature of `TokenRatesController.updateExchangeRatesByChainId` ([#3600](https://github.com/MetaMask/core/pull/3600), [#3653](https://github.com/MetaMask/core/pull/3653))
|
|
@@ -123,6 +141,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
123
141
|
- Add dependencies `cockatiel` and `lodash` ([#3586](https://github.com/MetaMask/core/pull/3586), [#3655](https://github.com/MetaMask/core/pull/3655))
|
|
124
142
|
|
|
125
143
|
### Removed
|
|
144
|
+
|
|
126
145
|
- **BREAKING:** Remove `fetchExchangeRate` method from TokenRatesController ([#3600](https://github.com/MetaMask/core/pull/3600))
|
|
127
146
|
- 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
147
|
- **BREAKING:** Remove `getChainSlug` method from TokenRatesController ([#3600](https://github.com/MetaMask/core/pull/3600))
|
|
@@ -135,6 +154,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
135
154
|
- **BREAKING**: `TokenRatesController.fetchAndMapExchangeRates` is no longer exposed publicly ([#3621](https://github.com/MetaMask/core/pull/3621))
|
|
136
155
|
|
|
137
156
|
### Fixed
|
|
157
|
+
|
|
138
158
|
- 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
159
|
- 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
160
|
- Prevent redundant overlapping token rate updates in `TokenRatesController` ([#3635](https://github.com/MetaMask/core/pull/3635))
|
|
@@ -146,7 +166,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
146
166
|
- This affects `watchNft` and `addNft` methods
|
|
147
167
|
|
|
148
168
|
## [20.0.0]
|
|
169
|
+
|
|
149
170
|
### Added
|
|
171
|
+
|
|
150
172
|
- **BREAKING**: `TokenRatesControllerState` now has required `contractExchangeRatesByChainId` property which an object keyed by `chainId` and `nativeCurrency` ([#2015](https://github.com/MetaMask/core/pull/2015))
|
|
151
173
|
- **BREAKING**: `TokenRatesController` constructor params now requires `getNetworkClientById` ([#2015](https://github.com/MetaMask/core/pull/2015))
|
|
152
174
|
- Add types `CurrencyRateControllerEvents` and `CurrencyRateControllerActions` ([#2029](https://github.com/MetaMask/core/pull/2029))
|
|
@@ -163,6 +185,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
163
185
|
- `TokenRatesController.fetchAndMapExchangeRates()` now accepts an optional `tokenAddresses` as the last parameter ([#2015](https://github.com/MetaMask/core/pull/2015))
|
|
164
186
|
|
|
165
187
|
### Changed
|
|
188
|
+
|
|
166
189
|
- **BREAKING:** Bump dependency on `@metamask/base-controller` to ^4.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
167
190
|
- This is breaking because the type of the `messenger` has backward-incompatible changes. See the changelog for this package for more.
|
|
168
191
|
- Bump `@metamask/approval-controller` to ^5.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
@@ -172,14 +195,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
172
195
|
- Bump `@metamask/preferences-controller` to ^5.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
|
|
173
196
|
|
|
174
197
|
## [19.0.0]
|
|
198
|
+
|
|
175
199
|
### Changed
|
|
200
|
+
|
|
176
201
|
- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^16.0.0
|
|
177
202
|
- Add optional `networkClientId` and `userAddress` args to remaining `NftController` public methods ([#2006](https://github.com/MetaMask/core/pull/2006))
|
|
178
203
|
- `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
204
|
- **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
205
|
- **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
206
|
- **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
|
-
|
|
207
|
+
**\*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
208
|
- **BREAKING**: `validateWatchNft` method on `NftController` is now private.
|
|
184
209
|
- **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
210
|
- Bump dependency `@metamask/eth-query` from ^3.0.1 to ^4.0.0 ([#2028](https://github.com/MetaMask/core/pull/2028))
|
|
@@ -187,10 +212,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
187
212
|
- Bump `@metamask/utils` from 8.1.0 to 8.2.0 ([#1957](https://github.com/MetaMask/core/pull/1957))
|
|
188
213
|
|
|
189
214
|
### Fixed
|
|
215
|
+
|
|
190
216
|
- 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
217
|
|
|
192
218
|
## [18.0.0]
|
|
219
|
+
|
|
193
220
|
### Changed
|
|
221
|
+
|
|
194
222
|
- **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
223
|
- ```
|
|
196
224
|
export type CurrencyRateState = {
|
|
@@ -205,27 +233,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
205
233
|
>;
|
|
206
234
|
};
|
|
207
235
|
```
|
|
208
|
-
- **BREAKING**: `CurrencyRateController` now extends `PollingController`
|
|
236
|
+
- **BREAKING**: `CurrencyRateController` now extends `PollingController` ([#1805](https://github.com/MetaMask/core/pull/1805))
|
|
209
237
|
- `start()` and `stop()` methods replaced with `startPollingByNetworkClientId()`, `stopPollingByPollingToken()`, and `stopAllPolling()`
|
|
210
238
|
- **BREAKING**: `CurrencyRateController` now sends the `NetworkController:getNetworkClientById` action via messaging controller ([#1805](https://github.com/MetaMask/core/pull/1805))
|
|
211
239
|
|
|
212
240
|
### Fixed
|
|
241
|
+
|
|
213
242
|
- Parallelize network requests in assets controllers for performance enhancement ([#1801](https://github.com/MetaMask/core/pull/1801))
|
|
214
243
|
- Fix token detection on accounts when user changes account after token detection request is inflight ([#1848](https://github.com/MetaMask/core/pull/1848))
|
|
215
244
|
|
|
216
245
|
## [17.0.0]
|
|
246
|
+
|
|
217
247
|
### Changed
|
|
248
|
+
|
|
218
249
|
- **BREAKING:** Bump dependency on `@metamask/polling-controller` to ^1.0.0
|
|
219
250
|
- Bump dependency and peer dependency on `@metamask/network-controller` to ^15.1.0
|
|
220
251
|
|
|
221
252
|
## [16.0.0]
|
|
253
|
+
|
|
222
254
|
### Added
|
|
255
|
+
|
|
223
256
|
- 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
257
|
- Add optional second argument to `stopPollingByPollingToken` (formerly `stopPollingByNetworkClientId`)
|
|
225
258
|
- Add optional second argument to `onPollingCompleteByNetworkClientId`
|
|
226
259
|
- Add support for token detection for Linea mainnet and Linea Goerli ([#1799](https://github.com/MetaMask/core/pull/1799))
|
|
227
260
|
|
|
228
261
|
### Changed
|
|
262
|
+
|
|
229
263
|
- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^15.0.0
|
|
230
264
|
- **BREAKING:** Make `executePoll` in TokenListController private ([#1810](https://github.com/MetaMask/core/pull/1810))
|
|
231
265
|
- **BREAKING:** Update TokenListController to rename `stopPollingByNetworkClientId` to `stopPollingByPollingToken` ([#1810](https://github.com/MetaMask/core/pull/1810))
|
|
@@ -235,7 +269,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
235
269
|
- Fix support for NFT metadata stored outside IPFS ([#1772](https://github.com/MetaMask/core/pull/1772))
|
|
236
270
|
|
|
237
271
|
## [15.0.0]
|
|
272
|
+
|
|
238
273
|
### Changed
|
|
274
|
+
|
|
239
275
|
- **BREAKING**: `NftController` now expects `getNetworkClientById` in constructor options ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
240
276
|
- **BREAKING**: `NftController.addNft` function signature has changed ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
241
277
|
- Previously
|
|
@@ -261,7 +297,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
261
297
|
networkClientId?: NetworkClientId; // new
|
|
262
298
|
},
|
|
263
299
|
```
|
|
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.
|
|
300
|
+
- `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
301
|
- `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
302
|
- `NftController.addNft` will use the chainId value derived from `networkClientId` if provided ([#1698](https://github.com/MetaMask/core/pull/1698))
|
|
267
303
|
- `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 +308,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
272
308
|
- Bump dependency and peer dependency on `@metamask/network-controller` to ^14.0.0
|
|
273
309
|
|
|
274
310
|
### Fixed
|
|
311
|
+
|
|
275
312
|
- 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
313
|
|
|
277
314
|
## [14.0.0]
|
|
315
|
+
|
|
278
316
|
### Changed
|
|
317
|
+
|
|
279
318
|
- Update TypeScript to v4.8.x ([#1718](https://github.com/MetaMask/core/pull/1718))
|
|
280
319
|
- Update `@metamask/rpc-errors` to `^6.0.0` ([#1690](https://github.com/MetaMask/core/pull/1690))
|
|
281
320
|
|
|
282
321
|
### Removed
|
|
322
|
+
|
|
283
323
|
- **BREAKING:** Remove AbortController polyfill
|
|
284
324
|
- This package now assumes that the AbortController global exists
|
|
285
325
|
|
|
286
326
|
## [13.0.0]
|
|
327
|
+
|
|
287
328
|
### Changed
|
|
329
|
+
|
|
288
330
|
- **BREAKING**: `TokensController` now expects `getNetworkClientById` in constructor options ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
289
331
|
- **BREAKING**: `TokensController.addToken` now accepts a single options object ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
290
332
|
```
|
|
@@ -307,33 +349,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
307
349
|
- Bump dependency on `@metamask/preferences-controller` to ^4.4.1 ([#1676](https://github.com/MetaMask/core/pull/1676))
|
|
308
350
|
|
|
309
351
|
## [12.0.0]
|
|
352
|
+
|
|
310
353
|
### Added
|
|
354
|
+
|
|
311
355
|
- Add `AssetsContractController` methods `getProvider`, `getChainId`, `getERC721Standard`, and `getERC1155Standard` ([#1638](https://github.com/MetaMask/core/pull/1638))
|
|
312
356
|
|
|
313
357
|
### Changed
|
|
358
|
+
|
|
314
359
|
- **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
|
-
|
|
360
|
+
- Add optional `networkClientId` parameter to various `AssetContractController` methods ([#1638](https://github.com/MetaMask/core/pull/1638))
|
|
361
|
+
- The affected methods are:
|
|
362
|
+
- `getERC20BalanceOf`
|
|
363
|
+
- `getERC20TokenDecimals`
|
|
364
|
+
- `getERC20TokenName`
|
|
365
|
+
- `getERC721NftTokenId`
|
|
366
|
+
- `getTokenStandardAndDetails`
|
|
367
|
+
- `getERC721TokenURI`
|
|
368
|
+
- `getERC721AssetName`
|
|
369
|
+
- `getERC721AssetSymbol`
|
|
370
|
+
- `getERC721OwnerOf`
|
|
371
|
+
- `getERC1155TokenURI`
|
|
372
|
+
- `getERC1155BalanceOf`
|
|
373
|
+
- `transferSingleERC1155`
|
|
374
|
+
- `getBalancesInSingleCall`
|
|
330
375
|
|
|
331
376
|
## [11.1.0]
|
|
377
|
+
|
|
332
378
|
### Added
|
|
379
|
+
|
|
333
380
|
- Add `tokenURI` to `NftMetadata` type ([#1577](https://github.com/MetaMask/core/pull/1577))
|
|
334
381
|
- Populate token URL for NFT metadata under `tokenURI` ([#1577](https://github.com/MetaMask/core/pull/1577))
|
|
335
382
|
|
|
336
383
|
### Changed
|
|
384
|
+
|
|
337
385
|
- Bump dependency and peer dependency on `@metamask/approval-controller` to ^3.5.1
|
|
338
386
|
- Bump dependency on `@metamask/base-controller` to ^3.2.1
|
|
339
387
|
- Bump dependency on `@metamask/controller-utils` to ^4.3.2
|
|
@@ -342,14 +390,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
342
390
|
- Update NftController to add fallback for when IPFS gateway is disabled ([#1577](https://github.com/MetaMask/core/pull/1577))
|
|
343
391
|
|
|
344
392
|
## [11.0.1]
|
|
393
|
+
|
|
345
394
|
### Changed
|
|
395
|
+
|
|
346
396
|
- Replace `eth-query` ^2.1.2 with `@metamask/eth-query` ^3.0.1 ([#1546](https://github.com/MetaMask/core/pull/1546))
|
|
347
397
|
|
|
348
398
|
## [11.0.0]
|
|
399
|
+
|
|
349
400
|
### Added
|
|
401
|
+
|
|
350
402
|
- Add a `stop` method to stop polling
|
|
351
403
|
|
|
352
404
|
### Changed
|
|
405
|
+
|
|
353
406
|
- **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
407
|
- The new required parameters are `ticker`, `onSelectedAddress`, and `onPreferencesStateChange`
|
|
355
408
|
- **BREAKING**: Remove `onCurrencyRateStateChange` constructor parameter from `TokenRatesController` ([#1496](https://github.com/MetaMask/core/pull/1496))
|
|
@@ -364,16 +417,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
364
417
|
- Remove unnecessary `babel-runtime` dependency ([#1504](https://github.com/MetaMask/core/pull/1504))
|
|
365
418
|
|
|
366
419
|
### Fixed
|
|
420
|
+
|
|
367
421
|
- 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
422
|
- 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
423
|
- Prevent redundant token rate updates ([#1512](https://github.com/MetaMask/core/pull/1512))
|
|
370
424
|
|
|
371
425
|
## [10.0.0]
|
|
426
|
+
|
|
372
427
|
### Added
|
|
428
|
+
|
|
373
429
|
- The method `getERC20TokenName` has been added to `AssetsContractController` ([#1127](https://github.com/MetaMask/core/pull/1127))
|
|
374
430
|
- This method gets the token name from the token contract
|
|
375
431
|
|
|
376
432
|
### Changed
|
|
433
|
+
|
|
377
434
|
- **BREAKING:** The tokens controller now requires `onTokenListStateChange` and `getERC20TokenName` as constructor parameters ([#1127](https://github.com/MetaMask/core/pull/1127))
|
|
378
435
|
- The `getERC20TokenName` method is used to get the token name for tokens added via `wallet_watchAsset`
|
|
379
436
|
- 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 +441,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
384
441
|
- The `Token` type now includes an optional `name` field ([#1127](https://github.com/MetaMask/core/pull/1127))
|
|
385
442
|
|
|
386
443
|
## [9.2.0]
|
|
444
|
+
|
|
387
445
|
### Added
|
|
446
|
+
|
|
388
447
|
- 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
448
|
|
|
390
449
|
## [9.1.0]
|
|
450
|
+
|
|
391
451
|
### Added
|
|
452
|
+
|
|
392
453
|
- Add a fifth argument, `source`, to NftController's `addNft` method ([#1417](https://github.com/MetaMask/core/pull/1417))
|
|
393
454
|
- This argument can be used to specify whether the NFT was detected, added manually, or suggested by a dapp
|
|
394
455
|
|
|
395
456
|
### Fixed
|
|
457
|
+
|
|
396
458
|
- 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
459
|
|
|
398
460
|
## [9.0.0]
|
|
461
|
+
|
|
399
462
|
### Added
|
|
463
|
+
|
|
400
464
|
- **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
465
|
- Previously, the controller would refresh all account balances, but these options can be used to only refresh the currently selected account
|
|
402
466
|
- **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 +468,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
404
468
|
- 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
469
|
|
|
406
470
|
### Changed
|
|
471
|
+
|
|
407
472
|
- Add dependency on `@ethersproject/address` ([#1173](https://github.com/MetaMask/core/pull/1173))
|
|
408
473
|
- Replace `eth-rpc-errors` with `@metamask/rpc-errors` ([#1173](https://github.com/MetaMask/core/pull/1173))
|
|
409
474
|
|
|
410
475
|
## [8.0.0]
|
|
476
|
+
|
|
411
477
|
### Added
|
|
478
|
+
|
|
412
479
|
- Support NFT detection on Ethereum Mainnet custom RPC endpoints ([#1360](https://github.com/MetaMask/core/pull/1360))
|
|
413
480
|
- Enable token detection for the Aurora network ([#1327](https://github.com/MetaMask/core/pull/1327))
|
|
414
481
|
|
|
415
482
|
### Changed
|
|
483
|
+
|
|
416
484
|
- **BREAKING:** Bump to Node 16 ([#1262](https://github.com/MetaMask/core/pull/1262))
|
|
417
485
|
- **BREAKING:** Change format of chain ID in state to 0x-prefixed hex string ([#1367](https://github.com/MetaMask/core/pull/1367))
|
|
418
486
|
- The functions `isTokenDetectionSupportedForNetwork` and `formatIconUrlWithProxy` now expect a chain ID as type `Hex` rather than as a decimal `string`
|
|
@@ -438,11 +506,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
438
506
|
- The return type for `watchAsset` has changed. It now returns a Promise that settles after the request has been confirmed or rejected.
|
|
439
507
|
- **BREAKING:** Initialize controllers with the current network ([#1361](https://github.com/MetaMask/core/pull/1361))
|
|
440
508
|
- The following controllers now have a new `chainId` required constructor parameter:
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
509
|
+
- `AssetsContractController`
|
|
510
|
+
- `NftController`
|
|
511
|
+
- `NftDetectionController`
|
|
512
|
+
- `TokenRatesController`
|
|
513
|
+
- `TokensController`
|
|
446
514
|
- **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
515
|
- **BREAKING:** The token list controller `onNetworkStateChange` option now has a more restrictive type ([#1329](https://github.com/MetaMask/core/pull/1329))
|
|
448
516
|
- The event handler parameter type has been changed from `NetworkState | ProviderConfig` to `NetworkState`
|
|
@@ -454,42 +522,58 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
454
522
|
- Bump @metamask/utils from 5.0.1 to 5.0.2 ([#1271](https://github.com/MetaMask/core/pull/1271))
|
|
455
523
|
|
|
456
524
|
### Removed
|
|
525
|
+
|
|
457
526
|
- **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
527
|
- **BREAKING:** Remove the `SuggestedAssetMeta` and `SuggestedAssetMetaBase` types from the token controller ([#1268](https://github.com/MetaMask/core/pull/1268))
|
|
459
528
|
- **BREAKING:** Remove the `acceptWatchAsset` and `rejectWatchAsset` methods from the token controller ([#1268](https://github.com/MetaMask/core/pull/1268))
|
|
460
529
|
- Suggested assets can be accepted or rejected using the approval controller instead
|
|
461
530
|
|
|
462
531
|
## [7.0.0]
|
|
532
|
+
|
|
463
533
|
### Changed
|
|
534
|
+
|
|
464
535
|
- **BREAKING**: peerDeps: @metamask/network-controller@6.0.0->8.0.0 ([#1196](https://github.com/MetaMask/core/pull/1196))
|
|
465
536
|
|
|
466
537
|
## [6.0.0]
|
|
538
|
+
|
|
467
539
|
### Changed
|
|
540
|
+
|
|
468
541
|
- **BREAKING:** Create approval requests using `@metamask/approval-controller` ([#1166](https://github.com/MetaMask/core/pull/1166))
|
|
469
542
|
|
|
470
543
|
## [5.1.0]
|
|
544
|
+
|
|
471
545
|
### Added
|
|
546
|
+
|
|
472
547
|
- Support watching assets on a specific account ([#1124](https://github.com/MetaMask/core/pull/1124))
|
|
473
548
|
|
|
474
549
|
## [5.0.1]
|
|
550
|
+
|
|
475
551
|
### Changed
|
|
552
|
+
|
|
476
553
|
- Update `@metamask/contract-metadata` from 2.1.0 to 2.3.1 ([#1141](https://github.com/MetaMask/core/pull/1141))
|
|
477
554
|
|
|
478
555
|
## [5.0.0]
|
|
556
|
+
|
|
479
557
|
### Removed
|
|
558
|
+
|
|
480
559
|
- **BREAKING:** Remove `isomorphic-fetch` ([#1106](https://github.com/MetaMask/controllers/pull/1106))
|
|
481
560
|
- Consumers must now import `isomorphic-fetch` or another polyfill themselves if they are running in an environment without `fetch`
|
|
482
561
|
|
|
483
562
|
## [4.0.1]
|
|
563
|
+
|
|
484
564
|
### Fixed
|
|
565
|
+
|
|
485
566
|
- 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
567
|
|
|
487
568
|
## [4.0.0]
|
|
569
|
+
|
|
488
570
|
### Added
|
|
571
|
+
|
|
489
572
|
- Add Sepolia support to the currency rate controller ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
490
573
|
- 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
574
|
|
|
492
575
|
### Changed
|
|
576
|
+
|
|
493
577
|
- **BREAKING:** Update `@metamask/network-controller` peer dependency to v3 ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
494
578
|
- **BREAKING:** Migrate from `metaswap` to `metafi` subdomain for OpenSea proxy and token icons API ([#1060](https://github.com/MetaMask/core/pull/1060))
|
|
495
579
|
- Rename this repository to `core` ([#1031](https://github.com/MetaMask/controllers/pull/1031))
|
|
@@ -497,29 +581,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
497
581
|
- Update `@metamask/controller-utils` package ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
498
582
|
|
|
499
583
|
## Removed
|
|
584
|
+
|
|
500
585
|
- **BREAKING**: Drop support for Ropsten, Rinkeby, and Kovan ([#1041](https://github.com/MetaMask/controllers/pull/1041))
|
|
501
586
|
- 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
587
|
- The NFT controller no longer supports the Rinkeby OpenSea test API.
|
|
503
588
|
|
|
504
589
|
## [3.0.1]
|
|
590
|
+
|
|
505
591
|
### Changed
|
|
592
|
+
|
|
506
593
|
- Export `isTokenDetectionSupportedForNetwork` function ([#1034](https://github.com/MetaMask/controllers/pull/1034))
|
|
507
594
|
- Update `@metamask/contract-metadata` from 1.35.0 to 2.1.0 ([#1013](https://github.com/MetaMask/controllers/pull/1013))
|
|
508
595
|
|
|
509
596
|
### Fixed
|
|
597
|
+
|
|
510
598
|
- Fix token controller state updates ([#1015](https://github.com/MetaMask/controllers/pull/1015))
|
|
511
599
|
- 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
600
|
|
|
513
601
|
## [3.0.0]
|
|
602
|
+
|
|
514
603
|
### Changed
|
|
604
|
+
|
|
515
605
|
- **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
606
|
|
|
517
607
|
### Fixed
|
|
608
|
+
|
|
518
609
|
- 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
610
|
- This package will now warn if a required package is not present ([#1003](https://github.com/MetaMask/core/pull/1003))
|
|
520
611
|
|
|
521
612
|
## [2.0.0]
|
|
613
|
+
|
|
522
614
|
### Changed
|
|
615
|
+
|
|
523
616
|
- **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
617
|
- This affects:
|
|
525
618
|
- AssetsContractController
|
|
@@ -533,19 +626,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
533
626
|
- 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
627
|
|
|
535
628
|
## [1.0.1]
|
|
629
|
+
|
|
536
630
|
### Fixed
|
|
631
|
+
|
|
537
632
|
- Fix race condition where some token detections can get mistakenly added to the wrong account ([#956](https://github.com/MetaMask/core/pull/956))
|
|
538
633
|
|
|
539
634
|
## [1.0.0]
|
|
635
|
+
|
|
540
636
|
### Added
|
|
637
|
+
|
|
541
638
|
- Initial release
|
|
639
|
+
|
|
542
640
|
- 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:
|
|
641
|
+
|
|
543
642
|
- Everything in `src/assets`
|
|
544
643
|
- Asset-related functions from `src/util.ts` and accompanying tests
|
|
545
644
|
|
|
546
645
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
547
646
|
|
|
548
647
|
### Changed
|
|
648
|
+
|
|
549
649
|
- Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))
|
|
550
650
|
|
|
551
651
|
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@25.0.0...HEAD
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/assets-controllers",
|
|
3
|
-
"version": "25.0.0-preview.
|
|
3
|
+
"version": "25.0.0-preview.cbe2fbb7",
|
|
4
4
|
"description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"MetaMask",
|