@metamask/notification-services-controller 0.1.0 → 0.1.2

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.
Files changed (170) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/dist/NotificationServicesController/NotificationServicesController.js +8 -8
  3. package/dist/NotificationServicesController/NotificationServicesController.mjs +7 -7
  4. package/dist/NotificationServicesController/constants/constants.js +1 -1
  5. package/dist/NotificationServicesController/constants/constants.mjs +1 -1
  6. package/dist/NotificationServicesController/constants/index.js +6 -4
  7. package/dist/NotificationServicesController/constants/index.mjs +5 -3
  8. package/dist/NotificationServicesController/constants/notification-schema.js +5 -3
  9. package/dist/NotificationServicesController/constants/notification-schema.mjs +4 -2
  10. package/dist/NotificationServicesController/index.js +18 -13
  11. package/dist/NotificationServicesController/index.mjs +17 -12
  12. package/dist/NotificationServicesController/processors/index.js +5 -5
  13. package/dist/NotificationServicesController/processors/index.mjs +4 -4
  14. package/dist/NotificationServicesController/processors/process-feature-announcement.js +1 -1
  15. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +1 -1
  16. package/dist/NotificationServicesController/processors/process-notifications.js +4 -4
  17. package/dist/NotificationServicesController/processors/process-notifications.mjs +3 -3
  18. package/dist/NotificationServicesController/processors/process-onchain-notifications.js +1 -1
  19. package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +1 -1
  20. package/dist/NotificationServicesController/services/feature-announcements.js +4 -4
  21. package/dist/NotificationServicesController/services/feature-announcements.mjs +3 -3
  22. package/dist/NotificationServicesController/services/onchain-notifications.js +5 -5
  23. package/dist/NotificationServicesController/services/onchain-notifications.mjs +4 -4
  24. package/dist/NotificationServicesController/types/index.js +2 -2
  25. package/dist/NotificationServicesController/types/index.mjs +2 -2
  26. package/dist/NotificationServicesController/ui/constants.js +14 -0
  27. package/dist/NotificationServicesController/ui/constants.mjs +14 -0
  28. package/dist/NotificationServicesController/ui/index.js +15 -0
  29. package/dist/NotificationServicesController/ui/index.js.map +1 -0
  30. package/dist/NotificationServicesController/ui/index.mjs +15 -0
  31. package/dist/NotificationServicesController/ui/index.mjs.map +1 -0
  32. package/dist/NotificationServicesController/utils/utils.js +4 -4
  33. package/dist/NotificationServicesController/utils/utils.mjs +3 -3
  34. package/dist/NotificationServicesPushController/NotificationServicesPushController.js +20 -16
  35. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +21 -17
  36. package/dist/NotificationServicesPushController/constants.js +1 -1
  37. package/dist/NotificationServicesPushController/constants.mjs +1 -1
  38. package/dist/NotificationServicesPushController/index.js +24 -20
  39. package/dist/NotificationServicesPushController/index.mjs +25 -21
  40. package/dist/NotificationServicesPushController/services/endpoints.js +1 -1
  41. package/dist/NotificationServicesPushController/services/endpoints.mjs +1 -1
  42. package/dist/NotificationServicesPushController/services/push/push-web.js +16 -14
  43. package/dist/NotificationServicesPushController/services/push/push-web.mjs +15 -13
  44. package/dist/NotificationServicesPushController/services/services.js +17 -15
  45. package/dist/NotificationServicesPushController/services/services.mjs +16 -14
  46. package/dist/NotificationServicesPushController/utils/get-notification-data.js +1 -1
  47. package/dist/NotificationServicesPushController/utils/get-notification-data.mjs +1 -1
  48. package/dist/NotificationServicesPushController/utils/get-notification-message.js +16 -14
  49. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +15 -13
  50. package/dist/NotificationServicesPushController/utils/index.js +17 -15
  51. package/dist/NotificationServicesPushController/utils/index.mjs +16 -14
  52. package/dist/{chunk-YRWUXGL3.js → chunk-2Z3NDVOV.js} +146 -114
  53. package/dist/chunk-2Z3NDVOV.js.map +1 -0
  54. package/dist/{chunk-RYAHBEX2.mjs → chunk-4VVOTF2Y.mjs} +51 -19
  55. package/dist/chunk-4VVOTF2Y.mjs.map +1 -0
  56. package/dist/{chunk-GFAESVZA.js → chunk-5FUMSWDD.js} +3 -3
  57. package/dist/chunk-5IPZMRR5.mjs +23 -0
  58. package/dist/chunk-5IPZMRR5.mjs.map +1 -0
  59. package/dist/{chunk-DKQBDI4C.js → chunk-5TUHE2FM.js} +41 -39
  60. package/dist/chunk-5TUHE2FM.js.map +1 -0
  61. package/dist/{chunk-SSWX2N73.mjs → chunk-6GUOLD7O.mjs} +2 -2
  62. package/dist/{chunk-NJBJIZLR.js → chunk-72H2V4J5.js} +6 -7
  63. package/dist/chunk-72H2V4J5.js.map +1 -0
  64. package/dist/chunk-7SDGAI6Z.mjs +29 -0
  65. package/dist/chunk-7SDGAI6Z.mjs.map +1 -0
  66. package/dist/{chunk-52NKJDI2.mjs → chunk-A5QFYBTR.mjs} +5 -6
  67. package/dist/chunk-A5QFYBTR.mjs.map +1 -0
  68. package/dist/{chunk-TT56I53C.mjs → chunk-ADYRLXWY.mjs} +2 -2
  69. package/dist/chunk-AQPBSNWA.js +23 -0
  70. package/dist/chunk-AQPBSNWA.js.map +1 -0
  71. package/dist/{chunk-PGMXFZ6Y.js → chunk-BUT7X5F2.js} +3 -3
  72. package/dist/chunk-D7VP2FPR.js +929 -0
  73. package/dist/chunk-D7VP2FPR.js.map +1 -0
  74. package/dist/{chunk-JLHFZ2UG.mjs → chunk-DCADU5QI.mjs} +3 -3
  75. package/dist/{chunk-VOZ7Y2OO.js → chunk-DNVD3CHQ.js} +8 -8
  76. package/dist/{chunk-FFQNSBPU.js → chunk-ENRKCWJ6.js} +7 -7
  77. package/dist/{chunk-UIRZIKC3.mjs → chunk-EZHMYHBX.mjs} +2 -2
  78. package/dist/{chunk-NMLYB3XT.js → chunk-GJHW5Z65.js} +4 -4
  79. package/dist/{chunk-ZMNXLHAC.js → chunk-HZEB53A6.js} +15 -35
  80. package/dist/chunk-HZEB53A6.js.map +1 -0
  81. package/dist/chunk-IGY2S5BC.js +36 -0
  82. package/dist/chunk-IGY2S5BC.js.map +1 -0
  83. package/dist/{chunk-SMKJEA45.mjs → chunk-ILPTPB4U.mjs} +4 -26
  84. package/dist/chunk-ILPTPB4U.mjs.map +1 -0
  85. package/dist/{chunk-VC6J62JI.mjs → chunk-J4D2NH6Y.mjs} +4 -2
  86. package/dist/chunk-J4D2NH6Y.mjs.map +1 -0
  87. package/dist/{chunk-RQWUD2FB.mjs → chunk-KCWTVLMK.mjs} +2 -2
  88. package/dist/{chunk-UPVIT75F.js → chunk-KWTSMLND.js} +6 -6
  89. package/dist/{chunk-NXXY4CAP.js → chunk-MT4VCZEE.js} +11 -36
  90. package/dist/chunk-MT4VCZEE.js.map +1 -0
  91. package/dist/{chunk-PIZCE3JD.js → chunk-NOYP2T77.js} +8 -30
  92. package/dist/{chunk-PIZCE3JD.js.map → chunk-NOYP2T77.js.map} +1 -1
  93. package/dist/{chunk-EQWVJX6K.mjs → chunk-QFJZBLYQ.mjs} +14 -34
  94. package/dist/chunk-QFJZBLYQ.mjs.map +1 -0
  95. package/dist/chunk-QY4UST5V.js +37 -0
  96. package/dist/chunk-QY4UST5V.js.map +1 -0
  97. package/dist/{chunk-LFD7J7KR.mjs → chunk-R373BQEU.mjs} +10 -35
  98. package/dist/chunk-R373BQEU.mjs.map +1 -0
  99. package/dist/chunk-S2FM5DOS.js +29 -0
  100. package/dist/chunk-S2FM5DOS.js.map +1 -0
  101. package/dist/chunk-U5UIDVOO.mjs +36 -0
  102. package/dist/chunk-U5UIDVOO.mjs.map +1 -0
  103. package/dist/{chunk-DY4ELDRQ.js → chunk-V6P5JEPT.js} +5 -3
  104. package/dist/chunk-V6P5JEPT.js.map +1 -0
  105. package/dist/{chunk-QTK2RMF7.mjs → chunk-X42WN3FE.mjs} +3 -3
  106. package/dist/{chunk-ODZ6V4PH.mjs → chunk-XVIUHFC3.mjs} +9 -7
  107. package/dist/chunk-XVIUHFC3.mjs.map +1 -0
  108. package/dist/chunk-YYWFWJTJ.mjs +929 -0
  109. package/dist/chunk-YYWFWJTJ.mjs.map +1 -0
  110. package/dist/{chunk-VE4DTN4R.mjs → chunk-ZHAD55AN.mjs} +5 -3
  111. package/dist/{chunk-VE4DTN4R.mjs.map → chunk-ZHAD55AN.mjs.map} +1 -1
  112. package/dist/index.js +22 -20
  113. package/dist/index.mjs +21 -19
  114. package/dist/tsconfig.build.tsbuildinfo +1 -1
  115. package/dist/types/NotificationServicesController/NotificationServicesController.d.ts +2 -0
  116. package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +1 -1
  117. package/dist/types/NotificationServicesController/__fixtures__/index.d.ts +0 -1
  118. package/dist/types/NotificationServicesController/__fixtures__/index.d.ts.map +1 -1
  119. package/dist/types/NotificationServicesController/__fixtures__/mock-raw-notifications.d.ts.map +1 -1
  120. package/dist/types/NotificationServicesController/constants/notification-schema.d.ts +14 -8
  121. package/dist/types/NotificationServicesController/constants/notification-schema.d.ts.map +1 -1
  122. package/dist/types/NotificationServicesController/index.d.ts +1 -0
  123. package/dist/types/NotificationServicesController/index.d.ts.map +1 -1
  124. package/dist/types/NotificationServicesController/services/feature-announcements.d.ts.map +1 -1
  125. package/dist/types/NotificationServicesController/ui/constants.d.ts +20 -0
  126. package/dist/types/NotificationServicesController/ui/constants.d.ts.map +1 -0
  127. package/dist/types/NotificationServicesController/ui/index.d.ts +2 -0
  128. package/dist/types/NotificationServicesController/ui/index.d.ts.map +1 -0
  129. package/dist/types/NotificationServicesController/utils/utils.d.ts +1 -3
  130. package/dist/types/NotificationServicesController/utils/utils.d.ts.map +1 -1
  131. package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts +1 -0
  132. package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +1 -1
  133. package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts +0 -1
  134. package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts.map +1 -1
  135. package/package.json +6 -6
  136. package/dist/chunk-26CCETCM.mjs +0 -70
  137. package/dist/chunk-4KZO4UUC.js +0 -4300
  138. package/dist/chunk-4KZO4UUC.js.map +0 -1
  139. package/dist/chunk-52NKJDI2.mjs.map +0 -1
  140. package/dist/chunk-CQ6CGSKZ.js +0 -35
  141. package/dist/chunk-CQ6CGSKZ.js.map +0 -1
  142. package/dist/chunk-DKQBDI4C.js.map +0 -1
  143. package/dist/chunk-DY4ELDRQ.js.map +0 -1
  144. package/dist/chunk-EQWVJX6K.mjs.map +0 -1
  145. package/dist/chunk-HCOBC2R5.mjs +0 -4300
  146. package/dist/chunk-HCOBC2R5.mjs.map +0 -1
  147. package/dist/chunk-LFD7J7KR.mjs.map +0 -1
  148. package/dist/chunk-NJBJIZLR.js.map +0 -1
  149. package/dist/chunk-NXXY4CAP.js.map +0 -1
  150. package/dist/chunk-ODZ6V4PH.mjs.map +0 -1
  151. package/dist/chunk-RYAHBEX2.mjs.map +0 -1
  152. package/dist/chunk-SMKJEA45.mjs.map +0 -1
  153. package/dist/chunk-V46WVGWN.js +0 -70
  154. package/dist/chunk-VC6J62JI.mjs.map +0 -1
  155. package/dist/chunk-YRWUXGL3.js.map +0 -1
  156. package/dist/chunk-ZMNXLHAC.js.map +0 -1
  157. /package/dist/{chunk-V46WVGWN.js.map → NotificationServicesController/ui/constants.js.map} +0 -0
  158. /package/dist/{chunk-26CCETCM.mjs.map → NotificationServicesController/ui/constants.mjs.map} +0 -0
  159. /package/dist/{chunk-GFAESVZA.js.map → chunk-5FUMSWDD.js.map} +0 -0
  160. /package/dist/{chunk-SSWX2N73.mjs.map → chunk-6GUOLD7O.mjs.map} +0 -0
  161. /package/dist/{chunk-TT56I53C.mjs.map → chunk-ADYRLXWY.mjs.map} +0 -0
  162. /package/dist/{chunk-PGMXFZ6Y.js.map → chunk-BUT7X5F2.js.map} +0 -0
  163. /package/dist/{chunk-JLHFZ2UG.mjs.map → chunk-DCADU5QI.mjs.map} +0 -0
  164. /package/dist/{chunk-VOZ7Y2OO.js.map → chunk-DNVD3CHQ.js.map} +0 -0
  165. /package/dist/{chunk-FFQNSBPU.js.map → chunk-ENRKCWJ6.js.map} +0 -0
  166. /package/dist/{chunk-UIRZIKC3.mjs.map → chunk-EZHMYHBX.mjs.map} +0 -0
  167. /package/dist/{chunk-NMLYB3XT.js.map → chunk-GJHW5Z65.js.map} +0 -0
  168. /package/dist/{chunk-RQWUD2FB.mjs.map → chunk-KCWTVLMK.mjs.map} +0 -0
  169. /package/dist/{chunk-UPVIT75F.js.map → chunk-KWTSMLND.js.map} +0 -0
  170. /package/dist/{chunk-QTK2RMF7.mjs.map → chunk-X42WN3FE.mjs.map} +0 -0
