@metamask/polling-controller 3.0.0 → 5.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 CHANGED
@@ -6,6 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [5.0.0]
10
+ ### Changed
11
+ - **BREAKING:** Bump `@metamask/network-controller` peer dependency to `^17.2.0` ([#3821](https://github.com/MetaMask/core/pull/3821))
12
+ - Bump `@metamask/utils` to `^8.3.0` ([#3769](https://github.com/MetaMask/core/pull/3769))
13
+ - 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
+ - Bump `@metamask/controller-utils` to `^8.0.2` ([#3821](https://github.com/MetaMask/core/pull/3821))
15
+
16
+ ## [4.0.0]
17
+ ### Changed
18
+ - **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
+ - Bump `@metamask/base-controller` to `^4.0.1` ([#3695](https://github.com/MetaMask/core/pull/3695))
20
+ - 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
+
9
22
  ## [3.0.0]
10
23
  ### Added
11
24
  - `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.
@@ -53,7 +66,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
53
66
  ### Added
54
67
  - Initial release
55
68
 
56
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@3.0.0...HEAD
69
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@5.0.0...HEAD
70
+ [5.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@4.0.0...@metamask/polling-controller@5.0.0
71
+ [4.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@3.0.0...@metamask/polling-controller@4.0.0
57
72
  [3.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@2.0.0...@metamask/polling-controller@3.0.0
58
73
  [2.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@1.0.2...@metamask/polling-controller@2.0.0
59
74
  [1.0.2]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@1.0.1...@metamask/polling-controller@1.0.2
@@ -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 "__#93090@#pollingTokenSets": Map<PollingTokenSetId, Set<string>>;
23
- "__#93090@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
22
+ readonly "__#97100@#pollingTokenSets": Map<PollingTokenSetId, Set<string>>;
23
+ "__#97100@#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
- "__#93091@#activeListeners": Record<string, (options: Json) => Promise<void>>;
8
+ "__#97101@#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 "__#93090@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
13
- "__#93090@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
12
+ readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
13
+ "__#97100@#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
- "__#93091@#activeListeners": Record<string, (options: Json) => Promise<void>>;
21
+ "__#97101@#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 "__#93090@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
26
- "__#93090@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
25
+ readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
26
+ "__#97100@#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
- "__#93091@#activeListeners": Record<string, (options: Json) => Promise<void>>;
34
+ "__#97101@#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 "__#93090@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
39
- "__#93090@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
38
+ readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
39
+ "__#97100@#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 "__#93092@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
14
- "__#93092@#intervalLength": number | undefined;
13
+ readonly "__#97102@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
14
+ "__#97102@#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 "__#93090@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
20
- "__#93090@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
19
+ readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
20
+ "__#97100@#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 "__#93092@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
29
- "__#93092@#intervalLength": number | undefined;
28
+ readonly "__#97102@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
29
+ "__#97102@#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 "__#93090@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
35
- "__#93090@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
34
+ readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
35
+ "__#97100@#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 "__#93092@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
44
- "__#93092@#intervalLength": number | undefined;
43
+ readonly "__#97102@#intervalIds": Record<PollingTokenSetId, NodeJS.Timeout>;
44
+ "__#97102@#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 "__#93090@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
50
- "__#93090@#callbacks": Map<`${string}:${string}`, Set<(PollingTokenSetId: `${string}:${string}`) => void>>;
49
+ readonly "__#97100@#pollingTokenSets": Map<`${string}:${string}`, Set<string>>;
50
+ "__#97100@#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": "3.0.0",
3
+ "version": "5.0.0",
4
4
  "description": "Polling Controller is the base for controllers that polling by networkClientId",
5
5
  "keywords": [
6
6
  "MetaMask",
@@ -22,6 +22,7 @@
22
22
  ],
23
23
  "scripts": {
24
24
  "build:docs": "typedoc",
25
+ "changelog:update": "../../scripts/update-changelog.sh @metamask/polling-controller",
25
26
  "changelog:validate": "../../scripts/validate-changelog.sh @metamask/polling-controller",
26
27
  "publish:preview": "yarn npm publish --tag preview",
27
28
  "test": "jest --reporters=jest-silent-reporter",
@@ -30,16 +31,16 @@
30
31
  "test:watch": "jest --watch"
31
32
  },
32
33
  "dependencies": {
33
- "@metamask/base-controller": "^4.0.0",
34
- "@metamask/controller-utils": "^7.0.0",
35
- "@metamask/network-controller": "^17.0.0",
36
- "@metamask/utils": "^8.2.0",
34
+ "@metamask/base-controller": "^4.1.1",
35
+ "@metamask/controller-utils": "^8.0.2",
36
+ "@metamask/network-controller": "^17.2.0",
37
+ "@metamask/utils": "^8.3.0",
37
38
  "@types/uuid": "^8.3.0",
38
39
  "fast-json-stable-stringify": "^2.1.0",
39
40
  "uuid": "^8.3.2"
40
41
  },
41
42
  "devDependencies": {
42
- "@metamask/auto-changelog": "^3.4.3",
43
+ "@metamask/auto-changelog": "^3.4.4",
43
44
  "@types/jest": "^27.4.1",
44
45
  "deepmerge": "^4.2.2",
45
46
  "jest": "^27.5.1",
@@ -50,7 +51,7 @@
50
51
  "typescript": "~4.8.4"
51
52
  },
52
53
  "peerDependencies": {
53
- "@metamask/network-controller": "^17.0.0"
54
+ "@metamask/network-controller": "^17.2.0"
54
55
  },
55
56
  "engines": {
56
57
  "node": ">=16.0.0"