@metamask-previews/assets-controllers 41.0.0-preview-db2c53b → 42.0.0-preview-ec72890e

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 CHANGED
@@ -7,10 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [42.0.0]
11
+
10
12
  ### Added
11
13
 
12
14
  - Add `resetState` method to `NftController`, `TokensController`, `TokenBalancesController` and `TokenRatesController` to reset the controller's state back to their default state ([#4880](https://github.com/MetaMask/core/pull/4880))
13
15
 
16
+ ### Changed
17
+
18
+ - **BREAKING**: A `platform` argument must now be passed to the `TokenDetectionController` constructor, indicating whether the platform is extension or mobile. ([#4877](https://github.com/MetaMask/core/pull/4877))
19
+ - **BREAKING**: The `TokenRatesController` now accepts `{chainId: Hex}` as its polling input to `startPolling()` instead of `{networkClientId: NetworkClientId}` ([#4887](https://github.com/MetaMask/core/pull/4887))
20
+ - When the `TokenRatesController`'s subscription to `TokensController:stateChange` is fired, token prices are now updated across all chain IDs whose tokens changed, instead of just the current chain. ([#4866](https://github.com/MetaMask/core/pull/4866))
21
+ - The `TokenDetectionController` now passes a `x-metamask-clientproduct` header when calling the account API. ([#4877](https://github.com/MetaMask/core/pull/4877))
22
+
14
23
  ## [41.0.0]
15
24
 
16
25
  ### Changed
@@ -1180,7 +1189,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1180
1189
 
1181
1190
  - Use Ethers for AssetsContractController ([#845](https://github.com/MetaMask/core/pull/845))
1182
1191
 
1183
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@41.0.0...HEAD
1192
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@42.0.0...HEAD
1193
+ [42.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@41.0.0...@metamask/assets-controllers@42.0.0
1184
1194
  [41.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@40.0.0...@metamask/assets-controllers@41.0.0
1185
1195
  [40.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@39.0.0...@metamask/assets-controllers@40.0.0
1186
1196
  [39.0.0]: https://github.com/MetaMask/core/compare/@metamask/assets-controllers@38.3.0...@metamask/assets-controllers@39.0.0
@@ -62,14 +62,14 @@ type AccountTrackerPollingInput = {
62
62
  networkClientId: NetworkClientId;
63
63
  };
64
64
  declare const AccountTrackerController_base: (abstract new (...args: any[]) => {
65
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
66
- "__#787890@#intervalLength": number | undefined;
65
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
66
+ "__#787924@#intervalLength": number | undefined;
67
67
  setIntervalLength(intervalLength: number): void;
68
68
  getIntervalLength(): number | undefined;
69
69
  _startPolling(input: AccountTrackerPollingInput): void;
70
70
  _stopPollingByPollingTokenSetId(key: string): void;
71
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
72
- "__#787882@#callbacks": Map<string, Set<(input: AccountTrackerPollingInput) => void>>;
71
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
72
+ "__#787916@#callbacks": Map<string, Set<(input: AccountTrackerPollingInput) => void>>;
73
73
  _executePoll(input: AccountTrackerPollingInput): Promise<void>;
74
74
  /**
75
75
  * The action that can be performed to get the state of the {@link AccountTrackerController}.
@@ -62,14 +62,14 @@ type AccountTrackerPollingInput = {
62
62
  networkClientId: NetworkClientId;
63
63
  };
64
64
  declare const AccountTrackerController_base: (abstract new (...args: any[]) => {
65
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
66
- "__#787890@#intervalLength": number | undefined;
65
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
66
+ "__#787924@#intervalLength": number | undefined;
67
67
  setIntervalLength(intervalLength: number): void;
68
68
  getIntervalLength(): number | undefined;
69
69
  _startPolling(input: AccountTrackerPollingInput): void;
70
70
  _stopPollingByPollingTokenSetId(key: string): void;
71
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
72
- "__#787882@#callbacks": Map<string, Set<(input: AccountTrackerPollingInput) => void>>;
71
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
72
+ "__#787916@#callbacks": Map<string, Set<(input: AccountTrackerPollingInput) => void>>;
73
73
  _executePoll(input: AccountTrackerPollingInput): Promise<void>;
74
74
  /**
75
75
  * The action that can be performed to get the state of the {@link AccountTrackerController}.
@@ -29,14 +29,14 @@ type CurrencyRatePollingInput = {
29
29
  nativeCurrencies: string[];
30
30
  };
31
31
  declare const CurrencyRateController_base: (abstract new (...args: any[]) => {
32
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
33
- "__#787890@#intervalLength": number | undefined;
32
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
33
+ "__#787924@#intervalLength": number | undefined;
34
34
  setIntervalLength(intervalLength: number): void;
35
35
  getIntervalLength(): number | undefined;
36
36
  _startPolling(input: CurrencyRatePollingInput): void;
37
37
  _stopPollingByPollingTokenSetId(key: string): void;
38
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
39
- "__#787882@#callbacks": Map<string, Set<(input: CurrencyRatePollingInput) => void>>;
38
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
39
+ "__#787916@#callbacks": Map<string, Set<(input: CurrencyRatePollingInput) => void>>;
40
40
  _executePoll(input: CurrencyRatePollingInput): Promise<void>;
41
41
  startPolling(input: CurrencyRatePollingInput): string;
42
42
  stopAllPolling(): void;
@@ -29,14 +29,14 @@ type CurrencyRatePollingInput = {
29
29
  nativeCurrencies: string[];
30
30
  };
31
31
  declare const CurrencyRateController_base: (abstract new (...args: any[]) => {
32
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
33
- "__#787890@#intervalLength": number | undefined;
32
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
33
+ "__#787924@#intervalLength": number | undefined;
34
34
  setIntervalLength(intervalLength: number): void;
35
35
  getIntervalLength(): number | undefined;
36
36
  _startPolling(input: CurrencyRatePollingInput): void;
37
37
  _stopPollingByPollingTokenSetId(key: string): void;
38
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
39
- "__#787882@#callbacks": Map<string, Set<(input: CurrencyRatePollingInput) => void>>;
38
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
39
+ "__#787916@#callbacks": Map<string, Set<(input: CurrencyRatePollingInput) => void>>;
40
40
  _executePoll(input: CurrencyRatePollingInput): Promise<void>;
41
41
  startPolling(input: CurrencyRatePollingInput): string;
42
42
  stopAllPolling(): void;
@@ -25,14 +25,14 @@ type TokenDetectionPollingInput = {
25
25
  address: string;
26
26
  };
27
27
  declare const TokenDetectionController_base: (abstract new (...args: any[]) => {
28
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
29
- "__#787890@#intervalLength": number | undefined;
28
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
29
+ "__#787924@#intervalLength": number | undefined;
30
30
  setIntervalLength(intervalLength: number): void;
31
31
  getIntervalLength(): number | undefined;
32
32
  _startPolling(input: TokenDetectionPollingInput): void;
33
33
  _stopPollingByPollingTokenSetId(key: string): void;
34
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
35
- "__#787882@#callbacks": Map<string, Set<(input: TokenDetectionPollingInput) => void>>;
34
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
35
+ "__#787916@#callbacks": Map<string, Set<(input: TokenDetectionPollingInput) => void>>;
36
36
  _executePoll(input: TokenDetectionPollingInput): Promise<void>;
37
37
  startPolling(input: TokenDetectionPollingInput): string;
38
38
  stopAllPolling(): void;
@@ -25,14 +25,14 @@ type TokenDetectionPollingInput = {
25
25
  address: string;
26
26
  };
27
27
  declare const TokenDetectionController_base: (abstract new (...args: any[]) => {
28
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
29
- "__#787890@#intervalLength": number | undefined;
28
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
29
+ "__#787924@#intervalLength": number | undefined;
30
30
  setIntervalLength(intervalLength: number): void;
31
31
  getIntervalLength(): number | undefined;
32
32
  _startPolling(input: TokenDetectionPollingInput): void;
33
33
  _stopPollingByPollingTokenSetId(key: string): void;
34
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
35
- "__#787882@#callbacks": Map<string, Set<(input: TokenDetectionPollingInput) => void>>;
34
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
35
+ "__#787916@#callbacks": Map<string, Set<(input: TokenDetectionPollingInput) => void>>;
36
36
  _executePoll(input: TokenDetectionPollingInput): Promise<void>;
37
37
  startPolling(input: TokenDetectionPollingInput): string;
38
38
  stopAllPolling(): void;
@@ -37,14 +37,14 @@ type TokenListPollingInput = {
37
37
  networkClientId: NetworkClientId;
38
38
  };
39
39
  declare const TokenListController_base: (abstract new (...args: any[]) => {
40
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
41
- "__#787890@#intervalLength": number | undefined;
40
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
41
+ "__#787924@#intervalLength": number | undefined;
42
42
  setIntervalLength(intervalLength: number): void;
43
43
  getIntervalLength(): number | undefined;
44
44
  _startPolling(input: TokenListPollingInput): void;
45
45
  _stopPollingByPollingTokenSetId(key: string): void;
46
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
47
- "__#787882@#callbacks": Map<string, Set<(input: TokenListPollingInput) => void>>;
46
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
47
+ "__#787916@#callbacks": Map<string, Set<(input: TokenListPollingInput) => void>>;
48
48
  _executePoll(input: TokenListPollingInput): Promise<void>;
49
49
  startPolling(input: TokenListPollingInput): string;
50
50
  stopAllPolling(): void;
@@ -37,14 +37,14 @@ type TokenListPollingInput = {
37
37
  networkClientId: NetworkClientId;
38
38
  };
39
39
  declare const TokenListController_base: (abstract new (...args: any[]) => {
40
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
41
- "__#787890@#intervalLength": number | undefined;
40
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
41
+ "__#787924@#intervalLength": number | undefined;
42
42
  setIntervalLength(intervalLength: number): void;
43
43
  getIntervalLength(): number | undefined;
44
44
  _startPolling(input: TokenListPollingInput): void;
45
45
  _stopPollingByPollingTokenSetId(key: string): void;
46
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
47
- "__#787882@#callbacks": Map<string, Set<(input: TokenListPollingInput) => void>>;
46
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
47
+ "__#787916@#callbacks": Map<string, Set<(input: TokenListPollingInput) => void>>;
48
48
  _executePoll(input: TokenListPollingInput): Promise<void>;
49
49
  startPolling(input: TokenListPollingInput): string;
50
50
  stopAllPolling(): void;
@@ -108,14 +108,14 @@ export type TokenRatesPollingInput = {
108
108
  chainId: Hex;
109
109
  };
110
110
  declare const TokenRatesController_base: (abstract new (...args: any[]) => {
111
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
112
- "__#787890@#intervalLength": number | undefined;
111
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
112
+ "__#787924@#intervalLength": number | undefined;
113
113
  setIntervalLength(intervalLength: number): void;
114
114
  getIntervalLength(): number | undefined;
115
115
  _startPolling(input: TokenRatesPollingInput): void;
116
116
  _stopPollingByPollingTokenSetId(key: string): void;
117
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
118
- "__#787882@#callbacks": Map<string, Set<(input: TokenRatesPollingInput) => void>>;
117
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
118
+ "__#787916@#callbacks": Map<string, Set<(input: TokenRatesPollingInput) => void>>;
119
119
  _executePoll(input: TokenRatesPollingInput): Promise<void>;
120
120
  startPolling(input: TokenRatesPollingInput): string;
121
121
  stopAllPolling(): void;
@@ -108,14 +108,14 @@ export type TokenRatesPollingInput = {
108
108
  chainId: Hex;
109
109
  };
110
110
  declare const TokenRatesController_base: (abstract new (...args: any[]) => {
111
- readonly "__#787890@#intervalIds": Record<string, NodeJS.Timeout>;
112
- "__#787890@#intervalLength": number | undefined;
111
+ readonly "__#787924@#intervalIds": Record<string, NodeJS.Timeout>;
112
+ "__#787924@#intervalLength": number | undefined;
113
113
  setIntervalLength(intervalLength: number): void;
114
114
  getIntervalLength(): number | undefined;
115
115
  _startPolling(input: TokenRatesPollingInput): void;
116
116
  _stopPollingByPollingTokenSetId(key: string): void;
117
- readonly "__#787882@#pollingTokenSets": Map<string, Set<string>>;
118
- "__#787882@#callbacks": Map<string, Set<(input: TokenRatesPollingInput) => void>>;
117
+ readonly "__#787916@#pollingTokenSets": Map<string, Set<string>>;
118
+ "__#787916@#callbacks": Map<string, Set<(input: TokenRatesPollingInput) => void>>;
119
119
  _executePoll(input: TokenRatesPollingInput): Promise<void>;
120
120
  startPolling(input: TokenRatesPollingInput): string;
121
121
  stopAllPolling(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/assets-controllers",
3
- "version": "41.0.0-preview-db2c53b",
3
+ "version": "42.0.0-preview-ec72890e",
4
4
  "description": "Controllers which manage interactions involving ERC-20, ERC-721, and ERC-1155 tokens (including NFTs)",
5
5
  "keywords": [
6
6
  "MetaMask",