@metamask/polling-controller 5.0.0 → 5.0.1

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
@@ -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,67 +7,96 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
7
 
7
8
  ## [Unreleased]
8
9
 
10
+ ## [5.0.1]
11
+
12
+ ### Changed
13
+
14
+ - Bump `@metamask/controller-utils` to `^8.0.4` ([#4007](https://github.com/MetaMask/core/pull/4007))
15
+ - Bump `@metamask/network-controller` to `^17.2.1` ([#4007](https://github.com/MetaMask/core/pull/4007))
16
+
9
17
  ## [5.0.0]
18
+
10
19
  ### Changed
20
+
11
21
  - **BREAKING:** Bump `@metamask/network-controller` peer dependency to `^17.2.0` ([#3821](https://github.com/MetaMask/core/pull/3821))
12
22
  - Bump `@metamask/utils` to `^8.3.0` ([#3769](https://github.com/MetaMask/core/pull/3769))
13
23
  - Bump `@metamask/base-controller` to `^4.1.1` ([#3760](https://github.com/MetaMask/core/pull/3760), [#3821](https://github.com/MetaMask/core/pull/3821))
14
24
  - Bump `@metamask/controller-utils` to `^8.0.2` ([#3821](https://github.com/MetaMask/core/pull/3821))
15
25
 
16
26
  ## [4.0.0]
27
+
17
28
  ### Changed
29
+
18
30
  - **BREAKING:** Bump `@metamask/network-controller` dependency and peer dependency from `^17.0.0` to `^17.1.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
19
31
  - Bump `@metamask/base-controller` to `^4.0.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
20
32
  - Bump `@metamask/controller-utils` to `^8.0.1` ([#3695](https://github.com/MetaMask/core/pull/3695), [#3678](https://github.com/MetaMask/core/pull/3678))
21
33
 
22
34
  ## [3.0.0]
35
+
23
36
  ### Added
37
+
24
38
  - `BlockTrackerPollingController`, `BlockTrackerPollingControllerV1` and `BlockTrackerPollingControllerOnly` have been added and can be used by subclasses to poll with a blockTracker using the same API as the `StaticIntervalPollingController` versions - the only exception is the requirement to implement the abstract method `_getNetworkClientById` on subclasses.
25
39
 
26
40
  ### Changed
41
+
27
42
  - **BREAKING:** `PollingController`, `PollingControllerV1` and `PollingControllerOnly` are all removed and replaced by `StaticIntervalPollingController`, `StaticIntervalPollingControllerV1` and `StaticIntervalPollingControllerOnly` ([#3636](https://github.com/MetaMask/core/pull/3636))
28
43
 
29
44
  ## [2.0.0]
45
+
30
46
  ### Changed
47
+
31
48
  - **BREAKING:** Bump `@metamask/base-controller` to ^4.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
32
49
  - This is breaking because the type of the `messenger` has backward-incompatible changes. See the changelog for this package for more.
33
50
  - Bump `@metamask/controller-utils` to ^6.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
34
51
  - Bump `@metamask/network-controller` to ^17.0.0 ([#2063](https://github.com/MetaMask/core/pull/2063))
35
52
 
36
53
  ## [1.0.2]
54
+
37
55
  ### Changed
56
+
38
57
  - **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^16.0.0
39
58
  - Bump @metamask/utils from 8.1.0 to 8.2.0 ([#1957](https://github.com/MetaMask/core/pull/1957))
40
59
 
41
60
  ## [1.0.1]
61
+
42
62
  ### Fixed
63
+
43
64
  - Export `PollingControllerOnly` ([#1921](https://github.com/MetaMask/core/pull/1921))
44
65
 
45
66
  ## [1.0.0]
67
+
46
68
  ### Added
69
+
47
70
  - Add `PollingControllerOnly` to extend from an empty class. This will allow classes that previously are just classes that don't extend from BaseV1 or V2 to extend from this new `PollingControllerOnly`. ([#1873](https://github.com/MetaMask/core/pull/1873))
48
71
 
49
72
  ### Changed
73
+
50
74
  - **BREAKING:** `_executePoll()` is called immediately on start if no polling interval is already active for the networkClientId + options combination ([#1874](https://github.com/MetaMask/core/pull/1874))
51
75
  - Bump dependency and peer dependency on `@metamask/network-controller` to ^15.1.0
52
76
 
53
77
  ## [0.2.0]
78
+
54
79
  ### Added
80
+
55
81
  - 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))
56
82
  - Add optional second argument to `stopPollingByPollingToken` (formerly `stopPollingByNetworkClientId`)
57
83
  - Add optional second argument to `onPollingCompleteByNetworkClientId`
58
84
 
59
85
  ### Changed
86
+
60
87
  - **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to ^15.0.0
61
88
  - **BREAKING:** Polling controllers are expected to override `_executePoll` instead of `executePoll` ([#1810](https://github.com/MetaMask/core/pull/1810))
62
89
  - **BREAKING:** Rename `stopPollingByNetworkClientId` to `stopPollingByPollingToken` ([#1810](https://github.com/MetaMask/core/pull/1810))
63
90
  - Add dependency on `fast-json-stable-stringify` ^2.1.0
64
91
 
65
92
  ## [0.1.0]
93
+
66
94
  ### Added
95
+
67
96
  - Initial release
68
97
 
69
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@5.0.0...HEAD
98
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@5.0.1...HEAD
99
+ [5.0.1]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@5.0.0...@metamask/polling-controller@5.0.1
70
100
  [5.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@4.0.0...@metamask/polling-controller@5.0.0
71
101
  [4.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@3.0.0...@metamask/polling-controller@4.0.0
72
102
  [3.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@2.0.0...@metamask/polling-controller@3.0.0
@@ -19,8 +19,8 @@ declare type Constructor = new (...args: any[]) => object;
19
19
  * @returns The composed class.
20
20
  */
21
21
  export declare function AbstractPollingControllerBaseMixin<TBase extends Constructor>(Base: TBase): (abstract new (...args: any[]) => {
22
- readonly "__#97100@#pollingTokenSets": Map<PollingTokenSetId, Set<string>>;
23
- "__#97100@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
22
+ readonly "__#96731@#pollingTokenSets": Map<PollingTokenSetId, Set<string>>;
23
+ "__#96731@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
24
24
  _executePoll(networkClientId: NetworkClientId, options: Json): Promise<void>;
25
25
  _startPollingByNetworkClientId(networkClientId: NetworkClientId, options: Json): void;
26
26
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
@@ -5,12 +5,12 @@ import type { PollingTokenSetId } from './AbstractPollingController';
5
5
  declare class Empty {
6
6
  }
7
7
  export declare const BlockTrackerPollingControllerOnly: (abstract new (...args: any[]) => {
8
- "__#97101@#activeListeners": Record<string, (options: Json) => Promise<void>>;
8
+ "__#96732@#activeListeners": Record<string, (options: Json) => Promise<void>>;
9
9
  _getNetworkClientById(networkClientId: NetworkClientId): NetworkClient | undefined;
10
10
  _startPollingByNetworkClientId(networkClientId: NetworkClientId, options: Json): void;
11
11
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
12
- readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
13
- "__#97100@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
12
+ readonly "__#96731@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
13
+ "__#96731@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
14
14
  _executePoll(networkClientId: string, options: Json): Promise<void>;
15
15
  startPollingByNetworkClientId(networkClientId: string, options?: Json): string;
16
16
  stopAllPolling(): void;
@@ -18,12 +18,12 @@ export declare const BlockTrackerPollingControllerOnly: (abstract new (...args:
18
18
  onPollingCompleteByNetworkClientId(networkClientId: string, callback: (networkClientId: string) => void, options?: Json): void;
19
19
  }) & typeof Empty;
20
20
  export declare const BlockTrackerPollingController: (abstract new (...args: any[]) => {
21
- "__#97101@#activeListeners": Record<string, (options: Json) => Promise<void>>;
21
+ "__#96732@#activeListeners": Record<string, (options: Json) => Promise<void>>;
22
22
  _getNetworkClientById(networkClientId: NetworkClientId): NetworkClient | undefined;
23
23
  _startPollingByNetworkClientId(networkClientId: NetworkClientId, options: Json): void;
24
24
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
25
- readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
26
- "__#97100@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
25
+ readonly "__#96731@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
26
+ "__#96731@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
27
27
  _executePoll(networkClientId: string, options: Json): Promise<void>;
28
28
  startPollingByNetworkClientId(networkClientId: string, options?: Json): string;
29
29
  stopAllPolling(): void;
@@ -31,12 +31,12 @@ export declare const BlockTrackerPollingController: (abstract new (...args: any[
31
31
  onPollingCompleteByNetworkClientId(networkClientId: string, callback: (networkClientId: string) => void, options?: Json): void;
32
32
  }) & typeof BaseController;
33
33
  export declare const BlockTrackerPollingControllerV1: (abstract new (...args: any[]) => {
34
- "__#97101@#activeListeners": Record<string, (options: Json) => Promise<void>>;
34
+ "__#96732@#activeListeners": Record<string, (options: Json) => Promise<void>>;
35
35
  _getNetworkClientById(networkClientId: NetworkClientId): NetworkClient | undefined;
36
36
  _startPollingByNetworkClientId(networkClientId: NetworkClientId, options: Json): void;
37
37
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
38
- readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
39
- "__#97100@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
38
+ readonly "__#96731@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
39
+ "__#96731@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
40
40
  _executePoll(networkClientId: string, options: Json): Promise<void>;
41
41
  startPollingByNetworkClientId(networkClientId: string, options?: Json): string;
42
42
  stopAllPolling(): void;
@@ -10,14 +10,14 @@ import type { PollingTokenSetId } from './AbstractPollingController';
10
10
  declare class Empty {
11
11
  }
12
12
  export declare const StaticIntervalPollingControllerOnly: (abstract new (...args: any[]) => {
13
- readonly "__#97102@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
14
- "__#97102@#intervalLength": number | undefined;
13
+ readonly "__#96733@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
14
+ "__#96733@#intervalLength": number | undefined;
15
15
  setIntervalLength(intervalLength: number): void;
16
16
  getIntervalLength(): number | undefined;
17
17
  _startPollingByNetworkClientId(networkClientId: NetworkClientId, options: Json): void;
18
18
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
19
- readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
20
- "__#97100@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
19
+ readonly "__#96731@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
20
+ "__#96731@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
21
21
  _executePoll(networkClientId: string, options: Json): Promise<void>;
22
22
  startPollingByNetworkClientId(networkClientId: string, options?: Json): string;
23
23
  stopAllPolling(): void;
@@ -25,14 +25,14 @@ export declare const StaticIntervalPollingControllerOnly: (abstract new (...args
25
25
  onPollingCompleteByNetworkClientId(networkClientId: string, callback: (networkClientId: string) => void, options?: Json): void;
26
26
  }) & typeof Empty;
27
27
  export declare const StaticIntervalPollingController: (abstract new (...args: any[]) => {
28
- readonly "__#97102@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
29
- "__#97102@#intervalLength": number | undefined;
28
+ readonly "__#96733@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
29
+ "__#96733@#intervalLength": number | undefined;
30
30
  setIntervalLength(intervalLength: number): void;
31
31
  getIntervalLength(): number | undefined;
32
32
  _startPollingByNetworkClientId(networkClientId: NetworkClientId, options: Json): void;
33
33
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
34
- readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
35
- "__#97100@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
34
+ readonly "__#96731@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
35
+ "__#96731@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
36
36
  _executePoll(networkClientId: string, options: Json): Promise<void>;
37
37
  startPollingByNetworkClientId(networkClientId: string, options?: Json): string;
38
38
  stopAllPolling(): void;
@@ -40,14 +40,14 @@ export declare const StaticIntervalPollingController: (abstract new (...args: an
40
40
  onPollingCompleteByNetworkClientId(networkClientId: string, callback: (networkClientId: string) => void, options?: Json): void;
41
41
  }) & typeof BaseController;
42
42
  export declare const StaticIntervalPollingControllerV1: (abstract new (...args: any[]) => {
43
- readonly "__#97102@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
44
- "__#97102@#intervalLength": number | undefined;
43
+ readonly "__#96733@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
44
+ "__#96733@#intervalLength": number | undefined;
45
45
  setIntervalLength(intervalLength: number): void;
46
46
  getIntervalLength(): number | undefined;
47
47
  _startPollingByNetworkClientId(networkClientId: NetworkClientId, options: Json): void;
48
48
  _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;
49
- readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
50
- "__#97100@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
49
+ readonly "__#96731@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
50
+ "__#96731@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
51
51
  _executePoll(networkClientId: string, options: Json): Promise<void>;
52
52
  startPollingByNetworkClientId(networkClientId: string, options?: Json): string;
53
53
  stopAllPolling(): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/polling-controller",
3
- "version": "5.0.0",
3
+ "version": "5.0.1",
4
4
  "description": "Polling Controller is the base for controllers that polling by networkClientId",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@metamask/base-controller": "^4.1.1",
35
- "@metamask/controller-utils": "^8.0.2",
36
- "@metamask/network-controller": "^17.2.0",
35
+ "@metamask/controller-utils": "^8.0.4",
36
+ "@metamask/network-controller": "^17.2.1",
37
37
  "@metamask/utils": "^8.3.0",
38
38
  "@types/uuid": "^8.3.0",
39
39
  "fast-json-stable-stringify": "^2.1.0",