@@ -41,7 +41,7 @@ var TRIGGER_TYPES_GROUPS = /* @__PURE__ */ ((TRIGGER_TYPES_GROUPS2) => {
41
41
  TRIGGER_TYPES_GROUPS2["DEFI"] = "defi";
42
42
  return TRIGGER_TYPES_GROUPS2;
43
43
  })(TRIGGER_TYPES_GROUPS || {});
44
- var NOTIFICATION_CHAINS = {
44
+ var NOTIFICATION_CHAINS_ID = {
45
45
  ETHEREUM: "1",
46
46
  OPTIMISM: "10",
47
47
  BSC: "56",
@@ -50,6 +50,7 @@ var NOTIFICATION_CHAINS = {
50
50
  AVALANCHE: "43114",
51
51
  LINEA: "59144"
52
52
  };
53
+ var NOTIFICATION_CHAINS = NOTIFICATION_CHAINS_ID;
53
54
  var CHAIN_SYMBOLS = {
54
55
  [NOTIFICATION_CHAINS.ETHEREUM]: "ETH",
55
56
  [NOTIFICATION_CHAINS.OPTIMISM]: "ETH",
@@ -172,5 +173,6 @@ var TRIGGERS = {
172
173
 
173
174
 
174
175
 
175
- exports.TRIGGER_TYPES = TRIGGER_TYPES; exports.TRIGGER_TYPES_WALLET_SET = TRIGGER_TYPES_WALLET_SET; exports.TRIGGER_TYPES_GROUPS = TRIGGER_TYPES_GROUPS; exports.NOTIFICATION_CHAINS = NOTIFICATION_CHAINS; exports.CHAIN_SYMBOLS = CHAIN_SYMBOLS; exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS; exports.TRIGGERS = TRIGGERS;
176
- //# sourceMappingURL=chunk-DY4ELDRQ.js.map
176
+
177
+ exports.TRIGGER_TYPES = TRIGGER_TYPES; exports.TRIGGER_TYPES_WALLET_SET = TRIGGER_TYPES_WALLET_SET; exports.TRIGGER_TYPES_GROUPS = TRIGGER_TYPES_GROUPS; exports.NOTIFICATION_CHAINS_ID = NOTIFICATION_CHAINS_ID; exports.NOTIFICATION_CHAINS = NOTIFICATION_CHAINS; exports.CHAIN_SYMBOLS = CHAIN_SYMBOLS; exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS; exports.TRIGGERS = TRIGGERS;
178
+ //# sourceMappingURL=chunk-V6P5JEPT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/NotificationServicesController/constants/notification-schema.ts"],"names":["TRIGGER_TYPES","TRIGGER_TYPES_GROUPS"],"mappings":";AAGO,IAAK,gBAAL,kBAAKA,mBAAL;AACL,EAAAA,eAAA,2BAAwB;AACxB,EAAAA,eAAA,6BAA0B;AAC1B,EAAAA,eAAA,gBAAa;AACb,EAAAA,eAAA,oBAAiB;AACjB,EAAAA,eAAA,cAAW;AACX,EAAAA,eAAA,kBAAe;AACf,EAAAA,eAAA,gCAA6B;AAC7B,EAAAA,eAAA,kCAA+B;AAC/B,EAAAA,eAAA,0BAAuB;AACvB,EAAAA,eAAA,+BAA4B;AAC5B,EAAAA,eAAA,+BAA4B;AAC5B,EAAAA,eAAA,sCAAmC;AACnC,EAAAA,eAAA,iBAAc;AACd,EAAAA,eAAA,qBAAkB;AAClB,EAAAA,eAAA,kBAAe;AACf,EAAAA,eAAA,sBAAmB;AAhBT,SAAAA;AAAA,GAAA;AAmBL,IAAM,2BAAwC,oBAAI,IAAI;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAK,uBAAL,kBAAKC,0BAAL;AACL,EAAAA,sBAAA,cAAW;AACX,EAAAA,sBAAA,UAAO;AACP,EAAAA,sBAAA,UAAO;AAHG,SAAAA;AAAA,GAAA;AAML,IAAM,yBAAyB;AAAA,EACpC,UAAU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AAkB,CAAC,oBAAoB,QAAQ;AAAA,EACjD;AAAA,EACA,CAAC,2DAAuC,GAAG;AAAA,IACzC,kBAAkB,CAAC,oBAAoB,QAAQ;AAAA,EACjD;AACF","sourcesContent":["import type { Compute } from '../types/type-utils';\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum TRIGGER_TYPES {\n FEATURES_ANNOUNCEMENT = 'features_announcement',\n METAMASK_SWAP_COMPLETED = 'metamask_swap_completed',\n ERC20_SENT = 'erc20_sent',\n ERC20_RECEIVED = 'erc20_received',\n ETH_SENT = 'eth_sent',\n ETH_RECEIVED = 'eth_received',\n ROCKETPOOL_STAKE_COMPLETED = 'rocketpool_stake_completed',\n ROCKETPOOL_UNSTAKE_COMPLETED = 'rocketpool_unstake_completed',\n LIDO_STAKE_COMPLETED = 'lido_stake_completed',\n LIDO_WITHDRAWAL_REQUESTED = 'lido_withdrawal_requested',\n LIDO_WITHDRAWAL_COMPLETED = 'lido_withdrawal_completed',\n LIDO_STAKE_READY_TO_BE_WITHDRAWN = 'lido_stake_ready_to_be_withdrawn',\n ERC721_SENT = 'erc721_sent',\n ERC721_RECEIVED = 'erc721_received',\n ERC1155_SENT = 'erc1155_sent',\n ERC1155_RECEIVED = 'erc1155_received',\n}\n\nexport const TRIGGER_TYPES_WALLET_SET: Set<string> = new Set([\n TRIGGER_TYPES.METAMASK_SWAP_COMPLETED,\n TRIGGER_TYPES.ERC20_SENT,\n TRIGGER_TYPES.ERC20_RECEIVED,\n TRIGGER_TYPES.ETH_SENT,\n TRIGGER_TYPES.ETH_RECEIVED,\n TRIGGER_TYPES.ROCKETPOOL_STAKE_COMPLETED,\n TRIGGER_TYPES.ROCKETPOOL_UNSTAKE_COMPLETED,\n TRIGGER_TYPES.LIDO_STAKE_COMPLETED,\n TRIGGER_TYPES.LIDO_WITHDRAWAL_REQUESTED,\n TRIGGER_TYPES.LIDO_WITHDRAWAL_COMPLETED,\n TRIGGER_TYPES.LIDO_STAKE_READY_TO_BE_WITHDRAWN,\n TRIGGER_TYPES.ERC721_SENT,\n TRIGGER_TYPES.ERC721_RECEIVED,\n TRIGGER_TYPES.ERC1155_SENT,\n TRIGGER_TYPES.ERC1155_RECEIVED,\n]) satisfies Set<Exclude<TRIGGER_TYPES, TRIGGER_TYPES.FEATURES_ANNOUNCEMENT>>;\n\nexport enum TRIGGER_TYPES_GROUPS {\n RECEIVED = 'received',\n SENT = 'sent',\n DEFI = 'defi',\n}\n\nexport const NOTIFICATION_CHAINS_ID = {\n ETHEREUM: '1',\n OPTIMISM: '10',\n BSC: '56',\n POLYGON: '137',\n ARBITRUM: '42161',\n AVALANCHE: '43114',\n LINEA: '59144',\n} as const;\n\ntype ToPrimitiveKeys<TObj> = Compute<{\n [K in keyof TObj]: TObj[K] extends string ? string : TObj[K];\n}>;\nexport const NOTIFICATION_CHAINS: ToPrimitiveKeys<\n typeof NOTIFICATION_CHAINS_ID\n> = NOTIFICATION_CHAINS_ID;\n\nexport const CHAIN_SYMBOLS = {\n [NOTIFICATION_CHAINS.ETHEREUM]: 'ETH',\n [NOTIFICATION_CHAINS.OPTIMISM]: 'ETH',\n [NOTIFICATION_CHAINS.BSC]: 'BNB',\n [NOTIFICATION_CHAINS.POLYGON]: 'MATIC',\n [NOTIFICATION_CHAINS.ARBITRUM]: 'ETH',\n [NOTIFICATION_CHAINS.AVALANCHE]: 'AVAX',\n [NOTIFICATION_CHAINS.LINEA]: 'ETH',\n};\n\nexport const SUPPORTED_CHAINS = [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.OPTIMISM,\n NOTIFICATION_CHAINS.BSC,\n NOTIFICATION_CHAINS.POLYGON,\n NOTIFICATION_CHAINS.ARBITRUM,\n NOTIFICATION_CHAINS.AVALANCHE,\n NOTIFICATION_CHAINS.LINEA,\n];\n\nexport type Trigger = {\n supported_chains: (typeof SUPPORTED_CHAINS)[number][];\n};\n\nexport const TRIGGERS: Partial<Record<TRIGGER_TYPES, Trigger>> = {\n [TRIGGER_TYPES.METAMASK_SWAP_COMPLETED]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.OPTIMISM,\n NOTIFICATION_CHAINS.BSC,\n NOTIFICATION_CHAINS.POLYGON,\n NOTIFICATION_CHAINS.ARBITRUM,\n NOTIFICATION_CHAINS.AVALANCHE,\n ],\n },\n [TRIGGER_TYPES.ERC20_SENT]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.OPTIMISM,\n NOTIFICATION_CHAINS.BSC,\n NOTIFICATION_CHAINS.POLYGON,\n NOTIFICATION_CHAINS.ARBITRUM,\n NOTIFICATION_CHAINS.AVALANCHE,\n NOTIFICATION_CHAINS.LINEA,\n ],\n },\n [TRIGGER_TYPES.ERC20_RECEIVED]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.OPTIMISM,\n NOTIFICATION_CHAINS.BSC,\n NOTIFICATION_CHAINS.POLYGON,\n NOTIFICATION_CHAINS.ARBITRUM,\n NOTIFICATION_CHAINS.AVALANCHE,\n NOTIFICATION_CHAINS.LINEA,\n ],\n },\n [TRIGGER_TYPES.ERC721_SENT]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.POLYGON,\n ],\n },\n [TRIGGER_TYPES.ERC721_RECEIVED]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.POLYGON,\n ],\n },\n [TRIGGER_TYPES.ERC1155_SENT]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.POLYGON,\n ],\n },\n [TRIGGER_TYPES.ERC1155_RECEIVED]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.POLYGON,\n ],\n },\n [TRIGGER_TYPES.ETH_SENT]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.OPTIMISM,\n NOTIFICATION_CHAINS.BSC,\n NOTIFICATION_CHAINS.POLYGON,\n NOTIFICATION_CHAINS.ARBITRUM,\n NOTIFICATION_CHAINS.AVALANCHE,\n NOTIFICATION_CHAINS.LINEA,\n ],\n },\n [TRIGGER_TYPES.ETH_RECEIVED]: {\n supported_chains: [\n NOTIFICATION_CHAINS.ETHEREUM,\n NOTIFICATION_CHAINS.OPTIMISM,\n NOTIFICATION_CHAINS.BSC,\n NOTIFICATION_CHAINS.POLYGON,\n NOTIFICATION_CHAINS.ARBITRUM,\n NOTIFICATION_CHAINS.AVALANCHE,\n NOTIFICATION_CHAINS.LINEA,\n ],\n },\n [TRIGGER_TYPES.ROCKETPOOL_STAKE_COMPLETED]: {\n supported_chains: [NOTIFICATION_CHAINS.ETHEREUM],\n },\n [TRIGGER_TYPES.ROCKETPOOL_UNSTAKE_COMPLETED]: {\n supported_chains: [NOTIFICATION_CHAINS.ETHEREUM],\n },\n [TRIGGER_TYPES.LIDO_STAKE_COMPLETED]: {\n supported_chains: [NOTIFICATION_CHAINS.ETHEREUM],\n },\n [TRIGGER_TYPES.LIDO_WITHDRAWAL_REQUESTED]: {\n supported_chains: [NOTIFICATION_CHAINS.ETHEREUM],\n },\n [TRIGGER_TYPES.LIDO_WITHDRAWAL_COMPLETED]: {\n supported_chains: [NOTIFICATION_CHAINS.ETHEREUM],\n },\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  processNotification,
3
3
  safeProcessNotification
4
- } from "./chunk-RQWUD2FB.mjs";
4
+ } from "./chunk-KCWTVLMK.mjs";
5
5
  import {
6
6
  processOnChainNotification
7
7
  } from "./chunk-BONB66A2.mjs";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-D42BBXBM.mjs";
12
12
  import {
13
13
  __export
14
- } from "./chunk-26CCETCM.mjs";
14
+ } from "./chunk-U5UIDVOO.mjs";
15
15
 
16
16
  // src/NotificationServicesController/processors/index.ts
17
17
  var processors_exports = {};
@@ -26,4 +26,4 @@ __export(processors_exports, {
26
26
  export {
27
27
  processors_exports
28
28
  };
29
- //# sourceMappingURL=chunk-QTK2RMF7.mjs.map
29
+ //# sourceMappingURL=chunk-X42WN3FE.mjs.map
@@ -3,22 +3,25 @@ import {
3
3
  deactivatePushNotifications,
4
4
  listenToPushNotifications,
5
5
  updateTriggerPushNotifications
6
- } from "./chunk-TT56I53C.mjs";
6
+ } from "./chunk-ADYRLXWY.mjs";
7
7
  import {
8
8
  createRegToken,
9
9
  deleteRegToken
10
- } from "./chunk-52NKJDI2.mjs";
10
+ } from "./chunk-A5QFYBTR.mjs";
11
11
  import {
12
12
  __privateAdd,
13
13
  __privateGet,
14
14
  __privateMethod,
15
15
  __privateSet
16
- } from "./chunk-26CCETCM.mjs";
16
+ } from "./chunk-U5UIDVOO.mjs";
17
17
 
