@metamask/polling-controller 5.0.1 → 6.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 +16 -1
- package/dist/AbstractPollingController.js +8 -86
- package/dist/AbstractPollingController.js.map +1 -1
- package/dist/AbstractPollingController.mjs +9 -0
- package/dist/AbstractPollingController.mjs.map +1 -0
- package/dist/BlockTrackerPollingController.js +11 -59
- package/dist/BlockTrackerPollingController.js.map +1 -1
- package/dist/BlockTrackerPollingController.mjs +12 -0
- package/dist/BlockTrackerPollingController.mjs.map +1 -0
- package/dist/StaticIntervalPollingController.js +11 -79
- package/dist/StaticIntervalPollingController.js.map +1 -1
- package/dist/StaticIntervalPollingController.mjs +12 -0
- package/dist/StaticIntervalPollingController.mjs.map +1 -0
- package/dist/chunk-4HJ6GRV5.js +94 -0
- package/dist/chunk-4HJ6GRV5.js.map +1 -0
- package/dist/chunk-GKOBRMW7.mjs +94 -0
- package/dist/chunk-GKOBRMW7.mjs.map +1 -0
- package/dist/chunk-JEAX4QNH.js +67 -0
- package/dist/chunk-JEAX4QNH.js.map +1 -0
- package/dist/chunk-K5LVF4PY.mjs +67 -0
- package/dist/chunk-K5LVF4PY.mjs.map +1 -0
- package/dist/chunk-LNXPCWKH.js +67 -0
- package/dist/chunk-LNXPCWKH.js.map +1 -0
- package/dist/chunk-WHT6NCVX.mjs +67 -0
- package/dist/chunk-WHT6NCVX.mjs.map +1 -0
- package/dist/index.js +19 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -0
- package/dist/index.mjs.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/{AbstractPollingController.d.ts → types/AbstractPollingController.d.ts} +2 -2
- package/dist/types/AbstractPollingController.d.ts.map +1 -0
- package/dist/{BlockTrackerPollingController.d.ts → types/BlockTrackerPollingController.d.ts} +9 -9
- package/dist/types/BlockTrackerPollingController.d.ts.map +1 -0
- package/dist/{StaticIntervalPollingController.d.ts → types/StaticIntervalPollingController.d.ts} +12 -12
- package/dist/types/StaticIntervalPollingController.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +15 -5
- package/dist/AbstractPollingController.d.ts.map +0 -1
- package/dist/BlockTrackerPollingController.d.ts.map +0 -1
- package/dist/StaticIntervalPollingController.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- /package/dist/{index.d.ts → types/index.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [6.0.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **BREAKING**: Add ESM build ([#3998](https://github.com/MetaMask/core/pull/3998))
|
|
15
|
+
- It's no longer possible to import files from `./dist` directly.
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **BREAKING:** Bump `@metamask/base-controller` to `^5.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039))
|
|
20
|
+
- This version has a number of breaking changes. See the changelog for more.
|
|
21
|
+
- **BREAKING:** Bump dependency and peer dependency on `@metamask/network-controller` to `^18.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039))
|
|
22
|
+
- Bump `@metamask/controller-utils` to `^9.0.0` ([#4039](https://github.com/MetaMask/core/pull/4039))
|
|
23
|
+
|
|
10
24
|
## [5.0.1]
|
|
11
25
|
|
|
12
26
|
### Changed
|
|
@@ -95,7 +109,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
95
109
|
|
|
96
110
|
- Initial release
|
|
97
111
|
|
|
98
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@
|
|
112
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@6.0.0...HEAD
|
|
113
|
+
[6.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@5.0.1...@metamask/polling-controller@6.0.0
|
|
99
114
|
[5.0.1]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@5.0.0...@metamask/polling-controller@5.0.1
|
|
100
115
|
[5.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@4.0.0...@metamask/polling-controller@5.0.0
|
|
101
116
|
[4.0.0]: https://github.com/MetaMask/core/compare/@metamask/polling-controller@3.0.0...@metamask/polling-controller@4.0.0
|
|
@@ -1,87 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
-
exports.AbstractPollingControllerBaseMixin = exports.getKey = void 0;
|
|
12
|
-
const fast_json_stable_stringify_1 = __importDefault(require("fast-json-stable-stringify"));
|
|
13
|
-
const uuid_1 = require("uuid");
|
|
14
|
-
const getKey = (networkClientId, options) => `${networkClientId}:${(0, fast_json_stable_stringify_1.default)(options)}`;
|
|
15
|
-
exports.getKey = getKey;
|
|
16
|
-
/**
|
|
17
|
-
* AbstractPollingControllerBaseMixin
|
|
18
|
-
*
|
|
19
|
-
* @param Base - The base class to mix onto.
|
|
20
|
-
* @returns The composed class.
|
|
21
|
-
*/
|
|
22
|
-
function AbstractPollingControllerBaseMixin(Base) {
|
|
23
|
-
var _AbstractPollingControllerBase_pollingTokenSets, _AbstractPollingControllerBase_callbacks;
|
|
24
|
-
class AbstractPollingControllerBase extends Base {
|
|
25
|
-
constructor() {
|
|
26
|
-
super(...arguments);
|
|
27
|
-
_AbstractPollingControllerBase_pollingTokenSets.set(this, new Map());
|
|
28
|
-
_AbstractPollingControllerBase_callbacks.set(this, new Map());
|
|
29
|
-
}
|
|
30
|
-
startPollingByNetworkClientId(networkClientId, options = {}) {
|
|
31
|
-
var _a;
|
|
32
|
-
const pollToken = (0, uuid_1.v4)();
|
|
33
|
-
const key = (0, exports.getKey)(networkClientId, options);
|
|
34
|
-
const pollingTokenSet = (_a = __classPrivateFieldGet(this, _AbstractPollingControllerBase_pollingTokenSets, "f").get(key)) !== null && _a !== void 0 ? _a : new Set();
|
|
35
|
-
pollingTokenSet.add(pollToken);
|
|
36
|
-
__classPrivateFieldGet(this, _AbstractPollingControllerBase_pollingTokenSets, "f").set(key, pollingTokenSet);
|
|
37
|
-
if (pollingTokenSet.size === 1) {
|
|
38
|
-
this._startPollingByNetworkClientId(networkClientId, options);
|
|
39
|
-
}
|
|
40
|
-
return pollToken;
|
|
41
|
-
}
|
|
42
|
-
stopAllPolling() {
|
|
43
|
-
__classPrivateFieldGet(this, _AbstractPollingControllerBase_pollingTokenSets, "f").forEach((tokenSet, _key) => {
|
|
44
|
-
tokenSet.forEach((token) => {
|
|
45
|
-
this.stopPollingByPollingToken(token);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
stopPollingByPollingToken(pollingToken) {
|
|
50
|
-
if (!pollingToken) {
|
|
51
|
-
throw new Error('pollingToken required');
|
|
52
|
-
}
|
|
53
|
-
let keyToDelete = null;
|
|
54
|
-
for (const [key, tokenSet] of __classPrivateFieldGet(this, _AbstractPollingControllerBase_pollingTokenSets, "f")) {
|
|
55
|
-
if (tokenSet.delete(pollingToken)) {
|
|
56
|
-
if (tokenSet.size === 0) {
|
|
57
|
-
keyToDelete = key;
|
|
58
|
-
}
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
if (keyToDelete) {
|
|
63
|
-
this._stopPollingByPollingTokenSetId(keyToDelete);
|
|
64
|
-
__classPrivateFieldGet(this, _AbstractPollingControllerBase_pollingTokenSets, "f").delete(keyToDelete);
|
|
65
|
-
const callbacks = __classPrivateFieldGet(this, _AbstractPollingControllerBase_callbacks, "f").get(keyToDelete);
|
|
66
|
-
if (callbacks) {
|
|
67
|
-
for (const callback of callbacks) {
|
|
68
|
-
// eslint-disable-next-line n/callback-return
|
|
69
|
-
callback(keyToDelete);
|
|
70
|
-
}
|
|
71
|
-
callbacks.clear();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
onPollingCompleteByNetworkClientId(networkClientId, callback, options = {}) {
|
|
76
|
-
var _a;
|
|
77
|
-
const key = (0, exports.getKey)(networkClientId, options);
|
|
78
|
-
const callbacks = (_a = __classPrivateFieldGet(this, _AbstractPollingControllerBase_callbacks, "f").get(key)) !== null && _a !== void 0 ? _a : new Set();
|
|
79
|
-
callbacks.add(callback);
|
|
80
|
-
__classPrivateFieldGet(this, _AbstractPollingControllerBase_callbacks, "f").set(key, callbacks);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
_AbstractPollingControllerBase_pollingTokenSets = new WeakMap(), _AbstractPollingControllerBase_callbacks = new WeakMap();
|
|
84
|
-
return AbstractPollingControllerBase;
|
|
85
|
-
}
|
|
86
|
-
exports.AbstractPollingControllerBaseMixin = AbstractPollingControllerBaseMixin;
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk4HJ6GRV5js = require('./chunk-4HJ6GRV5.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.AbstractPollingControllerBaseMixin = _chunk4HJ6GRV5js.AbstractPollingControllerBaseMixin; exports.getKey = _chunk4HJ6GRV5js.getKey;
|
|
87
9
|
//# sourceMappingURL=AbstractPollingController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,60 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* BlockTrackerPollingControllerMixin
|
|
13
|
-
* A polling controller that polls using a block tracker.
|
|
14
|
-
*
|
|
15
|
-
* @param Base - The base class to mix onto.
|
|
16
|
-
* @returns The composed class.
|
|
17
|
-
*/
|
|
18
|
-
function BlockTrackerPollingControllerMixin(Base) {
|
|
19
|
-
var _BlockTrackerPollingController_activeListeners;
|
|
20
|
-
class BlockTrackerPollingController extends (0, AbstractPollingController_1.AbstractPollingControllerBaseMixin)(Base) {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
_BlockTrackerPollingController_activeListeners.set(this, {});
|
|
24
|
-
}
|
|
25
|
-
_startPollingByNetworkClientId(networkClientId, options) {
|
|
26
|
-
const key = (0, AbstractPollingController_1.getKey)(networkClientId, options);
|
|
27
|
-
if (__classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key]) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const networkClient = this._getNetworkClientById(networkClientId);
|
|
31
|
-
if (networkClient) {
|
|
32
|
-
const updateOnNewBlock = this._executePoll.bind(this, networkClientId, options);
|
|
33
|
-
networkClient.blockTracker.addListener('latest', updateOnNewBlock);
|
|
34
|
-
__classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key] = updateOnNewBlock;
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
throw new Error(`Unable to retrieve blockTracker for networkClientId ${networkClientId}`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
_stopPollingByPollingTokenSetId(key) {
|
|
41
|
-
const [networkClientId] = key.split(':');
|
|
42
|
-
const networkClient = this._getNetworkClientById(networkClientId);
|
|
43
|
-
if (networkClient && __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key]) {
|
|
44
|
-
const listener = __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key];
|
|
45
|
-
if (listener) {
|
|
46
|
-
networkClient.blockTracker.removeListener('latest', listener);
|
|
47
|
-
delete __classPrivateFieldGet(this, _BlockTrackerPollingController_activeListeners, "f")[key];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
_BlockTrackerPollingController_activeListeners = new WeakMap();
|
|
53
|
-
return BlockTrackerPollingController;
|
|
54
|
-
}
|
|
55
|
-
class Empty {
|
|
56
|
-
}
|
|
57
|
-
exports.BlockTrackerPollingControllerOnly = BlockTrackerPollingControllerMixin(Empty);
|
|
58
|
-
exports.BlockTrackerPollingController = BlockTrackerPollingControllerMixin(base_controller_1.BaseController);
|
|
59
|
-
exports.BlockTrackerPollingControllerV1 = BlockTrackerPollingControllerMixin(base_controller_1.BaseControllerV1);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkJEAX4QNHjs = require('./chunk-JEAX4QNH.js');
|
|
6
|
+
require('./chunk-4HJ6GRV5.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.BlockTrackerPollingController = _chunkJEAX4QNHjs.BlockTrackerPollingController; exports.BlockTrackerPollingControllerOnly = _chunkJEAX4QNHjs.BlockTrackerPollingControllerOnly; exports.BlockTrackerPollingControllerV1 = _chunkJEAX4QNHjs.BlockTrackerPollingControllerV1;
|
|
60
12
|
//# sourceMappingURL=BlockTrackerPollingController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BlockTrackerPollingController,
|
|
3
|
+
BlockTrackerPollingControllerOnly,
|
|
4
|
+
BlockTrackerPollingControllerV1
|
|
5
|
+
} from "./chunk-WHT6NCVX.mjs";
|
|
6
|
+
import "./chunk-GKOBRMW7.mjs";
|
|
7
|
+
export {
|
|
8
|
+
BlockTrackerPollingController,
|
|
9
|
+
BlockTrackerPollingControllerOnly,
|
|
10
|
+
BlockTrackerPollingControllerV1
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=BlockTrackerPollingController.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,80 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
13
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
14
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
15
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
16
|
-
};
|
|
17
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
18
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
19
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
20
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
21
|
-
};
|
|
22
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.StaticIntervalPollingControllerV1 = exports.StaticIntervalPollingController = exports.StaticIntervalPollingControllerOnly = void 0;
|
|
24
|
-
const base_controller_1 = require("@metamask/base-controller");
|
|
25
|
-
const AbstractPollingController_1 = require("./AbstractPollingController");
|
|
26
|
-
/**
|
|
27
|
-
* StaticIntervalPollingControllerMixin
|
|
28
|
-
* A polling controller that polls on a static interval.
|
|
29
|
-
*
|
|
30
|
-
* @param Base - The base class to mix onto.
|
|
31
|
-
* @returns The composed class.
|
|
32
|
-
*/
|
|
33
|
-
function StaticIntervalPollingControllerMixin(Base) {
|
|
34
|
-
var _StaticIntervalPollingController_intervalIds, _StaticIntervalPollingController_intervalLength;
|
|
35
|
-
class StaticIntervalPollingController extends (0, AbstractPollingController_1.AbstractPollingControllerBaseMixin)(Base) {
|
|
36
|
-
constructor() {
|
|
37
|
-
super(...arguments);
|
|
38
|
-
_StaticIntervalPollingController_intervalIds.set(this, {});
|
|
39
|
-
_StaticIntervalPollingController_intervalLength.set(this, 1000);
|
|
40
|
-
}
|
|
41
|
-
setIntervalLength(intervalLength) {
|
|
42
|
-
__classPrivateFieldSet(this, _StaticIntervalPollingController_intervalLength, intervalLength, "f");
|
|
43
|
-
}
|
|
44
|
-
getIntervalLength() {
|
|
45
|
-
return __classPrivateFieldGet(this, _StaticIntervalPollingController_intervalLength, "f");
|
|
46
|
-
}
|
|
47
|
-
_startPollingByNetworkClientId(networkClientId, options) {
|
|
48
|
-
if (!__classPrivateFieldGet(this, _StaticIntervalPollingController_intervalLength, "f")) {
|
|
49
|
-
throw new Error('intervalLength must be defined and greater than 0');
|
|
50
|
-
}
|
|
51
|
-
const key = (0, AbstractPollingController_1.getKey)(networkClientId, options);
|
|
52
|
-
const existingInterval = __classPrivateFieldGet(this, _StaticIntervalPollingController_intervalIds, "f")[key];
|
|
53
|
-
this._stopPollingByPollingTokenSetId(key);
|
|
54
|
-
__classPrivateFieldGet(this, _StaticIntervalPollingController_intervalIds, "f")[key] = setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
try {
|
|
56
|
-
yield this._executePoll(networkClientId, options);
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
console.error(error);
|
|
60
|
-
}
|
|
61
|
-
this._startPollingByNetworkClientId(networkClientId, options);
|
|
62
|
-
}), existingInterval ? __classPrivateFieldGet(this, _StaticIntervalPollingController_intervalLength, "f") : 0);
|
|
63
|
-
}
|
|
64
|
-
_stopPollingByPollingTokenSetId(key) {
|
|
65
|
-
const intervalId = __classPrivateFieldGet(this, _StaticIntervalPollingController_intervalIds, "f")[key];
|
|
66
|
-
if (intervalId) {
|
|
67
|
-
clearTimeout(intervalId);
|
|
68
|
-
delete __classPrivateFieldGet(this, _StaticIntervalPollingController_intervalIds, "f")[key];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
_StaticIntervalPollingController_intervalIds = new WeakMap(), _StaticIntervalPollingController_intervalLength = new WeakMap();
|
|
73
|
-
return StaticIntervalPollingController;
|
|
74
|
-
}
|
|
75
|
-
class Empty {
|
|
76
|
-
}
|
|
77
|
-
exports.StaticIntervalPollingControllerOnly = StaticIntervalPollingControllerMixin(Empty);
|
|
78
|
-
exports.StaticIntervalPollingController = StaticIntervalPollingControllerMixin(base_controller_1.BaseController);
|
|
79
|
-
exports.StaticIntervalPollingControllerV1 = StaticIntervalPollingControllerMixin(base_controller_1.BaseControllerV1);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkLNXPCWKHjs = require('./chunk-LNXPCWKH.js');
|
|
6
|
+
require('./chunk-4HJ6GRV5.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.StaticIntervalPollingController = _chunkLNXPCWKHjs.StaticIntervalPollingController; exports.StaticIntervalPollingControllerOnly = _chunkLNXPCWKHjs.StaticIntervalPollingControllerOnly; exports.StaticIntervalPollingControllerV1 = _chunkLNXPCWKHjs.StaticIntervalPollingControllerV1;
|
|
80
12
|
//# sourceMappingURL=StaticIntervalPollingController.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StaticIntervalPollingController,
|
|
3
|
+
StaticIntervalPollingControllerOnly,
|
|
4
|
+
StaticIntervalPollingControllerV1
|
|
5
|
+
} from "./chunk-K5LVF4PY.mjs";
|
|
6
|
+
import "./chunk-GKOBRMW7.mjs";
|
|
7
|
+
export {
|
|
8
|
+
StaticIntervalPollingController,
|
|
9
|
+
StaticIntervalPollingControllerOnly,
|
|
10
|
+
StaticIntervalPollingControllerV1
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=StaticIntervalPollingController.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var __accessCheck = (obj, member, msg) => {
|
|
2
|
+
if (!member.has(obj))
|
|
3
|
+
throw TypeError("Cannot " + msg);
|
|
4
|
+
};
|
|
5
|
+
var __privateGet = (obj, member, getter) => {
|
|
6
|
+
__accessCheck(obj, member, "read from private field");
|
|
7
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
8
|
+
};
|
|
9
|
+
var __privateAdd = (obj, member, value) => {
|
|
10
|
+
if (member.has(obj))
|
|
11
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
12
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
13
|
+
};
|
|
14
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
15
|
+
__accessCheck(obj, member, "write to private field");
|
|
16
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/AbstractPollingController.ts
|
|
21
|
+
var _fastjsonstablestringify = require('fast-json-stable-stringify'); var _fastjsonstablestringify2 = _interopRequireDefault(_fastjsonstablestringify);
|
|
22
|
+
var _uuid = require('uuid');
|
|
23
|
+
var getKey = (networkClientId, options) => `${networkClientId}:${_fastjsonstablestringify2.default.call(void 0, options)}`;
|
|
24
|
+
function AbstractPollingControllerBaseMixin(Base) {
|
|
25
|
+
var _pollingTokenSets, _callbacks;
|
|
26
|
+
class AbstractPollingControllerBase extends Base {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
__privateAdd(this, _pollingTokenSets, /* @__PURE__ */ new Map());
|
|
30
|
+
__privateAdd(this, _callbacks, /* @__PURE__ */ new Map());
|
|
31
|
+
}
|
|
32
|
+
startPollingByNetworkClientId(networkClientId, options = {}) {
|
|
33
|
+
const pollToken = _uuid.v4.call(void 0, );
|
|
34
|
+
const key = getKey(networkClientId, options);
|
|
35
|
+
const pollingTokenSet = __privateGet(this, _pollingTokenSets).get(key) ?? /* @__PURE__ */ new Set();
|
|
36
|
+
pollingTokenSet.add(pollToken);
|
|
37
|
+
__privateGet(this, _pollingTokenSets).set(key, pollingTokenSet);
|
|
38
|
+
if (pollingTokenSet.size === 1) {
|
|
39
|
+
this._startPollingByNetworkClientId(networkClientId, options);
|
|
40
|
+
}
|
|
41
|
+
return pollToken;
|
|
42
|
+
}
|
|
43
|
+
stopAllPolling() {
|
|
44
|
+
__privateGet(this, _pollingTokenSets).forEach((tokenSet, _key) => {
|
|
45
|
+
tokenSet.forEach((token) => {
|
|
46
|
+
this.stopPollingByPollingToken(token);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
stopPollingByPollingToken(pollingToken) {
|
|
51
|
+
if (!pollingToken) {
|
|
52
|
+
throw new Error("pollingToken required");
|
|
53
|
+
}
|
|
54
|
+
let keyToDelete = null;
|
|
55
|
+
for (const [key, tokenSet] of __privateGet(this, _pollingTokenSets)) {
|
|
56
|
+
if (tokenSet.delete(pollingToken)) {
|
|
57
|
+
if (tokenSet.size === 0) {
|
|
58
|
+
keyToDelete = key;
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (keyToDelete) {
|
|
64
|
+
this._stopPollingByPollingTokenSetId(keyToDelete);
|
|
65
|
+
__privateGet(this, _pollingTokenSets).delete(keyToDelete);
|
|
66
|
+
const callbacks = __privateGet(this, _callbacks).get(keyToDelete);
|
|
67
|
+
if (callbacks) {
|
|
68
|
+
for (const callback of callbacks) {
|
|
69
|
+
callback(keyToDelete);
|
|
70
|
+
}
|
|
71
|
+
callbacks.clear();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
onPollingCompleteByNetworkClientId(networkClientId, callback, options = {}) {
|
|
76
|
+
const key = getKey(networkClientId, options);
|
|
77
|
+
const callbacks = __privateGet(this, _callbacks).get(key) ?? /* @__PURE__ */ new Set();
|
|
78
|
+
callbacks.add(callback);
|
|
79
|
+
__privateGet(this, _callbacks).set(key, callbacks);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_pollingTokenSets = new WeakMap();
|
|
83
|
+
_callbacks = new WeakMap();
|
|
84
|
+
return AbstractPollingControllerBase;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
exports.__privateGet = __privateGet; exports.__privateAdd = __privateAdd; exports.__privateSet = __privateSet; exports.getKey = getKey; exports.AbstractPollingControllerBaseMixin = AbstractPollingControllerBaseMixin;
|
|
94
|
+
//# sourceMappingURL=chunk-4HJ6GRV5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/AbstractPollingController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,OAAO,eAAe;AACtB,SAAS,MAAM,cAAc;AA0BtB,IAAM,SAAS,CACpB,iBACA,YACsB,GAAG,eAAe,IAAI,UAAU,OAAO,CAAC;AAczD,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CAAC,GACjB;AACA,YAAM,MAAM,OAAO,iBAAiB,OAAO;AAC3C,YAAM,YAAY,mBAAK,YAAW,IAAI,GAAG,KAAK,oBAAI,IAAqB;AACvE,gBAAU,IAAI,QAAQ;AACtB,yBAAK,YAAW,IAAI,KAAK,SAAS;AAAA,IACpC;AAAA,EACF;AApFW;AAET;AAmFF,SAAO;AACT","sourcesContent":["import type { NetworkClientId } from '@metamask/network-controller';\nimport type { Json } from '@metamask/utils';\nimport stringify from 'fast-json-stable-stringify';\nimport { v4 as random } from 'uuid';\n\nexport type IPollingController = {\n startPollingByNetworkClientId(\n networkClientId: NetworkClientId,\n options: Json,\n ): string;\n\n stopAllPolling(): void;\n\n stopPollingByPollingToken(pollingToken: string): void;\n\n onPollingCompleteByNetworkClientId(\n networkClientId: NetworkClientId,\n callback: (networkClientId: NetworkClientId) => void,\n options: Json,\n ): void;\n\n _executePoll(networkClientId: NetworkClientId, options: Json): Promise<void>;\n _startPollingByNetworkClientId(\n networkClientId: NetworkClientId,\n options: Json,\n ): void;\n _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;\n};\n\nexport const getKey = (\n networkClientId: NetworkClientId,\n options: Json,\n): PollingTokenSetId => `${networkClientId}:${stringify(options)}`;\n\nexport type PollingTokenSetId = `${NetworkClientId}:${string}`;\n\n// TODO: Replace `any` with type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Constructor = new (...args: any[]) => object;\n\n/**\n * AbstractPollingControllerBaseMixin\n *\n * @param Base - The base class to mix onto.\n * @returns The composed class.\n */\nexport function AbstractPollingControllerBaseMixin<TBase extends Constructor>(\n Base: TBase,\n) {\n abstract class AbstractPollingControllerBase\n extends Base\n implements IPollingController\n {\n readonly #pollingTokenSets: Map<PollingTokenSetId, Set<string>> = new Map();\n\n #callbacks: Map<\n PollingTokenSetId,\n Set<(PollingTokenSetId: PollingTokenSetId) => void>\n > = new Map();\n\n abstract _executePoll(\n networkClientId: NetworkClientId,\n options: Json,\n ): Promise<void>;\n\n abstract _startPollingByNetworkClientId(\n networkClientId: NetworkClientId,\n options: Json,\n ): void;\n\n abstract _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;\n\n startPollingByNetworkClientId(\n networkClientId: NetworkClientId,\n options: Json = {},\n ): string {\n const pollToken = random();\n const key = getKey(networkClientId, options);\n const pollingTokenSet =\n this.#pollingTokenSets.get(key) ?? new Set<string>();\n pollingTokenSet.add(pollToken);\n this.#pollingTokenSets.set(key, pollingTokenSet);\n\n if (pollingTokenSet.size === 1) {\n this._startPollingByNetworkClientId(networkClientId, options);\n }\n\n return pollToken;\n }\n\n stopAllPolling() {\n this.#pollingTokenSets.forEach((tokenSet, _key) => {\n tokenSet.forEach((token) => {\n this.stopPollingByPollingToken(token);\n });\n });\n }\n\n stopPollingByPollingToken(pollingToken: string) {\n if (!pollingToken) {\n throw new Error('pollingToken required');\n }\n\n let keyToDelete: PollingTokenSetId | null = null;\n for (const [key, tokenSet] of this.#pollingTokenSets) {\n if (tokenSet.delete(pollingToken)) {\n if (tokenSet.size === 0) {\n keyToDelete = key;\n }\n break;\n }\n }\n\n if (keyToDelete) {\n this._stopPollingByPollingTokenSetId(keyToDelete);\n this.#pollingTokenSets.delete(keyToDelete);\n const callbacks = this.#callbacks.get(keyToDelete);\n if (callbacks) {\n for (const callback of callbacks) {\n // eslint-disable-next-line n/callback-return\n callback(keyToDelete);\n }\n callbacks.clear();\n }\n }\n }\n\n onPollingCompleteByNetworkClientId(\n networkClientId: NetworkClientId,\n callback: (networkClientId: NetworkClientId) => void,\n options: Json = {},\n ) {\n const key = getKey(networkClientId, options);\n const callbacks = this.#callbacks.get(key) ?? new Set<typeof callback>();\n callbacks.add(callback);\n this.#callbacks.set(key, callbacks);\n }\n }\n return AbstractPollingControllerBase;\n}\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
var __accessCheck = (obj, member, msg) => {
|
|
2
|
+
if (!member.has(obj))
|
|
3
|
+
throw TypeError("Cannot " + msg);
|
|
4
|
+
};
|
|
5
|
+
var __privateGet = (obj, member, getter) => {
|
|
6
|
+
__accessCheck(obj, member, "read from private field");
|
|
7
|
+
return getter ? getter.call(obj) : member.get(obj);
|
|
8
|
+
};
|
|
9
|
+
var __privateAdd = (obj, member, value) => {
|
|
10
|
+
if (member.has(obj))
|
|
11
|
+
throw TypeError("Cannot add the same private member more than once");
|
|
12
|
+
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
13
|
+
};
|
|
14
|
+
var __privateSet = (obj, member, value, setter) => {
|
|
15
|
+
__accessCheck(obj, member, "write to private field");
|
|
16
|
+
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// src/AbstractPollingController.ts
|
|
21
|
+
import stringify from "fast-json-stable-stringify";
|
|
22
|
+
import { v4 as random } from "uuid";
|
|
23
|
+
var getKey = (networkClientId, options) => `${networkClientId}:${stringify(options)}`;
|
|
24
|
+
function AbstractPollingControllerBaseMixin(Base) {
|
|
25
|
+
var _pollingTokenSets, _callbacks;
|
|
26
|
+
class AbstractPollingControllerBase extends Base {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
__privateAdd(this, _pollingTokenSets, /* @__PURE__ */ new Map());
|
|
30
|
+
__privateAdd(this, _callbacks, /* @__PURE__ */ new Map());
|
|
31
|
+
}
|
|
32
|
+
startPollingByNetworkClientId(networkClientId, options = {}) {
|
|
33
|
+
const pollToken = random();
|
|
34
|
+
const key = getKey(networkClientId, options);
|
|
35
|
+
const pollingTokenSet = __privateGet(this, _pollingTokenSets).get(key) ?? /* @__PURE__ */ new Set();
|
|
36
|
+
pollingTokenSet.add(pollToken);
|
|
37
|
+
__privateGet(this, _pollingTokenSets).set(key, pollingTokenSet);
|
|
38
|
+
if (pollingTokenSet.size === 1) {
|
|
39
|
+
this._startPollingByNetworkClientId(networkClientId, options);
|
|
40
|
+
}
|
|
41
|
+
return pollToken;
|
|
42
|
+
}
|
|
43
|
+
stopAllPolling() {
|
|
44
|
+
__privateGet(this, _pollingTokenSets).forEach((tokenSet, _key) => {
|
|
45
|
+
tokenSet.forEach((token) => {
|
|
46
|
+
this.stopPollingByPollingToken(token);
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
stopPollingByPollingToken(pollingToken) {
|
|
51
|
+
if (!pollingToken) {
|
|
52
|
+
throw new Error("pollingToken required");
|
|
53
|
+
}
|
|
54
|
+
let keyToDelete = null;
|
|
55
|
+
for (const [key, tokenSet] of __privateGet(this, _pollingTokenSets)) {
|
|
56
|
+
if (tokenSet.delete(pollingToken)) {
|
|
57
|
+
if (tokenSet.size === 0) {
|
|
58
|
+
keyToDelete = key;
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
if (keyToDelete) {
|
|
64
|
+
this._stopPollingByPollingTokenSetId(keyToDelete);
|
|
65
|
+
__privateGet(this, _pollingTokenSets).delete(keyToDelete);
|
|
66
|
+
const callbacks = __privateGet(this, _callbacks).get(keyToDelete);
|
|
67
|
+
if (callbacks) {
|
|
68
|
+
for (const callback of callbacks) {
|
|
69
|
+
callback(keyToDelete);
|
|
70
|
+
}
|
|
71
|
+
callbacks.clear();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
onPollingCompleteByNetworkClientId(networkClientId, callback, options = {}) {
|
|
76
|
+
const key = getKey(networkClientId, options);
|
|
77
|
+
const callbacks = __privateGet(this, _callbacks).get(key) ?? /* @__PURE__ */ new Set();
|
|
78
|
+
callbacks.add(callback);
|
|
79
|
+
__privateGet(this, _callbacks).set(key, callbacks);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_pollingTokenSets = new WeakMap();
|
|
83
|
+
_callbacks = new WeakMap();
|
|
84
|
+
return AbstractPollingControllerBase;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
__privateGet,
|
|
89
|
+
__privateAdd,
|
|
90
|
+
__privateSet,
|
|
91
|
+
getKey,
|
|
92
|
+
AbstractPollingControllerBaseMixin
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=chunk-GKOBRMW7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/AbstractPollingController.ts"],"sourcesContent":["import type { NetworkClientId } from '@metamask/network-controller';\nimport type { Json } from '@metamask/utils';\nimport stringify from 'fast-json-stable-stringify';\nimport { v4 as random } from 'uuid';\n\nexport type IPollingController = {\n startPollingByNetworkClientId(\n networkClientId: NetworkClientId,\n options: Json,\n ): string;\n\n stopAllPolling(): void;\n\n stopPollingByPollingToken(pollingToken: string): void;\n\n onPollingCompleteByNetworkClientId(\n networkClientId: NetworkClientId,\n callback: (networkClientId: NetworkClientId) => void,\n options: Json,\n ): void;\n\n _executePoll(networkClientId: NetworkClientId, options: Json): Promise<void>;\n _startPollingByNetworkClientId(\n networkClientId: NetworkClientId,\n options: Json,\n ): void;\n _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;\n};\n\nexport const getKey = (\n networkClientId: NetworkClientId,\n options: Json,\n): PollingTokenSetId => `${networkClientId}:${stringify(options)}`;\n\nexport type PollingTokenSetId = `${NetworkClientId}:${string}`;\n\n// TODO: Replace `any` with type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Constructor = new (...args: any[]) => object;\n\n/**\n * AbstractPollingControllerBaseMixin\n *\n * @param Base - The base class to mix onto.\n * @returns The composed class.\n */\nexport function AbstractPollingControllerBaseMixin<TBase extends Constructor>(\n Base: TBase,\n) {\n abstract class AbstractPollingControllerBase\n extends Base\n implements IPollingController\n {\n readonly #pollingTokenSets: Map<PollingTokenSetId, Set<string>> = new Map();\n\n #callbacks: Map<\n PollingTokenSetId,\n Set<(PollingTokenSetId: PollingTokenSetId) => void>\n > = new Map();\n\n abstract _executePoll(\n networkClientId: NetworkClientId,\n options: Json,\n ): Promise<void>;\n\n abstract _startPollingByNetworkClientId(\n networkClientId: NetworkClientId,\n options: Json,\n ): void;\n\n abstract _stopPollingByPollingTokenSetId(key: PollingTokenSetId): void;\n\n startPollingByNetworkClientId(\n networkClientId: NetworkClientId,\n options: Json = {},\n ): string {\n const pollToken = random();\n const key = getKey(networkClientId, options);\n const pollingTokenSet =\n this.#pollingTokenSets.get(key) ?? new Set<string>();\n pollingTokenSet.add(pollToken);\n this.#pollingTokenSets.set(key, pollingTokenSet);\n\n if (pollingTokenSet.size === 1) {\n this._startPollingByNetworkClientId(networkClientId, options);\n }\n\n return pollToken;\n }\n\n stopAllPolling() {\n this.#pollingTokenSets.forEach((tokenSet, _key) => {\n tokenSet.forEach((token) => {\n this.stopPollingByPollingToken(token);\n });\n });\n }\n\n stopPollingByPollingToken(pollingToken: string) {\n if (!pollingToken) {\n throw new Error('pollingToken required');\n }\n\n let keyToDelete: PollingTokenSetId | null = null;\n for (const [key, tokenSet] of this.#pollingTokenSets) {\n if (tokenSet.delete(pollingToken)) {\n if (tokenSet.size === 0) {\n keyToDelete = key;\n }\n break;\n }\n }\n\n if (keyToDelete) {\n this._stopPollingByPollingTokenSetId(keyToDelete);\n this.#pollingTokenSets.delete(keyToDelete);\n const callbacks = this.#callbacks.get(keyToDelete);\n if (callbacks) {\n for (const callback of callbacks) {\n // eslint-disable-next-line n/callback-return\n callback(keyToDelete);\n }\n callbacks.clear();\n }\n }\n }\n\n onPollingCompleteByNetworkClientId(\n networkClientId: NetworkClientId,\n callback: (networkClientId: NetworkClientId) => void,\n options: Json = {},\n ) {\n const key = getKey(networkClientId, options);\n const callbacks = this.#callbacks.get(key) ?? new Set<typeof callback>();\n callbacks.add(callback);\n this.#callbacks.set(key, callbacks);\n }\n }\n return AbstractPollingControllerBase;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAEA,OAAO,eAAe;AACtB,SAAS,MAAM,cAAc;AA0BtB,IAAM,SAAS,CACpB,iBACA,YACsB,GAAG,eA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