@metamask-previews/notification-services-controller 0.1.1-preview-f776a395 → 0.1.1-preview-4f222935
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/dist/NotificationServicesController/NotificationServicesController.js +3 -3
- package/dist/NotificationServicesController/NotificationServicesController.mjs +2 -2
- package/dist/NotificationServicesController/index.js +4 -4
- package/dist/NotificationServicesController/index.mjs +3 -3
- package/dist/NotificationServicesController/services/onchain-notifications.js +2 -2
- package/dist/NotificationServicesController/services/onchain-notifications.mjs +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js +5 -5
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +4 -4
- package/dist/NotificationServicesPushController/index.js +6 -6
- package/dist/NotificationServicesPushController/index.mjs +5 -5
- package/dist/NotificationServicesPushController/services/push/push-web.js +3 -3
- package/dist/NotificationServicesPushController/services/push/push-web.mjs +3 -3
- package/dist/NotificationServicesPushController/services/services.js +3 -3
- package/dist/NotificationServicesPushController/services/services.mjs +3 -3
- package/dist/NotificationServicesPushController/utils/get-notification-message.js +3 -3
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +3 -3
- package/dist/NotificationServicesPushController/utils/index.js +3 -3
- package/dist/NotificationServicesPushController/utils/index.mjs +3 -3
- package/dist/{chunk-5TUHE2FM.js → chunk-FUHJHUPP.js} +1 -1
- package/dist/chunk-FUHJHUPP.js.map +1 -0
- package/dist/{chunk-TITJWXKP.js → chunk-FWT544DV.js} +7 -7
- package/dist/chunk-FWT544DV.js.map +1 -0
- package/dist/{chunk-R373BQEU.mjs → chunk-GDJPCXFJ.mjs} +2 -2
- package/dist/{chunk-7F6755Q2.mjs → chunk-GIZ2HPES.mjs} +3 -3
- package/dist/{chunk-MT4VCZEE.js → chunk-JCTB7YFX.js} +4 -4
- package/dist/{chunk-PI2RUC6X.mjs → chunk-NCYV66A7.mjs} +2 -2
- package/dist/chunk-NCYV66A7.mjs.map +1 -0
- package/dist/{chunk-XVIUHFC3.mjs → chunk-PLTPHT34.mjs} +1 -1
- package/dist/chunk-PLTPHT34.mjs.map +1 -0
- package/dist/{chunk-TPGIXSC2.js → chunk-VTUTQGGG.js} +2 -2
- package/dist/chunk-VTUTQGGG.js.map +1 -0
- package/dist/{chunk-DO4SOA4Y.js → chunk-YDKPMDLR.js} +9 -9
- package/dist/{chunk-54BC2GAN.mjs → chunk-YQUCX64Z.mjs} +2 -2
- package/dist/chunk-YQUCX64Z.mjs.map +1 -0
- package/dist/index.js +6 -6
- package/dist/index.mjs +5 -5
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/NotificationServicesController/NotificationServicesController.d.ts +1 -1
- package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +1 -1
- package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts +1 -1
- package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +1 -1
- package/package.json +6 -6
- package/dist/chunk-54BC2GAN.mjs.map +0 -1
- package/dist/chunk-5TUHE2FM.js.map +0 -1
- package/dist/chunk-PI2RUC6X.mjs.map +0 -1
- package/dist/chunk-TITJWXKP.js.map +0 -1
- package/dist/chunk-TPGIXSC2.js.map +0 -1
- package/dist/chunk-XVIUHFC3.mjs.map +0 -1
- /package/dist/{chunk-R373BQEU.mjs.map → chunk-GDJPCXFJ.mjs.map} +0 -0
- /package/dist/{chunk-7F6755Q2.mjs.map → chunk-GIZ2HPES.mjs.map} +0 -0
- /package/dist/{chunk-MT4VCZEE.js.map → chunk-JCTB7YFX.js.map} +0 -0
- /package/dist/{chunk-DO4SOA4Y.js.map → chunk-YDKPMDLR.js.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkFWT544DVjs = require('../chunk-FWT544DV.js');
|
|
5
5
|
require('../chunk-5FUMSWDD.js');
|
|
6
6
|
require('../chunk-LYEXYTOI.js');
|
|
7
7
|
require('../chunk-ZMNXLHAC.js');
|
|
8
8
|
require('../chunk-52CALMRA.js');
|
|
9
|
-
require('../chunk-
|
|
9
|
+
require('../chunk-VTUTQGGG.js');
|
|
10
10
|
require('../chunk-7U22ZANC.js');
|
|
11
11
|
require('../chunk-V6P5JEPT.js');
|
|
12
12
|
require('../chunk-TLX5QQK5.js');
|
|
@@ -14,5 +14,5 @@ require('../chunk-IGY2S5BC.js');
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
exports.default =
|
|
17
|
+
exports.default = _chunkFWT544DVjs.NotificationServicesController; exports.defaultState = _chunkFWT544DVjs.defaultState;
|
|
18
18
|
//# sourceMappingURL=NotificationServicesController.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NotificationServicesController,
|
|
3
3
|
defaultState
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-YQUCX64Z.mjs";
|
|
5
5
|
import "../chunk-KCWTVLMK.mjs";
|
|
6
6
|
import "../chunk-BONB66A2.mjs";
|
|
7
7
|
import "../chunk-EQWVJX6K.mjs";
|
|
8
8
|
import "../chunk-D42BBXBM.mjs";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-NCYV66A7.mjs";
|
|
10
10
|
import "../chunk-7S6524FI.mjs";
|
|
11
11
|
import "../chunk-J4D2NH6Y.mjs";
|
|
12
12
|
import "../chunk-6ZDVTRRT.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkYDKPMDLRjs = require('../chunk-YDKPMDLR.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkAQPBSNWAjs = require('../chunk-AQPBSNWA.js');
|
|
@@ -24,12 +24,12 @@ require('../chunk-3ZS2HAEG.js');
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkFWT544DVjs = require('../chunk-FWT544DV.js');
|
|
28
28
|
require('../chunk-5FUMSWDD.js');
|
|
29
29
|
require('../chunk-LYEXYTOI.js');
|
|
30
30
|
require('../chunk-ZMNXLHAC.js');
|
|
31
31
|
require('../chunk-52CALMRA.js');
|
|
32
|
-
require('../chunk-
|
|
32
|
+
require('../chunk-VTUTQGGG.js');
|
|
33
33
|
require('../chunk-7U22ZANC.js');
|
|
34
34
|
|
|
35
35
|
|
|
@@ -45,5 +45,5 @@ require('../chunk-IGY2S5BC.js');
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
exports.Constants = _chunkQY4UST5Vjs.constants_exports; exports.Controller =
|
|
48
|
+
exports.Constants = _chunkQY4UST5Vjs.constants_exports; exports.Controller = _chunkFWT544DVjs.NotificationServicesController; exports.Mocks = _chunkYDKPMDLRjs.fixtures_exports; exports.Processors = _chunkKWTSMLNDjs.processors_exports; exports.Types = _chunk232HZSEVjs.types_exports; exports.UI = _chunkAQPBSNWAjs.ui_exports; exports.defaultState = _chunkFWT544DVjs.defaultState;
|
|
49
49
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fixtures_exports
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-GIZ2HPES.mjs";
|
|
4
4
|
import {
|
|
5
5
|
ui_exports
|
|
6
6
|
} from "../chunk-5IPZMRR5.mjs";
|
|
@@ -24,12 +24,12 @@ import "../chunk-G52DNXFH.mjs";
|
|
|
24
24
|
import {
|
|
25
25
|
NotificationServicesController,
|
|
26
26
|
defaultState
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-YQUCX64Z.mjs";
|
|
28
28
|
import "../chunk-KCWTVLMK.mjs";
|
|
29
29
|
import "../chunk-BONB66A2.mjs";
|
|
30
30
|
import "../chunk-EQWVJX6K.mjs";
|
|
31
31
|
import "../chunk-D42BBXBM.mjs";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-NCYV66A7.mjs";
|
|
33
33
|
import "../chunk-7S6524FI.mjs";
|
|
34
34
|
import {
|
|
35
35
|
constants_exports
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkVTUTQGGGjs = require('../../chunk-VTUTQGGG.js');
|
|
13
13
|
require('../../chunk-7U22ZANC.js');
|
|
14
14
|
require('../../chunk-V6P5JEPT.js');
|
|
15
15
|
require('../../chunk-TLX5QQK5.js');
|
|
@@ -25,5 +25,5 @@ require('../../chunk-IGY2S5BC.js');
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
exports.NOTIFICATION_API =
|
|
28
|
+
exports.NOTIFICATION_API = _chunkVTUTQGGGjs.NOTIFICATION_API; exports.NOTIFICATION_API_LIST_ENDPOINT = _chunkVTUTQGGGjs.NOTIFICATION_API_LIST_ENDPOINT; exports.NOTIFICATION_API_LIST_ENDPOINT_PAGE_QUERY = _chunkVTUTQGGGjs.NOTIFICATION_API_LIST_ENDPOINT_PAGE_QUERY; exports.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT = _chunkVTUTQGGGjs.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT; exports.TRIGGER_API = _chunkVTUTQGGGjs.TRIGGER_API; exports.TRIGGER_API_BATCH_ENDPOINT = _chunkVTUTQGGGjs.TRIGGER_API_BATCH_ENDPOINT; exports.createOnChainTriggers = _chunkVTUTQGGGjs.createOnChainTriggers; exports.deleteOnChainTriggers = _chunkVTUTQGGGjs.deleteOnChainTriggers; exports.getOnChainNotifications = _chunkVTUTQGGGjs.getOnChainNotifications; exports.markNotificationsAsRead = _chunkVTUTQGGGjs.markNotificationsAsRead;
|
|
29
29
|
//# sourceMappingURL=onchain-notifications.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
deleteOnChainTriggers,
|
|
10
10
|
getOnChainNotifications,
|
|
11
11
|
markNotificationsAsRead
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-NCYV66A7.mjs";
|
|
13
13
|
import "../../chunk-7S6524FI.mjs";
|
|
14
14
|
import "../../chunk-J4D2NH6Y.mjs";
|
|
15
15
|
import "../../chunk-6ZDVTRRT.mjs";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkFUHJHUPPjs = require('../chunk-FUHJHUPP.js');
|
|
5
5
|
require('../chunk-GJHW5Z65.js');
|
|
6
6
|
require('../chunk-72H2V4J5.js');
|
|
7
7
|
require('../chunk-B25TJ7KS.js');
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-YDKPMDLR.js');
|
|
9
9
|
require('../chunk-AQPBSNWA.js');
|
|
10
10
|
require('../chunk-S2FM5DOS.js');
|
|
11
11
|
require('../chunk-KWTSMLND.js');
|
|
@@ -20,12 +20,12 @@ require('../chunk-ZBNBZN5H.js');
|
|
|
20
20
|
require('../chunk-PROWNV4M.js');
|
|
21
21
|
require('../chunk-XZEVRYUE.js');
|
|
22
22
|
require('../chunk-3ZS2HAEG.js');
|
|
23
|
-
require('../chunk-
|
|
23
|
+
require('../chunk-FWT544DV.js');
|
|
24
24
|
require('../chunk-5FUMSWDD.js');
|
|
25
25
|
require('../chunk-LYEXYTOI.js');
|
|
26
26
|
require('../chunk-ZMNXLHAC.js');
|
|
27
27
|
require('../chunk-52CALMRA.js');
|
|
28
|
-
require('../chunk-
|
|
28
|
+
require('../chunk-VTUTQGGG.js');
|
|
29
29
|
require('../chunk-7U22ZANC.js');
|
|
30
30
|
require('../chunk-QY4UST5V.js');
|
|
31
31
|
require('../chunk-V6P5JEPT.js');
|
|
@@ -34,5 +34,5 @@ require('../chunk-IGY2S5BC.js');
|
|
|
34
34
|
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
exports.default =
|
|
37
|
+
exports.default = _chunkFUHJHUPPjs.NotificationServicesPushController; exports.defaultState = _chunkFUHJHUPPjs.defaultState;
|
|
38
38
|
//# sourceMappingURL=NotificationServicesPushController.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
NotificationServicesPushController,
|
|
3
3
|
defaultState
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-PLTPHT34.mjs";
|
|
5
5
|
import "../chunk-ADYRLXWY.mjs";
|
|
6
6
|
import "../chunk-A5QFYBTR.mjs";
|
|
7
7
|
import "../chunk-IKWNHNJQ.mjs";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-GIZ2HPES.mjs";
|
|
9
9
|
import "../chunk-5IPZMRR5.mjs";
|
|
10
10
|
import "../chunk-7SDGAI6Z.mjs";
|
|
11
11
|
import "../chunk-X42WN3FE.mjs";
|
|
@@ -20,12 +20,12 @@ import "../chunk-4BTNTREI.mjs";
|
|
|
20
20
|
import "../chunk-QB5IFRLA.mjs";
|
|
21
21
|
import "../chunk-U74Q3BRP.mjs";
|
|
22
22
|
import "../chunk-G52DNXFH.mjs";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-YQUCX64Z.mjs";
|
|
24
24
|
import "../chunk-KCWTVLMK.mjs";
|
|
25
25
|
import "../chunk-BONB66A2.mjs";
|
|
26
26
|
import "../chunk-EQWVJX6K.mjs";
|
|
27
27
|
import "../chunk-D42BBXBM.mjs";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-NCYV66A7.mjs";
|
|
29
29
|
import "../chunk-7S6524FI.mjs";
|
|
30
30
|
import "../chunk-ZHAD55AN.mjs";
|
|
31
31
|
import "../chunk-J4D2NH6Y.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkJCTB7YFXjs = require('../chunk-JCTB7YFX.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkENRKCWJ6js = require('../chunk-ENRKCWJ6.js');
|
|
@@ -13,11 +13,11 @@ require('../chunk-GETQWOTI.js');
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _chunkFUHJHUPPjs = require('../chunk-FUHJHUPP.js');
|
|
17
17
|
require('../chunk-GJHW5Z65.js');
|
|
18
18
|
require('../chunk-72H2V4J5.js');
|
|
19
19
|
require('../chunk-B25TJ7KS.js');
|
|
20
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-YDKPMDLR.js');
|
|
21
21
|
require('../chunk-AQPBSNWA.js');
|
|
22
22
|
require('../chunk-S2FM5DOS.js');
|
|
23
23
|
require('../chunk-KWTSMLND.js');
|
|
@@ -32,12 +32,12 @@ require('../chunk-ZBNBZN5H.js');
|
|
|
32
32
|
require('../chunk-PROWNV4M.js');
|
|
33
33
|
require('../chunk-XZEVRYUE.js');
|
|
34
34
|
require('../chunk-3ZS2HAEG.js');
|
|
35
|
-
require('../chunk-
|
|
35
|
+
require('../chunk-FWT544DV.js');
|
|
36
36
|
require('../chunk-5FUMSWDD.js');
|
|
37
37
|
require('../chunk-LYEXYTOI.js');
|
|
38
38
|
require('../chunk-ZMNXLHAC.js');
|
|
39
39
|
require('../chunk-52CALMRA.js');
|
|
40
|
-
require('../chunk-
|
|
40
|
+
require('../chunk-VTUTQGGG.js');
|
|
41
41
|
require('../chunk-7U22ZANC.js');
|
|
42
42
|
require('../chunk-QY4UST5V.js');
|
|
43
43
|
require('../chunk-V6P5JEPT.js');
|
|
@@ -49,5 +49,5 @@ require('../chunk-IGY2S5BC.js');
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
|
-
exports.Controller =
|
|
52
|
+
exports.Controller = _chunkFUHJHUPPjs.NotificationServicesPushController; exports.Mocks = _chunkJCTB7YFXjs.fixtures_exports; exports.Types = _chunk7LWR54U7js.types_exports; exports.Utils = _chunkENRKCWJ6js.utils_exports; exports.defaultState = _chunkFUHJHUPPjs.defaultState;
|
|
53
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fixtures_exports
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-GDJPCXFJ.mjs";
|
|
4
4
|
import {
|
|
5
5
|
utils_exports
|
|
6
6
|
} from "../chunk-DCADU5QI.mjs";
|
|
@@ -13,11 +13,11 @@ import "../chunk-RAUV5UV4.mjs";
|
|
|
13
13
|
import {
|
|
14
14
|
NotificationServicesPushController,
|
|
15
15
|
defaultState
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-PLTPHT34.mjs";
|
|
17
17
|
import "../chunk-ADYRLXWY.mjs";
|
|
18
18
|
import "../chunk-A5QFYBTR.mjs";
|
|
19
19
|
import "../chunk-IKWNHNJQ.mjs";
|
|
20
|
-
import "../chunk-
|
|
20
|
+
import "../chunk-GIZ2HPES.mjs";
|
|
21
21
|
import "../chunk-5IPZMRR5.mjs";
|
|
22
22
|
import "../chunk-7SDGAI6Z.mjs";
|
|
23
23
|
import "../chunk-X42WN3FE.mjs";
|
|
@@ -32,12 +32,12 @@ import "../chunk-4BTNTREI.mjs";
|
|
|
32
32
|
import "../chunk-QB5IFRLA.mjs";
|
|
33
33
|
import "../chunk-U74Q3BRP.mjs";
|
|
34
34
|
import "../chunk-G52DNXFH.mjs";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-YQUCX64Z.mjs";
|
|
36
36
|
import "../chunk-KCWTVLMK.mjs";
|
|
37
37
|
import "../chunk-BONB66A2.mjs";
|
|
38
38
|
import "../chunk-EQWVJX6K.mjs";
|
|
39
39
|
import "../chunk-D42BBXBM.mjs";
|
|
40
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-NCYV66A7.mjs";
|
|
41
41
|
import "../chunk-7S6524FI.mjs";
|
|
42
42
|
import "../chunk-ZHAD55AN.mjs";
|
|
43
43
|
import "../chunk-J4D2NH6Y.mjs";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunk72H2V4J5js = require('../../../chunk-72H2V4J5.js');
|
|
7
|
-
require('../../../chunk-
|
|
7
|
+
require('../../../chunk-YDKPMDLR.js');
|
|
8
8
|
require('../../../chunk-AQPBSNWA.js');
|
|
9
9
|
require('../../../chunk-S2FM5DOS.js');
|
|
10
10
|
require('../../../chunk-KWTSMLND.js');
|
|
@@ -19,12 +19,12 @@ require('../../../chunk-ZBNBZN5H.js');
|
|
|
19
19
|
require('../../../chunk-PROWNV4M.js');
|
|
20
20
|
require('../../../chunk-XZEVRYUE.js');
|
|
21
21
|
require('../../../chunk-3ZS2HAEG.js');
|
|
22
|
-
require('../../../chunk-
|
|
22
|
+
require('../../../chunk-FWT544DV.js');
|
|
23
23
|
require('../../../chunk-5FUMSWDD.js');
|
|
24
24
|
require('../../../chunk-LYEXYTOI.js');
|
|
25
25
|
require('../../../chunk-ZMNXLHAC.js');
|
|
26
26
|
require('../../../chunk-52CALMRA.js');
|
|
27
|
-
require('../../../chunk-
|
|
27
|
+
require('../../../chunk-VTUTQGGG.js');
|
|
28
28
|
require('../../../chunk-7U22ZANC.js');
|
|
29
29
|
require('../../../chunk-QY4UST5V.js');
|
|
30
30
|
require('../../../chunk-V6P5JEPT.js');
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
listenToPushNotificationsClicked,
|
|
5
5
|
listenToPushNotificationsReceived
|
|
6
6
|
} from "../../../chunk-A5QFYBTR.mjs";
|
|
7
|
-
import "../../../chunk-
|
|
7
|
+
import "../../../chunk-GIZ2HPES.mjs";
|
|
8
8
|
import "../../../chunk-5IPZMRR5.mjs";
|
|
9
9
|
import "../../../chunk-7SDGAI6Z.mjs";
|
|
10
10
|
import "../../../chunk-X42WN3FE.mjs";
|
|
@@ -19,12 +19,12 @@ import "../../../chunk-4BTNTREI.mjs";
|
|
|
19
19
|
import "../../../chunk-QB5IFRLA.mjs";
|
|
20
20
|
import "../../../chunk-U74Q3BRP.mjs";
|
|
21
21
|
import "../../../chunk-G52DNXFH.mjs";
|
|
22
|
-
import "../../../chunk-
|
|
22
|
+
import "../../../chunk-YQUCX64Z.mjs";
|
|
23
23
|
import "../../../chunk-KCWTVLMK.mjs";
|
|
24
24
|
import "../../../chunk-BONB66A2.mjs";
|
|
25
25
|
import "../../../chunk-EQWVJX6K.mjs";
|
|
26
26
|
import "../../../chunk-D42BBXBM.mjs";
|
|
27
|
-
import "../../../chunk-
|
|
27
|
+
import "../../../chunk-NCYV66A7.mjs";
|
|
28
28
|
import "../../../chunk-7S6524FI.mjs";
|
|
29
29
|
import "../../../chunk-ZHAD55AN.mjs";
|
|
30
30
|
import "../../../chunk-J4D2NH6Y.mjs";
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
var _chunkGJHW5Z65js = require('../../chunk-GJHW5Z65.js');
|
|
9
9
|
require('../../chunk-72H2V4J5.js');
|
|
10
10
|
require('../../chunk-B25TJ7KS.js');
|
|
11
|
-
require('../../chunk-
|
|
11
|
+
require('../../chunk-YDKPMDLR.js');
|
|
12
12
|
require('../../chunk-AQPBSNWA.js');
|
|
13
13
|
require('../../chunk-S2FM5DOS.js');
|
|
14
14
|
require('../../chunk-KWTSMLND.js');
|
|
@@ -23,12 +23,12 @@ require('../../chunk-ZBNBZN5H.js');
|
|
|
23
23
|
require('../../chunk-PROWNV4M.js');
|
|
24
24
|
require('../../chunk-XZEVRYUE.js');
|
|
25
25
|
require('../../chunk-3ZS2HAEG.js');
|
|
26
|
-
require('../../chunk-
|
|
26
|
+
require('../../chunk-FWT544DV.js');
|
|
27
27
|
require('../../chunk-5FUMSWDD.js');
|
|
28
28
|
require('../../chunk-LYEXYTOI.js');
|
|
29
29
|
require('../../chunk-ZMNXLHAC.js');
|
|
30
30
|
require('../../chunk-52CALMRA.js');
|
|
31
|
-
require('../../chunk-
|
|
31
|
+
require('../../chunk-VTUTQGGG.js');
|
|
32
32
|
require('../../chunk-7U22ZANC.js');
|
|
33
33
|
require('../../chunk-QY4UST5V.js');
|
|
34
34
|
require('../../chunk-V6P5JEPT.js');
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "../../chunk-ADYRLXWY.mjs";
|
|
9
9
|
import "../../chunk-A5QFYBTR.mjs";
|
|
10
10
|
import "../../chunk-IKWNHNJQ.mjs";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-GIZ2HPES.mjs";
|
|
12
12
|
import "../../chunk-5IPZMRR5.mjs";
|
|
13
13
|
import "../../chunk-7SDGAI6Z.mjs";
|
|
14
14
|
import "../../chunk-X42WN3FE.mjs";
|
|
@@ -23,12 +23,12 @@ import "../../chunk-4BTNTREI.mjs";
|
|
|
23
23
|
import "../../chunk-QB5IFRLA.mjs";
|
|
24
24
|
import "../../chunk-U74Q3BRP.mjs";
|
|
25
25
|
import "../../chunk-G52DNXFH.mjs";
|
|
26
|
-
import "../../chunk-
|
|
26
|
+
import "../../chunk-YQUCX64Z.mjs";
|
|
27
27
|
import "../../chunk-KCWTVLMK.mjs";
|
|
28
28
|
import "../../chunk-BONB66A2.mjs";
|
|
29
29
|
import "../../chunk-EQWVJX6K.mjs";
|
|
30
30
|
import "../../chunk-D42BBXBM.mjs";
|
|
31
|
-
import "../../chunk-
|
|
31
|
+
import "../../chunk-NCYV66A7.mjs";
|
|
32
32
|
import "../../chunk-7S6524FI.mjs";
|
|
33
33
|
import "../../chunk-ZHAD55AN.mjs";
|
|
34
34
|
import "../../chunk-J4D2NH6Y.mjs";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
var _chunkBUT7X5F2js = require('../../chunk-BUT7X5F2.js');
|
|
6
6
|
require('../../chunk-EJ52BDLB.js');
|
|
7
|
-
require('../../chunk-
|
|
7
|
+
require('../../chunk-YDKPMDLR.js');
|
|
8
8
|
require('../../chunk-AQPBSNWA.js');
|
|
9
9
|
require('../../chunk-S2FM5DOS.js');
|
|
10
10
|
require('../../chunk-KWTSMLND.js');
|
|
@@ -19,12 +19,12 @@ require('../../chunk-ZBNBZN5H.js');
|
|
|
19
19
|
require('../../chunk-PROWNV4M.js');
|
|
20
20
|
require('../../chunk-XZEVRYUE.js');
|
|
21
21
|
require('../../chunk-3ZS2HAEG.js');
|
|
22
|
-
require('../../chunk-
|
|
22
|
+
require('../../chunk-FWT544DV.js');
|
|
23
23
|
require('../../chunk-5FUMSWDD.js');
|
|
24
24
|
require('../../chunk-LYEXYTOI.js');
|
|
25
25
|
require('../../chunk-ZMNXLHAC.js');
|
|
26
26
|
require('../../chunk-52CALMRA.js');
|
|
27
|
-
require('../../chunk-
|
|
27
|
+
require('../../chunk-VTUTQGGG.js');
|
|
28
28
|
require('../../chunk-7U22ZANC.js');
|
|
29
29
|
require('../../chunk-QY4UST5V.js');
|
|
30
30
|
require('../../chunk-V6P5JEPT.js');
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
isOnChainNotification
|
|
5
5
|
} from "../../chunk-6GUOLD7O.mjs";
|
|
6
6
|
import "../../chunk-ODI2BTKS.mjs";
|
|
7
|
-
import "../../chunk-
|
|
7
|
+
import "../../chunk-GIZ2HPES.mjs";
|
|
8
8
|
import "../../chunk-5IPZMRR5.mjs";
|
|
9
9
|
import "../../chunk-7SDGAI6Z.mjs";
|
|
10
10
|
import "../../chunk-X42WN3FE.mjs";
|
|
@@ -19,12 +19,12 @@ import "../../chunk-4BTNTREI.mjs";
|
|
|
19
19
|
import "../../chunk-QB5IFRLA.mjs";
|
|
20
20
|
import "../../chunk-U74Q3BRP.mjs";
|
|
21
21
|
import "../../chunk-G52DNXFH.mjs";
|
|
22
|
-
import "../../chunk-
|
|
22
|
+
import "../../chunk-YQUCX64Z.mjs";
|
|
23
23
|
import "../../chunk-KCWTVLMK.mjs";
|
|
24
24
|
import "../../chunk-BONB66A2.mjs";
|
|
25
25
|
import "../../chunk-EQWVJX6K.mjs";
|
|
26
26
|
import "../../chunk-D42BBXBM.mjs";
|
|
27
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-NCYV66A7.mjs";
|
|
28
28
|
import "../../chunk-7S6524FI.mjs";
|
|
29
29
|
import "../../chunk-ZHAD55AN.mjs";
|
|
30
30
|
import "../../chunk-J4D2NH6Y.mjs";
|
|
@@ -10,7 +10,7 @@ var _chunkBUT7X5F2js = require('../../chunk-BUT7X5F2.js');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
var _chunkEJ52BDLBjs = require('../../chunk-EJ52BDLB.js');
|
|
13
|
-
require('../../chunk-
|
|
13
|
+
require('../../chunk-YDKPMDLR.js');
|
|
14
14
|
require('../../chunk-AQPBSNWA.js');
|
|
15
15
|
require('../../chunk-S2FM5DOS.js');
|
|
16
16
|
require('../../chunk-KWTSMLND.js');
|
|
@@ -25,12 +25,12 @@ require('../../chunk-ZBNBZN5H.js');
|
|
|
25
25
|
require('../../chunk-PROWNV4M.js');
|
|
26
26
|
require('../../chunk-XZEVRYUE.js');
|
|
27
27
|
require('../../chunk-3ZS2HAEG.js');
|
|
28
|
-
require('../../chunk-
|
|
28
|
+
require('../../chunk-FWT544DV.js');
|
|
29
29
|
require('../../chunk-5FUMSWDD.js');
|
|
30
30
|
require('../../chunk-LYEXYTOI.js');
|
|
31
31
|
require('../../chunk-ZMNXLHAC.js');
|
|
32
32
|
require('../../chunk-52CALMRA.js');
|
|
33
|
-
require('../../chunk-
|
|
33
|
+
require('../../chunk-VTUTQGGG.js');
|
|
34
34
|
require('../../chunk-7U22ZANC.js');
|
|
35
35
|
require('../../chunk-QY4UST5V.js');
|
|
36
36
|
require('../../chunk-V6P5JEPT.js');
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
getAmount,
|
|
11
11
|
getLeadingZeroCount
|
|
12
12
|
} from "../../chunk-ODI2BTKS.mjs";
|
|
13
|
-
import "../../chunk-
|
|
13
|
+
import "../../chunk-GIZ2HPES.mjs";
|
|
14
14
|
import "../../chunk-5IPZMRR5.mjs";
|
|
15
15
|
import "../../chunk-7SDGAI6Z.mjs";
|
|
16
16
|
import "../../chunk-X42WN3FE.mjs";
|
|
@@ -25,12 +25,12 @@ import "../../chunk-4BTNTREI.mjs";
|
|
|
25
25
|
import "../../chunk-QB5IFRLA.mjs";
|
|
26
26
|
import "../../chunk-U74Q3BRP.mjs";
|
|
27
27
|
import "../../chunk-G52DNXFH.mjs";
|
|
28
|
-
import "../../chunk-
|
|
28
|
+
import "../../chunk-YQUCX64Z.mjs";
|
|
29
29
|
import "../../chunk-KCWTVLMK.mjs";
|
|
30
30
|
import "../../chunk-BONB66A2.mjs";
|
|
31
31
|
import "../../chunk-EQWVJX6K.mjs";
|
|
32
32
|
import "../../chunk-D42BBXBM.mjs";
|
|
33
|
-
import "../../chunk-
|
|
33
|
+
import "../../chunk-NCYV66A7.mjs";
|
|
34
34
|
import "../../chunk-7S6524FI.mjs";
|
|
35
35
|
import "../../chunk-ZHAD55AN.mjs";
|
|
36
36
|
import "../../chunk-J4D2NH6Y.mjs";
|
|
@@ -213,4 +213,4 @@ getAndAssertBearerToken_fn = async function() {
|
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
exports.defaultState = defaultState; exports.NotificationServicesPushController = NotificationServicesPushController;
|
|
216
|
-
//# sourceMappingURL=chunk-
|
|
216
|
+
//# sourceMappingURL=chunk-FUHJHUPP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/NotificationServicesPushController/NotificationServicesPushController.ts"],"names":[],"mappings":"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","sourcesContent":["import type {\n RestrictedControllerMessenger,\n ControllerGetStateAction,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { AuthenticationController } from '@metamask-previews/profile-sync-controller';\nimport log from 'loglevel';\n\nimport type { Types } from '../NotificationServicesController';\nimport { createRegToken, deleteRegToken } from './services/push/push-web';\nimport {\n activatePushNotifications,\n deactivatePushNotifications,\n listenToPushNotifications,\n updateTriggerPushNotifications,\n} from './services/services';\nimport type { PushNotificationEnv } from './types';\n\nconst controllerName = 'NotificationServicesPushController';\n\nexport type NotificationServicesPushControllerState = {\n fcmToken: string;\n};\n\nexport type NotificationServicesPushControllerEnablePushNotificationsAction = {\n type: `${typeof controllerName}:enablePushNotifications`;\n handler: NotificationServicesPushController['enablePushNotifications'];\n};\n\nexport type NotificationServicesPushControllerDisablePushNotificationsAction = {\n type: `${typeof controllerName}:disablePushNotifications`;\n handler: NotificationServicesPushController['disablePushNotifications'];\n};\nexport type NotificationServicesPushControllerUpdateTriggerPushNotificationsAction =\n {\n type: `${typeof controllerName}:updateTriggerPushNotifications`;\n handler: NotificationServicesPushController['updateTriggerPushNotifications'];\n };\n\nexport type Actions =\n | NotificationServicesPushControllerEnablePushNotificationsAction\n | NotificationServicesPushControllerDisablePushNotificationsAction\n | NotificationServicesPushControllerUpdateTriggerPushNotificationsAction\n | ControllerGetStateAction<'state', NotificationServicesPushControllerState>;\n\nexport type AllowedActions =\n AuthenticationController.AuthenticationControllerGetBearerToken;\n\nexport type NotificationServicesPushControllerOnNewNotificationEvent = {\n type: `${typeof controllerName}:onNewNotifications`;\n payload: [Types.INotification];\n};\n\nexport type NotificationServicesPushControllerPushNotificationClicked = {\n type: `${typeof controllerName}:pushNotificationClicked`;\n payload: [Types.INotification];\n};\n\nexport type AllowedEvents =\n | NotificationServicesPushControllerOnNewNotificationEvent\n | NotificationServicesPushControllerPushNotificationClicked;\n\nexport type NotificationServicesPushControllerMessenger =\n RestrictedControllerMessenger<\n typeof controllerName,\n Actions | AllowedActions,\n AllowedEvents,\n AllowedActions['type'],\n AllowedEvents['type']\n >;\n\nexport const defaultState: NotificationServicesPushControllerState = {\n fcmToken: '',\n};\nconst metadata = {\n fcmToken: {\n persist: true,\n anonymous: true,\n },\n};\n\ntype ControllerConfig = {\n /**\n * Config to turn on/off push notifications.\n * This is currently linked to MV3 builds on extension.\n */\n isPushEnabled: boolean;\n\n /**\n * Must handle when a push notification is received.\n * You must call `registration.showNotification` or equivalent to show the notification on web/mobile\n */\n onPushNotificationReceived: (\n notification: Types.INotification,\n ) => void | Promise<void>;\n\n /**\n * Must handle when a push notification is clicked.\n * You must call `event.notification.close();` or equivalent for closing and opening notification in a new window.\n */\n onPushNotificationClicked: (\n event: NotificationEvent,\n notification?: Types.INotification,\n ) => void;\n\n /**\n * determine the config used for push notification services\n */\n platform: 'extension' | 'mobile';\n};\n\n/**\n * Manages push notifications for the application, including enabling, disabling, and updating triggers for push notifications.\n * This controller integrates with Firebase Cloud Messaging (FCM) to handle the registration and management of push notifications.\n * It is responsible for registering and unregistering the service worker that listens for push notifications,\n * managing the FCM token, and communicating with the server to register or unregister the device for push notifications.\n * Additionally, it provides functionality to update the server with new UUIDs that should trigger push notifications.\n *\n * @augments {BaseController<typeof controllerName, NotificationServicesPushControllerState, NotificationServicesPushControllerMessenger>}\n */\nexport default class NotificationServicesPushController extends BaseController<\n typeof controllerName,\n NotificationServicesPushControllerState,\n NotificationServicesPushControllerMessenger\n> {\n #pushListenerUnsubscribe: (() => void) | undefined = undefined;\n\n #env: PushNotificationEnv;\n\n #config: ControllerConfig;\n\n constructor({\n messenger,\n state,\n env,\n config,\n }: {\n messenger: NotificationServicesPushControllerMessenger;\n state: NotificationServicesPushControllerState;\n env: PushNotificationEnv;\n config: ControllerConfig;\n }) {\n super({\n messenger,\n metadata,\n name: controllerName,\n state: { ...defaultState, ...state },\n });\n\n this.#env = env;\n this.#config = config;\n\n this.#registerMessageHandlers();\n }\n\n #registerMessageHandlers(): void {\n this.messagingSystem.registerActionHandler(\n 'NotificationServicesPushController:enablePushNotifications',\n this.enablePushNotifications.bind(this),\n );\n this.messagingSystem.registerActionHandler(\n 'NotificationServicesPushController:disablePushNotifications',\n this.disablePushNotifications.bind(this),\n );\n this.messagingSystem.registerActionHandler(\n 'NotificationServicesPushController:updateTriggerPushNotifications',\n this.updateTriggerPushNotifications.bind(this),\n );\n }\n\n async #getAndAssertBearerToken() {\n const bearerToken = await this.messagingSystem.call(\n 'AuthenticationController:getBearerToken',\n );\n if (!bearerToken) {\n log.error(\n 'Failed to enable push notifications: BearerToken token is missing.',\n );\n throw new Error('BearerToken token is missing');\n }\n\n return bearerToken;\n }\n\n /**\n * Enables push notifications for the application.\n *\n * This method sets up the necessary infrastructure for handling push notifications by:\n * 1. Registering the service worker to listen for messages.\n * 2. Fetching the Firebase Cloud Messaging (FCM) token from Firebase.\n * 3. Sending the FCM token to the server responsible for sending notifications, to register the device.\n *\n * @param UUIDs - An array of UUIDs to enable push notifications for.\n */\n async enablePushNotifications(UUIDs: string[]) {\n if (!this.#config.isPushEnabled) {\n return;\n }\n\n const bearerToken = await this.#getAndAssertBearerToken();\n\n try {\n // Activate Push Notifications\n const regToken = await activatePushNotifications({\n bearerToken,\n triggers: UUIDs,\n env: this.#env,\n createRegToken,\n platform: this.#config.platform,\n });\n\n if (!regToken) {\n return;\n }\n\n this.#pushListenerUnsubscribe = await listenToPushNotifications({\n env: this.#env,\n listenToPushReceived: async (n) => {\n this.messagingSystem.publish(\n 'NotificationServicesPushController:onNewNotifications',\n n,\n );\n await this.#config.onPushNotificationReceived(n);\n },\n listenToPushClicked: (e, n) => {\n if (n) {\n this.messagingSystem.publish(\n 'NotificationServicesPushController:pushNotificationClicked',\n n,\n );\n }\n\n this.#config.onPushNotificationClicked(e);\n },\n });\n\n // Update state\n this.update((state) => {\n state.fcmToken = regToken;\n });\n } catch (error) {\n log.error('Failed to enable push notifications:', error);\n throw new Error('Failed to enable push notifications');\n }\n }\n\n /**\n * Disables push notifications for the application.\n * This method handles the process of disabling push notifications by:\n * 1. Unregistering the service worker to stop listening for messages.\n * 2. Sending a request to the server to unregister the device using the FCM token.\n * 3. Removing the FCM token from the state to complete the process.\n *\n * @param UUIDs - An array of UUIDs for which push notifications should be disabled.\n */\n async disablePushNotifications(UUIDs: string[]) {\n if (!this.#config.isPushEnabled) {\n return;\n }\n\n const bearerToken = await this.#getAndAssertBearerToken();\n let isPushNotificationsDisabled: boolean;\n\n try {\n // Send a request to the server to unregister the token/device\n isPushNotificationsDisabled = await deactivatePushNotifications({\n bearerToken,\n triggers: UUIDs,\n env: this.#env,\n deleteRegToken,\n regToken: this.state.fcmToken,\n });\n } catch (error) {\n const errorMessage = `Failed to disable push notifications: ${\n error as string\n }`;\n log.error(errorMessage);\n throw new Error(errorMessage);\n }\n\n // Remove the FCM token from the state\n if (!isPushNotificationsDisabled) {\n return;\n }\n\n // Unsubscribe from push notifications\n this.#pushListenerUnsubscribe?.();\n\n // Update State\n if (isPushNotificationsDisabled) {\n this.update((state) => {\n state.fcmToken = '';\n });\n }\n }\n\n /**\n * Updates the triggers for push notifications.\n * This method is responsible for updating the server with the new set of UUIDs that should trigger push notifications.\n * It uses the current FCM token and a BearerToken for authentication.\n *\n * @param UUIDs - An array of UUIDs that should trigger push notifications.\n */\n async updateTriggerPushNotifications(UUIDs: string[]) {\n if (!this.#config.isPushEnabled) {\n return;\n }\n\n const bearerToken = await this.#getAndAssertBearerToken();\n\n try {\n const { fcmToken } = await updateTriggerPushNotifications({\n bearerToken,\n triggers: UUIDs,\n env: this.#env,\n createRegToken,\n deleteRegToken,\n platform: this.#config.platform,\n regToken: this.state.fcmToken,\n });\n\n // update the state with the new FCM token\n if (fcmToken) {\n this.update((state) => {\n state.fcmToken = fcmToken;\n });\n }\n } catch (error) {\n const errorMessage = `Failed to update triggers for push notifications: ${\n error as string\n }`;\n log.error(errorMessage);\n throw new Error(errorMessage);\n }\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ var _chunkZMNXLHACjs = require('./chunk-ZMNXLHAC.js');
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _chunkVTUTQGGGjs = require('./chunk-VTUTQGGG.js');
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
|
|
@@ -409,7 +409,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
409
409
|
await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
410
410
|
}
|
|
411
411
|
const triggers = _chunk7U22ZANCjs.traverseUserStorageTriggers.call(void 0, userStorage);
|
|
412
|
-
await
|
|
412
|
+
await _chunkVTUTQGGGjs.createOnChainTriggers.call(void 0,
|
|
413
413
|
userStorage,
|
|
414
414
|
storageKey,
|
|
415
415
|
bearerToken,
|
|
@@ -503,7 +503,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
503
503
|
if (UUIDs.length === 0) {
|
|
504
504
|
return userStorage;
|
|
505
505
|
}
|
|
506
|
-
await
|
|
506
|
+
await _chunkVTUTQGGGjs.deleteOnChainTriggers.call(void 0,
|
|
507
507
|
userStorage,
|
|
508
508
|
storageKey,
|
|
509
509
|
bearerToken,
|
|
@@ -559,7 +559,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
559
559
|
return void 0;
|
|
560
560
|
}
|
|
561
561
|
});
|
|
562
|
-
await
|
|
562
|
+
await _chunkVTUTQGGGjs.createOnChainTriggers.call(void 0,
|
|
563
563
|
userStorage,
|
|
564
564
|
storageKey,
|
|
565
565
|
bearerToken,
|
|
@@ -595,7 +595,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
595
595
|
const userStorage = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _storage).getNotificationStorage().then((s) => s && JSON.parse(s)).catch(() => null);
|
|
596
596
|
const bearerToken = await _chunkIGY2S5BCjs.__privateGet.call(void 0, this, _auth).getBearerToken().catch(() => null);
|
|
597
597
|
if (userStorage && bearerToken) {
|
|
598
|
-
const notifications = await
|
|
598
|
+
const notifications = await _chunkVTUTQGGGjs.getOnChainNotifications.call(void 0,
|
|
599
599
|
userStorage,
|
|
600
600
|
bearerToken
|
|
601
601
|
).catch(() => []);
|
|
@@ -648,7 +648,7 @@ var NotificationServicesController = class extends _basecontroller.BaseControlle
|
|
|
648
648
|
onchainNotificationIds = onChainNotifications.map(
|
|
649
649
|
(notification) => notification.id
|
|
650
650
|
);
|
|
651
|
-
await
|
|
651
|
+
await _chunkVTUTQGGGjs.markNotificationsAsRead.call(void 0,
|
|
652
652
|
bearerToken,
|
|
653
653
|
onchainNotificationIds
|
|
654
654
|
).catch(() => {
|
|
@@ -819,4 +819,4 @@ clearUpdatingAccountsState_fn = function(accounts) {
|
|
|
819
819
|
|
|
820
820
|
|
|
821
821
|
exports.defaultState = defaultState; exports.NotificationServicesController = NotificationServicesController;
|
|
822
|
-
//# sourceMappingURL=chunk-
|
|
822
|
+
//# sourceMappingURL=chunk-FWT544DV.js.map
|