18
18
  // src/NotificationServicesPushController/NotificationServicesPushController.ts
19
19
  import { BaseController } from "@metamask/base-controller";
20
20
  import log from "loglevel";
21
21
  var controllerName = "NotificationServicesPushController";
22
+ var defaultState = {
23
+ fcmToken: ""
24
+ };
22
25
  var metadata = {
23
26
  fcmToken: {
24
27
  persist: true,
@@ -37,9 +40,7 @@ var NotificationServicesPushController = class extends BaseController {
37
40
  messenger,
38
41
  metadata,
39
42
  name: controllerName,
40
- state: {
41
- fcmToken: state?.fcmToken || ""
42
- }
43
+ state: { ...defaultState, ...state }
43
44
  });
44
45
  __privateAdd(this, _registerMessageHandlers);
45
46
  __privateAdd(this, _getAndAssertBearerToken);
@@ -209,6 +210,7 @@ getAndAssertBearerToken_fn = async function() {
209
210
  };
210
211
 
211
212
  export {
213
+ defaultState,
212
214
  NotificationServicesPushController
213
215
  };
214
- //# sourceMappingURL=chunk-ODZ6V4PH.mjs.map
216
+ //# sourceMappingURL=chunk-XVIUHFC3.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/NotificationServicesPushController/NotificationServicesPushController.ts"],"sourcesContent":["import type {\n RestrictedControllerMessenger,\n ControllerGetStateAction,\n} from '@metamask/base-controller';\nimport { BaseController } from '@metamask/base-controller';\nimport type { AuthenticationController } from '@metamask/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"],"mappings":";;;;;;;;;;;;;;;;;;AAIA,SAAS,sBA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