@metamask-previews/notification-services-controller 0.0.0-preview-b09c2ed

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 (391) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +20 -0
  3. package/README.md +15 -0
  4. package/dist/NotificationServicesController/NotificationServicesController.js +18 -0
  5. package/dist/NotificationServicesController/NotificationServicesController.js.map +1 -0
  6. package/dist/NotificationServicesController/NotificationServicesController.mjs +18 -0
  7. package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -0
  8. package/dist/NotificationServicesController/constants/constants.js +10 -0
  9. package/dist/NotificationServicesController/constants/constants.js.map +1 -0
  10. package/dist/NotificationServicesController/constants/constants.mjs +10 -0
  11. package/dist/NotificationServicesController/constants/constants.mjs.map +1 -0
  12. package/dist/NotificationServicesController/constants/index.js +27 -0
  13. package/dist/NotificationServicesController/constants/index.js.map +1 -0
  14. package/dist/NotificationServicesController/constants/index.mjs +27 -0
  15. package/dist/NotificationServicesController/constants/index.mjs.map +1 -0
  16. package/dist/NotificationServicesController/constants/notification-schema.js +20 -0
  17. package/dist/NotificationServicesController/constants/notification-schema.js.map +1 -0
  18. package/dist/NotificationServicesController/constants/notification-schema.mjs +20 -0
  19. package/dist/NotificationServicesController/constants/notification-schema.mjs.map +1 -0
  20. package/dist/NotificationServicesController/index.js +44 -0
  21. package/dist/NotificationServicesController/index.js.map +1 -0
  22. package/dist/NotificationServicesController/index.mjs +44 -0
  23. package/dist/NotificationServicesController/index.mjs.map +1 -0
  24. package/dist/NotificationServicesController/processors/index.js +22 -0
  25. package/dist/NotificationServicesController/processors/index.js.map +1 -0
  26. package/dist/NotificationServicesController/processors/index.mjs +22 -0
  27. package/dist/NotificationServicesController/processors/index.mjs.map +1 -0
  28. package/dist/NotificationServicesController/processors/process-feature-announcement.js +10 -0
  29. package/dist/NotificationServicesController/processors/process-feature-announcement.js.map +1 -0
  30. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +10 -0
  31. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -0
  32. package/dist/NotificationServicesController/processors/process-notifications.js +13 -0
  33. package/dist/NotificationServicesController/processors/process-notifications.js.map +1 -0
  34. package/dist/NotificationServicesController/processors/process-notifications.mjs +13 -0
  35. package/dist/NotificationServicesController/processors/process-notifications.mjs.map +1 -0
  36. package/dist/NotificationServicesController/processors/process-onchain-notifications.js +8 -0
  37. package/dist/NotificationServicesController/processors/process-onchain-notifications.js.map +1 -0
  38. package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +8 -0
  39. package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs.map +1 -0
  40. package/dist/NotificationServicesController/services/feature-announcements.js +14 -0
  41. package/dist/NotificationServicesController/services/feature-announcements.js.map +1 -0
  42. package/dist/NotificationServicesController/services/feature-announcements.mjs +14 -0
  43. package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -0
  44. package/dist/NotificationServicesController/services/onchain-notifications.js +29 -0
  45. package/dist/NotificationServicesController/services/onchain-notifications.js.map +1 -0
  46. package/dist/NotificationServicesController/services/onchain-notifications.mjs +29 -0
  47. package/dist/NotificationServicesController/services/onchain-notifications.mjs.map +1 -0
  48. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js +2 -0
  49. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js.map +1 -0
  50. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs +2 -0
  51. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs.map +1 -0
  52. package/dist/NotificationServicesController/types/feature-announcement/index.js +5 -0
  53. package/dist/NotificationServicesController/types/feature-announcement/index.js.map +1 -0
  54. package/dist/NotificationServicesController/types/feature-announcement/index.mjs +5 -0
  55. package/dist/NotificationServicesController/types/feature-announcement/index.mjs.map +1 -0
  56. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js +2 -0
  57. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js.map +1 -0
  58. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs +2 -0
  59. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs.map +1 -0
  60. package/dist/NotificationServicesController/types/feature-announcement/type-links.js +2 -0
  61. package/dist/NotificationServicesController/types/feature-announcement/type-links.js.map +1 -0
  62. package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs +2 -0
  63. package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs.map +1 -0
  64. package/dist/NotificationServicesController/types/index.js +12 -0
  65. package/dist/NotificationServicesController/types/index.js.map +1 -0
  66. package/dist/NotificationServicesController/types/index.mjs +12 -0
  67. package/dist/NotificationServicesController/types/index.mjs.map +1 -0
  68. package/dist/NotificationServicesController/types/notification/index.js +3 -0
  69. package/dist/NotificationServicesController/types/notification/index.js.map +1 -0
  70. package/dist/NotificationServicesController/types/notification/index.mjs +3 -0
  71. package/dist/NotificationServicesController/types/notification/index.mjs.map +1 -0
  72. package/dist/NotificationServicesController/types/notification/notification.js +2 -0
  73. package/dist/NotificationServicesController/types/notification/notification.js.map +1 -0
  74. package/dist/NotificationServicesController/types/notification/notification.mjs +2 -0
  75. package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -0
  76. package/dist/NotificationServicesController/types/on-chain-notification/index.js +3 -0
  77. package/dist/NotificationServicesController/types/on-chain-notification/index.js.map +1 -0
  78. package/dist/NotificationServicesController/types/on-chain-notification/index.mjs +3 -0
  79. package/dist/NotificationServicesController/types/on-chain-notification/index.mjs.map +1 -0
  80. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.js +2 -0
  81. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.js.map +1 -0
  82. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs +2 -0
  83. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs.map +1 -0
  84. package/dist/NotificationServicesController/types/on-chain-notification/schema.js +1 -0
  85. package/dist/NotificationServicesController/types/on-chain-notification/schema.js.map +1 -0
  86. package/dist/NotificationServicesController/types/on-chain-notification/schema.mjs +1 -0
  87. package/dist/NotificationServicesController/types/on-chain-notification/schema.mjs.map +1 -0
  88. package/dist/NotificationServicesController/types/type-utils.js +1 -0
  89. package/dist/NotificationServicesController/types/type-utils.js.map +1 -0
  90. package/dist/NotificationServicesController/types/type-utils.mjs +1 -0
  91. package/dist/NotificationServicesController/types/type-utils.mjs.map +1 -0
  92. package/dist/NotificationServicesController/types/user-storage/index.js +3 -0
  93. package/dist/NotificationServicesController/types/user-storage/index.js.map +1 -0
  94. package/dist/NotificationServicesController/types/user-storage/index.mjs +3 -0
  95. package/dist/NotificationServicesController/types/user-storage/index.mjs.map +1 -0
  96. package/dist/NotificationServicesController/types/user-storage/user-storage.js +2 -0
  97. package/dist/NotificationServicesController/types/user-storage/user-storage.js.map +1 -0
  98. package/dist/NotificationServicesController/types/user-storage/user-storage.mjs +2 -0
  99. package/dist/NotificationServicesController/types/user-storage/user-storage.mjs.map +1 -0
  100. package/dist/NotificationServicesController/utils/utils.js +32 -0
  101. package/dist/NotificationServicesController/utils/utils.js.map +1 -0
  102. package/dist/NotificationServicesController/utils/utils.mjs +32 -0
  103. package/dist/NotificationServicesController/utils/utils.mjs.map +1 -0
  104. package/dist/NotificationServicesPushController/NotificationServicesPushController.js +34 -0
  105. package/dist/NotificationServicesPushController/NotificationServicesPushController.js.map +1 -0
  106. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +34 -0
  107. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -0
  108. package/dist/NotificationServicesPushController/constants.js +26 -0
  109. package/dist/NotificationServicesPushController/constants.js.map +1 -0
  110. package/dist/NotificationServicesPushController/constants.mjs +26 -0
  111. package/dist/NotificationServicesPushController/constants.mjs.map +1 -0
  112. package/dist/NotificationServicesPushController/index.js +49 -0
  113. package/dist/NotificationServicesPushController/index.js.map +1 -0
  114. package/dist/NotificationServicesPushController/index.mjs +49 -0
  115. package/dist/NotificationServicesPushController/index.mjs.map +1 -0
  116. package/dist/NotificationServicesPushController/services/endpoints.js +8 -0
  117. package/dist/NotificationServicesPushController/services/endpoints.js.map +1 -0
  118. package/dist/NotificationServicesPushController/services/endpoints.mjs +8 -0
  119. package/dist/NotificationServicesPushController/services/endpoints.mjs.map +1 -0
  120. package/dist/NotificationServicesPushController/services/push/index.js +1 -0
  121. package/dist/NotificationServicesPushController/services/push/index.js.map +1 -0
  122. package/dist/NotificationServicesPushController/services/push/index.mjs +1 -0
  123. package/dist/NotificationServicesPushController/services/push/index.mjs.map +1 -0
  124. package/dist/NotificationServicesPushController/services/push/push-web.js +37 -0
  125. package/dist/NotificationServicesPushController/services/push/push-web.js.map +1 -0
  126. package/dist/NotificationServicesPushController/services/push/push-web.mjs +37 -0
  127. package/dist/NotificationServicesPushController/services/push/push-web.mjs.map +1 -0
  128. package/dist/NotificationServicesPushController/services/services.js +43 -0
  129. package/dist/NotificationServicesPushController/services/services.js.map +1 -0
  130. package/dist/NotificationServicesPushController/services/services.mjs +43 -0
  131. package/dist/NotificationServicesPushController/services/services.mjs.map +1 -0
  132. package/dist/NotificationServicesPushController/types/firebase.js +2 -0
  133. package/dist/NotificationServicesPushController/types/firebase.js.map +1 -0
  134. package/dist/NotificationServicesPushController/types/firebase.mjs +2 -0
  135. package/dist/NotificationServicesPushController/types/firebase.mjs.map +1 -0
  136. package/dist/NotificationServicesPushController/types/index.js +3 -0
  137. package/dist/NotificationServicesPushController/types/index.js.map +1 -0
  138. package/dist/NotificationServicesPushController/types/index.mjs +3 -0
  139. package/dist/NotificationServicesPushController/types/index.mjs.map +1 -0
  140. package/dist/NotificationServicesPushController/utils/get-notification-data.js +14 -0
  141. package/dist/NotificationServicesPushController/utils/get-notification-data.js.map +1 -0
  142. package/dist/NotificationServicesPushController/utils/get-notification-data.mjs +14 -0
  143. package/dist/NotificationServicesPushController/utils/get-notification-data.mjs.map +1 -0
  144. package/dist/NotificationServicesPushController/utils/get-notification-message.js +36 -0
  145. package/dist/NotificationServicesPushController/utils/get-notification-message.js.map +1 -0
  146. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +36 -0
  147. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -0
  148. package/dist/NotificationServicesPushController/utils/index.js +46 -0
  149. package/dist/NotificationServicesPushController/utils/index.js.map +1 -0
  150. package/dist/NotificationServicesPushController/utils/index.mjs +46 -0
  151. package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -0
  152. package/dist/chunk-232HZSEV.js +7 -0
  153. package/dist/chunk-232HZSEV.js.map +1 -0
  154. package/dist/chunk-26CCETCM.mjs +70 -0
  155. package/dist/chunk-26CCETCM.mjs.map +1 -0
  156. package/dist/chunk-3F4M3OUO.mjs +119 -0
  157. package/dist/chunk-3F4M3OUO.mjs.map +1 -0
  158. package/dist/chunk-3ZS2HAEG.js +1 -0
  159. package/dist/chunk-3ZS2HAEG.js.map +1 -0
  160. package/dist/chunk-4BTNTREI.mjs +1 -0
  161. package/dist/chunk-4BTNTREI.mjs.map +1 -0
  162. package/dist/chunk-4QXAPVW3.mjs +1 -0
  163. package/dist/chunk-4QXAPVW3.mjs.map +1 -0
  164. package/dist/chunk-52CALMRA.js +28 -0
  165. package/dist/chunk-52CALMRA.js.map +1 -0
  166. package/dist/chunk-52NKJDI2.mjs +93 -0
  167. package/dist/chunk-52NKJDI2.mjs.map +1 -0
  168. package/dist/chunk-5OYPOYXZ.mjs +802 -0
  169. package/dist/chunk-5OYPOYXZ.mjs.map +1 -0
  170. package/dist/chunk-5WWCWQCE.js +214 -0
  171. package/dist/chunk-5WWCWQCE.js.map +1 -0
  172. package/dist/chunk-6B5FOWRH.js +119 -0
  173. package/dist/chunk-6B5FOWRH.js.map +1 -0
  174. package/dist/chunk-6ZDVTRRT.mjs +9 -0
  175. package/dist/chunk-6ZDVTRRT.mjs.map +1 -0
  176. package/dist/chunk-7LWR54U7.js +7 -0
  177. package/dist/chunk-7LWR54U7.js.map +1 -0
  178. package/dist/chunk-7RM3YNTD.mjs +1 -0
  179. package/dist/chunk-7RM3YNTD.mjs.map +1 -0
  180. package/dist/chunk-A2RPVX47.mjs +1 -0
  181. package/dist/chunk-A2RPVX47.mjs.map +1 -0
  182. package/dist/chunk-B25TJ7KS.js +8 -0
  183. package/dist/chunk-B25TJ7KS.js.map +1 -0
  184. package/dist/chunk-B4ECJJ5C.mjs +7 -0
  185. package/dist/chunk-B4ECJJ5C.mjs.map +1 -0
  186. package/dist/chunk-BONB66A2.mjs +14 -0
  187. package/dist/chunk-BONB66A2.mjs.map +1 -0
  188. package/dist/chunk-CQ6CGSKZ.js +35 -0
  189. package/dist/chunk-CQ6CGSKZ.js.map +1 -0
  190. package/dist/chunk-D42BBXBM.mjs +28 -0
  191. package/dist/chunk-D42BBXBM.mjs.map +1 -0
  192. package/dist/chunk-DMH4NSLF.js +1 -0
  193. package/dist/chunk-DMH4NSLF.js.map +1 -0
  194. package/dist/chunk-DNTK4U5M.js +4300 -0
  195. package/dist/chunk-DNTK4U5M.js.map +1 -0
  196. package/dist/chunk-DY4ELDRQ.js +176 -0
  197. package/dist/chunk-DY4ELDRQ.js.map +1 -0
  198. package/dist/chunk-EJ52BDLB.js +55 -0
  199. package/dist/chunk-EJ52BDLB.js.map +1 -0
  200. package/dist/chunk-EQWVJX6K.mjs +91 -0
  201. package/dist/chunk-EQWVJX6K.mjs.map +1 -0
  202. package/dist/chunk-FFQNSBPU.js +31 -0
  203. package/dist/chunk-FFQNSBPU.js.map +1 -0
  204. package/dist/chunk-G52DNXFH.mjs +1 -0
  205. package/dist/chunk-G52DNXFH.mjs.map +1 -0
  206. package/dist/chunk-GETQWOTI.js +1 -0
  207. package/dist/chunk-GETQWOTI.js.map +1 -0
  208. package/dist/chunk-GFAESVZA.js +48 -0
  209. package/dist/chunk-GFAESVZA.js.map +1 -0
  210. package/dist/chunk-HPUQYDVC.js +1 -0
  211. package/dist/chunk-HPUQYDVC.js.map +1 -0
  212. package/dist/chunk-IDO4JFV5.mjs +1 -0
  213. package/dist/chunk-IDO4JFV5.mjs.map +1 -0
  214. package/dist/chunk-IKWNHNJQ.mjs +8 -0
  215. package/dist/chunk-IKWNHNJQ.mjs.map +1 -0
  216. package/dist/chunk-IOMDG67D.mjs +7 -0
  217. package/dist/chunk-IOMDG67D.mjs.map +1 -0
  218. package/dist/chunk-IPI7BAW3.js +1 -0
  219. package/dist/chunk-IPI7BAW3.js.map +1 -0
  220. package/dist/chunk-JLHFZ2UG.mjs +31 -0
  221. package/dist/chunk-JLHFZ2UG.mjs.map +1 -0
  222. package/dist/chunk-JQ7WKFCI.mjs +1 -0
  223. package/dist/chunk-JQ7WKFCI.mjs.map +1 -0
  224. package/dist/chunk-KTQP5UDT.mjs +4300 -0
  225. package/dist/chunk-KTQP5UDT.mjs.map +1 -0
  226. package/dist/chunk-LYEXYTOI.js +14 -0
  227. package/dist/chunk-LYEXYTOI.js.map +1 -0
  228. package/dist/chunk-NJBJIZLR.js +93 -0
  229. package/dist/chunk-NJBJIZLR.js.map +1 -0
  230. package/dist/chunk-NMLYB3XT.js +149 -0
  231. package/dist/chunk-NMLYB3XT.js.map +1 -0
  232. package/dist/chunk-ODI2BTKS.mjs +55 -0
  233. package/dist/chunk-ODI2BTKS.mjs.map +1 -0
  234. package/dist/chunk-OUPWMPLU.mjs +214 -0
  235. package/dist/chunk-OUPWMPLU.mjs.map +1 -0
  236. package/dist/chunk-PGMXFZ6Y.js +207 -0
  237. package/dist/chunk-PGMXFZ6Y.js.map +1 -0
  238. package/dist/chunk-PIZCE3JD.js +243 -0
  239. package/dist/chunk-PIZCE3JD.js.map +1 -0
  240. package/dist/chunk-PNCS6GEX.mjs +1 -0
  241. package/dist/chunk-PNCS6GEX.mjs.map +1 -0
  242. package/dist/chunk-PROWNV4M.js +1 -0
  243. package/dist/chunk-PROWNV4M.js.map +1 -0
  244. package/dist/chunk-QB5IFRLA.mjs +1 -0
  245. package/dist/chunk-QB5IFRLA.mjs.map +1 -0
  246. package/dist/chunk-QTK2RMF7.mjs +29 -0
  247. package/dist/chunk-QTK2RMF7.mjs.map +1 -0
  248. package/dist/chunk-RAUV5UV4.mjs +1 -0
  249. package/dist/chunk-RAUV5UV4.mjs.map +1 -0
  250. package/dist/chunk-RQWUD2FB.mjs +48 -0
  251. package/dist/chunk-RQWUD2FB.mjs.map +1 -0
  252. package/dist/chunk-SMKJEA45.mjs +243 -0
  253. package/dist/chunk-SMKJEA45.mjs.map +1 -0
  254. package/dist/chunk-SSWX2N73.mjs +207 -0
  255. package/dist/chunk-SSWX2N73.mjs.map +1 -0
  256. package/dist/chunk-TLX5QQK5.js +9 -0
  257. package/dist/chunk-TLX5QQK5.js.map +1 -0
  258. package/dist/chunk-TT56I53C.mjs +149 -0
  259. package/dist/chunk-TT56I53C.mjs.map +1 -0
  260. package/dist/chunk-U74Q3BRP.mjs +1 -0
  261. package/dist/chunk-U74Q3BRP.mjs.map +1 -0
  262. package/dist/chunk-UIRZIKC3.mjs +187 -0
  263. package/dist/chunk-UIRZIKC3.mjs.map +1 -0
  264. package/dist/chunk-UPVIT75F.js +29 -0
  265. package/dist/chunk-UPVIT75F.js.map +1 -0
  266. package/dist/chunk-V46WVGWN.js +70 -0
  267. package/dist/chunk-V46WVGWN.js.map +1 -0
  268. package/dist/chunk-V5HMYDWE.js +1 -0
  269. package/dist/chunk-V5HMYDWE.js.map +1 -0
  270. package/dist/chunk-VC6J62JI.mjs +176 -0
  271. package/dist/chunk-VC6J62JI.mjs.map +1 -0
  272. package/dist/chunk-VE4DTN4R.mjs +35 -0
  273. package/dist/chunk-VE4DTN4R.mjs.map +1 -0
  274. package/dist/chunk-VOZ7Y2OO.js +187 -0
  275. package/dist/chunk-VOZ7Y2OO.js.map +1 -0
  276. package/dist/chunk-WRYFIWNK.js +1 -0
  277. package/dist/chunk-WRYFIWNK.js.map +1 -0
  278. package/dist/chunk-XNBTOK6G.js +802 -0
  279. package/dist/chunk-XNBTOK6G.js.map +1 -0
  280. package/dist/chunk-XZEVRYUE.js +1 -0
  281. package/dist/chunk-XZEVRYUE.js.map +1 -0
  282. package/dist/chunk-ZBNBZN5H.js +1 -0
  283. package/dist/chunk-ZBNBZN5H.js.map +1 -0
  284. package/dist/chunk-ZMNXLHAC.js +91 -0
  285. package/dist/chunk-ZMNXLHAC.js.map +1 -0
  286. package/dist/chunk-ZV3DFBO4.js +1 -0
  287. package/dist/chunk-ZV3DFBO4.js.map +1 -0
  288. package/dist/index.js +43 -0
  289. package/dist/index.js.map +1 -0
  290. package/dist/index.mjs +43 -0
  291. package/dist/index.mjs.map +1 -0
  292. package/dist/tsconfig.build.tsbuildinfo +1 -0
  293. package/dist/types/NotificationServicesController/NotificationServicesController.d.ts +222 -0
  294. package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +1 -0
  295. package/dist/types/NotificationServicesController/__fixtures__/index.d.ts +7 -0
  296. package/dist/types/NotificationServicesController/__fixtures__/index.d.ts.map +1 -0
  297. package/dist/types/NotificationServicesController/__fixtures__/mock-feature-announcements.d.ts +15 -0
  298. package/dist/types/NotificationServicesController/__fixtures__/mock-feature-announcements.d.ts.map +1 -0
  299. package/dist/types/NotificationServicesController/__fixtures__/mock-notification-trigger.d.ts +9 -0
  300. package/dist/types/NotificationServicesController/__fixtures__/mock-notification-trigger.d.ts.map +1 -0
  301. package/dist/types/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.ts +35 -0
  302. package/dist/types/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.ts.map +1 -0
  303. package/dist/types/NotificationServicesController/__fixtures__/mock-raw-notifications.d.ts +82 -0
  304. package/dist/types/NotificationServicesController/__fixtures__/mock-raw-notifications.d.ts.map +1 -0
  305. package/dist/types/NotificationServicesController/__fixtures__/mockResponses.d.ts +28 -0
  306. package/dist/types/NotificationServicesController/__fixtures__/mockResponses.d.ts.map +1 -0
  307. package/dist/types/NotificationServicesController/__fixtures__/mockServices.d.ts +12 -0
  308. package/dist/types/NotificationServicesController/__fixtures__/mockServices.d.ts.map +1 -0
  309. package/dist/types/NotificationServicesController/__fixtures__/test-utils.d.ts +14 -0
  310. package/dist/types/NotificationServicesController/__fixtures__/test-utils.d.ts.map +1 -0
  311. package/dist/types/NotificationServicesController/constants/constants.d.ts +3 -0
  312. package/dist/types/NotificationServicesController/constants/constants.d.ts.map +1 -0
  313. package/dist/types/NotificationServicesController/constants/index.d.ts +3 -0
  314. package/dist/types/NotificationServicesController/constants/index.d.ts.map +1 -0
  315. package/dist/types/NotificationServicesController/constants/notification-schema.d.ts +42 -0
  316. package/dist/types/NotificationServicesController/constants/notification-schema.d.ts.map +1 -0
  317. package/dist/types/NotificationServicesController/index.d.ts +6 -0
  318. package/dist/types/NotificationServicesController/index.d.ts.map +1 -0
  319. package/dist/types/NotificationServicesController/processors/index.d.ts +4 -0
  320. package/dist/types/NotificationServicesController/processors/index.d.ts.map +1 -0
  321. package/dist/types/NotificationServicesController/processors/process-feature-announcement.d.ts +19 -0
  322. package/dist/types/NotificationServicesController/processors/process-feature-announcement.d.ts.map +1 -0
  323. package/dist/types/NotificationServicesController/processors/process-notifications.d.ts +19 -0
  324. package/dist/types/NotificationServicesController/processors/process-notifications.d.ts.map +1 -0
  325. package/dist/types/NotificationServicesController/processors/process-onchain-notifications.d.ts +10 -0
  326. package/dist/types/NotificationServicesController/processors/process-onchain-notifications.d.ts.map +1 -0
  327. package/dist/types/NotificationServicesController/services/feature-announcements.d.ts +28 -0
  328. package/dist/types/NotificationServicesController/services/feature-announcements.d.ts.map +1 -0
  329. package/dist/types/NotificationServicesController/services/onchain-notifications.d.ts +62 -0
  330. package/dist/types/NotificationServicesController/services/onchain-notifications.d.ts.map +1 -0
  331. package/dist/types/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts +30 -0
  332. package/dist/types/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts.map +1 -0
  333. package/dist/types/NotificationServicesController/types/feature-announcement/index.d.ts +4 -0
  334. package/dist/types/NotificationServicesController/types/feature-announcement/index.d.ts.map +1 -0
  335. package/dist/types/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts +38 -0
  336. package/dist/types/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts.map +1 -0
  337. package/dist/types/NotificationServicesController/types/feature-announcement/type-links.d.ts +24 -0
  338. package/dist/types/NotificationServicesController/types/feature-announcement/type-links.d.ts.map +1 -0
  339. package/dist/types/NotificationServicesController/types/index.d.ts +5 -0
  340. package/dist/types/NotificationServicesController/types/index.d.ts.map +1 -0
  341. package/dist/types/NotificationServicesController/types/notification/index.d.ts +2 -0
  342. package/dist/types/NotificationServicesController/types/notification/index.d.ts.map +1 -0
  343. package/dist/types/NotificationServicesController/types/notification/notification.d.ts +25 -0
  344. package/dist/types/NotificationServicesController/types/notification/notification.d.ts.map +1 -0
  345. package/dist/types/NotificationServicesController/types/on-chain-notification/index.d.ts +2 -0
  346. package/dist/types/NotificationServicesController/types/on-chain-notification/index.d.ts.map +1 -0
  347. package/dist/types/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.ts +42 -0
  348. package/dist/types/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.ts.map +1 -0
  349. package/dist/types/NotificationServicesController/types/on-chain-notification/schema.d.ts +283 -0
  350. package/dist/types/NotificationServicesController/types/on-chain-notification/schema.d.ts.map +1 -0
  351. package/dist/types/NotificationServicesController/types/type-utils.d.ts +7 -0
  352. package/dist/types/NotificationServicesController/types/type-utils.d.ts.map +1 -0
  353. package/dist/types/NotificationServicesController/types/user-storage/index.d.ts +2 -0
  354. package/dist/types/NotificationServicesController/types/user-storage/index.d.ts.map +1 -0
  355. package/dist/types/NotificationServicesController/types/user-storage/user-storage.d.ts +26 -0
  356. package/dist/types/NotificationServicesController/types/user-storage/user-storage.d.ts.map +1 -0
  357. package/dist/types/NotificationServicesController/utils/utils.d.ts +144 -0
  358. package/dist/types/NotificationServicesController/utils/utils.d.ts.map +1 -0
  359. package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts +103 -0
  360. package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +1 -0
  361. package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts +3 -0
  362. package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts.map +1 -0
  363. package/dist/types/NotificationServicesPushController/__fixtures__/mockResponse.d.ts +43 -0
  364. package/dist/types/NotificationServicesPushController/__fixtures__/mockResponse.d.ts.map +1 -0
  365. package/dist/types/NotificationServicesPushController/__fixtures__/mockServices.d.ts +9 -0
  366. package/dist/types/NotificationServicesPushController/__fixtures__/mockServices.d.ts.map +1 -0
  367. package/dist/types/NotificationServicesPushController/constants.d.ts +11 -0
  368. package/dist/types/NotificationServicesPushController/constants.d.ts.map +1 -0
  369. package/dist/types/NotificationServicesPushController/index.d.ts +5 -0
  370. package/dist/types/NotificationServicesPushController/index.d.ts.map +1 -0
  371. package/dist/types/NotificationServicesPushController/services/endpoints.d.ts +2 -0
  372. package/dist/types/NotificationServicesPushController/services/endpoints.d.ts.map +1 -0
  373. package/dist/types/NotificationServicesPushController/services/push/index.d.ts +6 -0
  374. package/dist/types/NotificationServicesPushController/services/push/index.d.ts.map +1 -0
  375. package/dist/types/NotificationServicesPushController/services/push/push-web.d.ts +32 -0
  376. package/dist/types/NotificationServicesPushController/services/push/push-web.d.ts.map +1 -0
  377. package/dist/types/NotificationServicesPushController/services/services.d.ts +95 -0
  378. package/dist/types/NotificationServicesPushController/services/services.d.ts.map +1 -0
  379. package/dist/types/NotificationServicesPushController/types/firebase.d.ts +53 -0
  380. package/dist/types/NotificationServicesPushController/types/firebase.d.ts.map +1 -0
  381. package/dist/types/NotificationServicesPushController/types/index.d.ts +2 -0
  382. package/dist/types/NotificationServicesPushController/types/index.d.ts.map +1 -0
  383. package/dist/types/NotificationServicesPushController/utils/get-notification-data.d.ts +42 -0
  384. package/dist/types/NotificationServicesPushController/utils/get-notification-data.d.ts.map +1 -0
  385. package/dist/types/NotificationServicesPushController/utils/get-notification-message.d.ts +67 -0
  386. package/dist/types/NotificationServicesPushController/utils/get-notification-message.d.ts.map +1 -0
  387. package/dist/types/NotificationServicesPushController/utils/index.d.ts +3 -0
  388. package/dist/types/NotificationServicesPushController/utils/index.d.ts.map +1 -0
  389. package/dist/types/index.d.ts +3 -0
  390. package/dist/types/index.d.ts.map +1 -0
  391. package/package.json +80 -0
@@ -0,0 +1,222 @@
1
+ import type { RestrictedControllerMessenger, ControllerGetStateAction, ControllerStateChangeEvent } from '@metamask/base-controller';
2
+ import { BaseController } from '@metamask/base-controller';
3
+ import type { KeyringControllerGetAccountsAction, KeyringControllerStateChangeEvent } from '@metamask/keyring-controller';
4
+ import type { AuthenticationController, UserStorageController } from '@metamask/profile-sync-controller';
5
+ import type { INotification, MarkAsReadNotificationsParam } from './types/notification/notification';
6
+ import type { UserStorage } from './types/user-storage/user-storage';
7
+ export type NotificationServicesPushControllerEnablePushNotifications = {
8
+ type: `NotificationServicesPushController:enablePushNotifications`;
9
+ handler: (UUIDs: string[]) => Promise<void>;
10
+ };
11
+ export type NotificationServicesPushControllerDisablePushNotifications = {
12
+ type: `NotificationServicesPushController:disablePushNotifications`;
13
+ handler: (UUIDs: string[]) => Promise<void>;
14
+ };
15
+ export type NotificationServicesPushControllerUpdateTriggerPushNotifications = {
16
+ type: `NotificationServicesPushController:updateTriggerPushNotifications`;
17
+ handler: (UUIDs: string[]) => Promise<void>;
18
+ };
19
+ export type NotificationServicesPushControllerOnNewNotification = {
20
+ type: `NotificationServicesPushController:onNewNotifications`;
21
+ payload: [INotification];
22
+ };
23
+ declare const controllerName = "NotificationServicesController";
24
+ /**
25
+ * State shape for NotificationServicesController
26
+ */
27
+ export type NotificationServicesControllerState = {
28
+ /**
29
+ * We store and manage accounts that have been seen/visted through the
30
+ * account subscription. This allows us to track and add notifications for new accounts and not previous accounts added.
31
+ */
32
+ subscriptionAccountsSeen: string[];
33
+ /**
34
+ * Flag that indicates if the metamask notifications feature has been seen
35
+ */
36
+ isMetamaskNotificationsFeatureSeen: boolean;
37
+ /**
38
+ * Flag that indicates if the metamask notifications are enabled
39
+ */
40
+ isNotificationServicesEnabled: boolean;
41
+ /**
42
+ * Flag that indicates if the feature announcements are enabled
43
+ */
44
+ isFeatureAnnouncementsEnabled: boolean;
45
+ /**
46
+ * List of metamask notifications
47
+ */
48
+ metamaskNotificationsList: INotification[];
49
+ /**
50
+ * List of read metamask notifications
51
+ */
52
+ metamaskNotificationsReadList: string[];
53
+ /**
54
+ * Flag that indicates that the creating notifications is in progress
55
+ */
56
+ isUpdatingMetamaskNotifications: boolean;
57
+ /**
58
+ * Flag that indicates that the fetching notifications is in progress
59
+ * This is used to show a loading spinner in the UI
60
+ * when fetching notifications
61
+ */
62
+ isFetchingMetamaskNotifications: boolean;
63
+ /**
64
+ * Flag that indicates that the updating notifications for a specific address is in progress
65
+ */
66
+ isUpdatingMetamaskNotificationsAccount: string[];
67
+ /**
68
+ * Flag that indicates that the checking accounts presence is in progress
69
+ */
70
+ isCheckingAccountsPresence: boolean;
71
+ };
72
+ export declare const defaultState: NotificationServicesControllerState;
73
+ export type NotificationServicesControllerUpdateMetamaskNotificationsList = {
74
+ type: `${typeof controllerName}:updateMetamaskNotificationsList`;
75
+ handler: NotificationServicesController['updateMetamaskNotificationsList'];
76
+ };
77
+ export type NotificationServicesControllerDisableNotificationServices = {
78
+ type: `${typeof controllerName}:disableNotificationServices`;
79
+ handler: NotificationServicesController['disableNotificationServices'];
80
+ };
81
+ export type NotificationServicesControllerSelectIsNotificationServicesEnabled = {
82
+ type: `${typeof controllerName}:selectIsNotificationServicesEnabled`;
83
+ handler: NotificationServicesController['selectIsNotificationServicesEnabled'];
84
+ };
85
+ export type Actions = NotificationServicesControllerUpdateMetamaskNotificationsList | NotificationServicesControllerDisableNotificationServices | NotificationServicesControllerSelectIsNotificationServicesEnabled | ControllerGetStateAction<'state', NotificationServicesControllerState>;
86
+ export type AllowedActions = KeyringControllerGetAccountsAction | AuthenticationController.AuthenticationControllerGetBearerToken | AuthenticationController.AuthenticationControllerIsSignedIn | UserStorageController.UserStorageControllerEnableProfileSyncing | UserStorageController.UserStorageControllerGetStorageKey | UserStorageController.UserStorageControllerPerformGetStorage | UserStorageController.UserStorageControllerPerformSetStorage | NotificationServicesPushControllerEnablePushNotifications | NotificationServicesPushControllerDisablePushNotifications | NotificationServicesPushControllerUpdateTriggerPushNotifications;
87
+ export type NotificationServicesControllerMessengerEvents = ControllerStateChangeEvent<typeof controllerName, NotificationServicesControllerState>;
88
+ export type AllowedEvents = KeyringControllerStateChangeEvent | NotificationServicesPushControllerOnNewNotification;
89
+ export type NotificationServicesControllerMessenger = RestrictedControllerMessenger<typeof controllerName, Actions | AllowedActions, AllowedEvents, AllowedActions['type'], AllowedEvents['type']>;
90
+ type FeatureAnnouncementEnv = {
91
+ spaceId: string;
92
+ accessToken: string;
93
+ platform: 'extension' | 'mobile';
94
+ };
95
+ /**
96
+ * Controller that enables wallet notifications and feature announcements
97
+ */
98
+ export declare class NotificationServicesController extends BaseController<typeof controllerName, NotificationServicesControllerState, NotificationServicesControllerMessenger> {
99
+ #private;
100
+ /**
101
+ * Creates a NotificationServicesController instance.
102
+ *
103
+ * @param args - The arguments to this function.
104
+ * @param args.messenger - Messenger used to communicate with BaseV2 controller.
105
+ * @param args.state - Initial state to set on this controller.
106
+ * @param args.env - environment variables for a given controller.
107
+ * @param args.env.featureAnnouncements - env variables for feature announcements.
108
+ */
109
+ constructor({ messenger, state, env, }: {
110
+ messenger: NotificationServicesControllerMessenger;
111
+ state?: Partial<NotificationServicesControllerState>;
112
+ env: {
113
+ featureAnnouncements: FeatureAnnouncementEnv;
114
+ };
115
+ });
116
+ /**
117
+ * Retrieves the current enabled state of MetaMask notifications.
118
+ *
119
+ * This method directly returns the boolean value of `isMetamaskNotificationsEnabled`
120
+ * from the controller's state, indicating whether MetaMask notifications are currently enabled.
121
+ *
122
+ * @returns The enabled state of MetaMask notifications.
123
+ */
124
+ selectIsNotificationServicesEnabled(): boolean;
125
+ checkAccountsPresence(accounts: string[]): Promise<Record<string, boolean>>;
126
+ /**
127
+ * Sets the enabled state of feature announcements.
128
+ *
129
+ * **Action** - used in the notification settings to enable/disable feature announcements.
130
+ *
131
+ * @param featureAnnouncementsEnabled - A boolean value indicating the desired enabled state of the feature announcements.
132
+ * @async
133
+ * @throws {Error} If fails to update
134
+ */
135
+ setFeatureAnnouncementsEnabled(featureAnnouncementsEnabled: boolean): Promise<void>;
136
+ /**
137
+ * This creates/re-creates on-chain triggers defined in User Storage.
138
+ *
139
+ * **Action** - Used during Sign In / Enabling of notifications.
140
+ *
141
+ * @returns The updated or newly created user storage.
142
+ * @throws {Error} Throws an error if unauthenticated or from other operations.
143
+ */
144
+ createOnChainTriggers(): Promise<UserStorage>;
145
+ /**
146
+ * Enables all MetaMask notifications for the user.
147
+ * This is identical flow when initializing notifications for the first time.
148
+ * 1. Enable Profile Syncing
149
+ * 2. Get or Create Notification User Storage
150
+ * 3. Upsert Triggers
151
+ * 4. Update Push notifications
152
+ *
153
+ * @throws {Error} If there is an error during the process of enabling notifications.
154
+ */
155
+ enableMetamaskNotifications(): Promise<void>;
156
+ /**
157
+ * Disables all MetaMask notifications for the user.
158
+ * This method ensures that the user is authenticated, retrieves all linked accounts,
159
+ * and disables on-chain triggers for each account. It also sets the global notification
160
+ * settings for MetaMask, feature announcements to false.
161
+ *
162
+ * @throws {Error} If the user is not authenticated or if there is an error during the process.
163
+ */
164
+ disableNotificationServices(): Promise<void>;
165
+ /**
166
+ * Deletes on-chain triggers associated with a specific account.
167
+ * This method performs several key operations:
168
+ * 1. Validates Auth & Storage
169
+ * 2. Finds and deletes all triggers associated with the account
170
+ * 3. Disables any related push notifications
171
+ * 4. Updates Storage to reflect new state.
172
+ *
173
+ * **Action** - When a user disables notifications for a given account in settings.
174
+ *
175
+ * @param accounts - The account for which on-chain triggers are to be deleted.
176
+ * @returns A promise that resolves to void or an object containing a success message.
177
+ * @throws {Error} Throws an error if unauthenticated or from other operations.
178
+ */
179
+ deleteOnChainTriggersByAccount(accounts: string[]): Promise<UserStorage>;
180
+ /**
181
+ * Updates/Creates on-chain triggers for a specific account.
182
+ *
183
+ * This method performs several key operations:
184
+ * 1. Validates Auth & Storage
185
+ * 2. Finds and creates any missing triggers associated with the account
186
+ * 3. Enables any related push notifications
187
+ * 4. Updates Storage to reflect new state.
188
+ *
189
+ * **Action** - When a user enables notifications for an account
190
+ *
191
+ * @param accounts - List of accounts you want to update.
192
+ * @returns A promise that resolves to the updated user storage.
193
+ * @throws {Error} Throws an error if unauthenticated or from other operations.
194
+ */
195
+ updateOnChainTriggersByAccount(accounts: string[]): Promise<UserStorage>;
196
+ /**
197
+ * Fetches the list of metamask notifications.
198
+ * This includes OnChain notifications and Feature Announcements.
199
+ *
200
+ * **Action** - When a user views the notification list page/dropdown
201
+ *
202
+ * @throws {Error} Throws an error if unauthenticated or from other operations.
203
+ */
204
+ fetchAndUpdateMetamaskNotifications(): Promise<INotification[]>;
205
+ /**
206
+ * Marks specified metamask notifications as read.
207
+ *
208
+ * @param notifications - An array of notifications to be marked as read. Each notification should include its type and read status.
209
+ * @returns A promise that resolves when the operation is complete.
210
+ */
211
+ markMetamaskNotificationsAsRead(notifications: MarkAsReadNotificationsParam): Promise<void>;
212
+ /**
213
+ * Updates the list of MetaMask notifications by adding a new notification at the beginning of the list.
214
+ * This method ensures that the most recent notification is displayed first in the UI.
215
+ *
216
+ * @param notification - The new notification object to be added to the list.
217
+ * @returns A promise that resolves when the notification list has been successfully updated.
218
+ */
219
+ updateMetamaskNotificationsList(notification: INotification): Promise<void>;
220
+ }
221
+ export {};
222
+ //# sourceMappingURL=NotificationServicesController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationServicesController.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/NotificationServicesController.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,7 @@
1
+ export * from './mock-feature-announcements';
2
+ export * from './mock-notification-trigger';
3
+ export * from './mock-notification-user-storage';
4
+ export * from './mock-raw-notifications';
5
+ export * from './mockResponses';
6
+ export * from './mockServices';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/__fixtures__/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,kCAAkC,CAAC;AACjD,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { ContentfulResult } from '../services/feature-announcements';
2
+ import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';
3
+ /**
4
+ * Mocking Utility - create a mock normalized feature announcement
5
+ *
6
+ * @returns Mock Normalized Feature Announcement
7
+ */
8
+ export declare function createMockFeatureAnnouncementAPIResult(): ContentfulResult;
9
+ /**
10
+ * Mocking Utility - create a mock raw feature announcement
11
+ *
12
+ * @returns Mock Raw Feature Announcement
13
+ */
14
+ export declare function createMockFeatureAnnouncementRaw(): FeatureAnnouncementRawNotification;
15
+ //# sourceMappingURL=mock-feature-announcements.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-feature-announcements.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/__fixtures__/mock-feature-announcements.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,oDAAoD,CAAC;AAE7G;;;;GAIG;AACH,wBAAgB,sCAAsC,IAAI,gBAAgB,CA4KzE;AAED;;;;GAIG;AACH,wBAAgB,gCAAgC,IAAI,kCAAkC,CAsBrF"}
@@ -0,0 +1,9 @@
1
+ import type { NotificationTrigger } from '../utils/utils';
2
+ /**
3
+ * Mocking Utility - create a mock Notification Trigger
4
+ *
5
+ * @param override - provide any override configuration for the mock
6
+ * @returns a mock Notification Trigger
7
+ */
8
+ export declare function createMockNotificationTrigger(override?: Partial<NotificationTrigger>): NotificationTrigger;
9
+ //# sourceMappingURL=mock-notification-trigger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-notification-trigger.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/__fixtures__/mock-notification-trigger.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC,mBAAmB,CAAC,GACtC,mBAAmB,CASrB"}
@@ -0,0 +1,35 @@
1
+ import { TRIGGER_TYPES } from '../constants/notification-schema';
2
+ import type { UserStorage } from '../types/user-storage/user-storage';
3
+ export declare const MOCK_USER_STORAGE_ACCOUNT = "0x0000000000000000000000000000000000000000";
4
+ export declare const MOCK_USER_STORAGE_CHAIN = "1";
5
+ /**
6
+ * Mocking Utility - create a mock notification user storage object
7
+ *
8
+ * @param override - provide any override configuration for the mock
9
+ * @returns a mock notification user storage object
10
+ */
11
+ export declare function createMockUserStorage(override?: Partial<UserStorage>): UserStorage;
12
+ /**
13
+ * Mocking Utility - create a mock notification user storage object with triggers
14
+ *
15
+ * @param triggers - provide any override configuration for the mock
16
+ * @returns a mock notification user storage object with triggers
17
+ */
18
+ export declare function createMockUserStorageWithTriggers(triggers: string[] | {
19
+ id: string;
20
+ e: boolean;
21
+ k?: TRIGGER_TYPES;
22
+ }[]): UserStorage;
23
+ /**
24
+ * Mocking Utility - create a mock notification user storage object (full/realistic object)
25
+ *
26
+ * @param props - provide any override configuration for the mock
27
+ * @param props.triggersEnabled - choose if all triggers created are enabled/disabled
28
+ * @param props.address - choose a specific address for triggers to be assigned to
29
+ * @returns a mock full notification user storage object
30
+ */
31
+ export declare function createMockFullUserStorage(props?: {
32
+ triggersEnabled?: boolean;
33
+ address?: string;
34
+ }): UserStorage;
35
+ //# sourceMappingURL=mock-notification-user-storage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-notification-user-storage.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/__fixtures__/mock-notification-user-storage.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAGtE,eAAO,MAAM,yBAAyB,+CACQ,CAAC;AAC/C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAC9B,WAAW,CAiBb;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,MAAM,EAAE,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,OAAO,CAAC;IAAC,CAAC,CAAC,EAAE,aAAa,CAAA;CAAE,EAAE,GACnE,WAAW,CA8Bb;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,GAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAC1D,WAAW,CAKb"}
@@ -0,0 +1,82 @@
1
+ import type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';
2
+ /**
3
+ * Mocking Utility - create a mock Eth sent notification
4
+ * @returns Mock raw Eth sent notification
5
+ */
6
+ export declare function createMockNotificationEthSent(): OnChainRawNotification;
7
+ /**
8
+ * Mocking Utility - create a mock Eth Received notification
9
+ * @returns Mock raw Eth Received notification
10
+ */
11
+ export declare function createMockNotificationEthReceived(): OnChainRawNotification;
12
+ /**
13
+ * Mocking Utility - create a mock ERC20 sent notification
14
+ * @returns Mock raw ERC20 sent notification
15
+ */
16
+ export declare function createMockNotificationERC20Sent(): OnChainRawNotification;
17
+ /**
18
+ * Mocking Utility - create a mock ERC20 received notification
19
+ * @returns Mock raw ERC20 received notification
20
+ */
21
+ export declare function createMockNotificationERC20Received(): OnChainRawNotification;
22
+ /**
23
+ * Mocking Utility - create a mock ERC721 sent notification
24
+ * @returns Mock raw ERC721 sent notification
25
+ */
26
+ export declare function createMockNotificationERC721Sent(): OnChainRawNotification;
27
+ /**
28
+ * Mocking Utility - create a mock ERC721 received notification
29
+ * @returns Mock raw ERC721 received notification
30
+ */
31
+ export declare function createMockNotificationERC721Received(): OnChainRawNotification;
32
+ /**
33
+ * Mocking Utility - create a mock ERC1155 sent notification
34
+ * @returns Mock raw ERC1155 sent notification
35
+ */
36
+ export declare function createMockNotificationERC1155Sent(): OnChainRawNotification;
37
+ /**
38
+ * Mocking Utility - create a mock ERC1155 received notification
39
+ * @returns Mock raw ERC1155 received notification
40
+ */
41
+ export declare function createMockNotificationERC1155Received(): OnChainRawNotification;
42
+ /**
43
+ * Mocking Utility - create a mock MetaMask Swaps notification
44
+ * @returns Mock raw MetaMask Swaps notification
45
+ */
46
+ export declare function createMockNotificationMetaMaskSwapsCompleted(): OnChainRawNotification;
47
+ /**
48
+ * Mocking Utility - create a mock RocketPool Stake Completed notification
49
+ * @returns Mock raw RocketPool Stake Completed notification
50
+ */
51
+ export declare function createMockNotificationRocketPoolStakeCompleted(): OnChainRawNotification;
52
+ /**
53
+ * Mocking Utility - create a mock RocketPool Un-staked notification
54
+ * @returns Mock raw RocketPool Un-staked notification
55
+ */
56
+ export declare function createMockNotificationRocketPoolUnStakeCompleted(): OnChainRawNotification;
57
+ /**
58
+ * Mocking Utility - create a mock Lido Stake Completed notification
59
+ * @returns Mock raw Lido Stake Completed notification
60
+ */
61
+ export declare function createMockNotificationLidoStakeCompleted(): OnChainRawNotification;
62
+ /**
63
+ * Mocking Utility - create a mock Lido Withdrawal Requested notification
64
+ * @returns Mock raw Lido Withdrawal Requested notification
65
+ */
66
+ export declare function createMockNotificationLidoWithdrawalRequested(): OnChainRawNotification;
67
+ /**
68
+ * Mocking Utility - create a mock Lido Withdrawal Completed notification
69
+ * @returns Mock raw Lido Withdrawal Completed notification
70
+ */
71
+ export declare function createMockNotificationLidoWithdrawalCompleted(): OnChainRawNotification;
72
+ /**
73
+ * Mocking Utility - create a mock Lido Withdrawal Ready notification
74
+ * @returns Mock raw Lido Withdrawal Ready notification
75
+ */
76
+ export declare function createMockNotificationLidoReadyToBeWithdrawn(): OnChainRawNotification;
77
+ /**
78
+ * Mocking Utility - creates an array of raw on-chain notifications
79
+ * @returns Array of raw on-chain notifications
80
+ */
81
+ export declare function createMockRawOnChainNotifications(): OnChainRawNotification[];
82
+ //# sourceMappingURL=mock-raw-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-raw-notifications.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/__fixtures__/mock-raw-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAEnG;;;GAGG;AACH,wBAAgB,6BAA6B,IAAI,sBAAsB,CA4BtE;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,IAAI,sBAAsB,CA4B1E;AAED;;;GAGG;AACH,wBAAgB,+BAA+B,IAAI,sBAAsB,CAkCxE;AAED;;;GAGG;AACH,wBAAgB,mCAAmC,IAAI,sBAAsB,CAkC5E;AAED;;;GAGG;AACH,wBAAgB,gCAAgC,IAAI,sBAAsB,CAsCzE;AAED;;;GAGG;AACH,wBAAgB,oCAAoC,IAAI,sBAAsB,CAsC7E;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,IAAI,sBAAsB,CAsC1E;AAED;;;GAGG;AACH,wBAAgB,qCAAqC,IAAI,sBAAsB,CAsC9E;AAED;;;GAGG;AACH,wBAAgB,4CAA4C,IAAI,sBAAsB,CA4CrF;AAED;;;GAGG;AACH,wBAAgB,8CAA8C,IAAI,sBAAsB,CA2CvF;AAED;;;GAGG;AACH,wBAAgB,gDAAgD,IAAI,sBAAsB,CA2CzF;AAED;;;GAGG;AACH,wBAAgB,wCAAwC,IAAI,sBAAsB,CA2CjF;AAED;;;GAGG;AACH,wBAAgB,6CAA6C,IAAI,sBAAsB,CA2CtF;AAED;;;GAGG;AACH,wBAAgB,6CAA6C,IAAI,sBAAsB,CA2CtF;AAED;;;GAGG;AACH,wBAAgB,4CAA4C,IAAI,sBAAsB,CA8BrF;AAED;;;GAGG;AACH,wBAAgB,iCAAiC,IAAI,sBAAsB,EAAE,CAM5E"}
@@ -0,0 +1,28 @@
1
+ export declare const CONTENTFUL_RESPONSE: import("../services/feature-announcements").ContentfulResult;
2
+ export declare const getMockFeatureAnnouncementResponse: () => {
3
+ url: string;
4
+ requestMethod: "GET";
5
+ response: import("../services/feature-announcements").ContentfulResult;
6
+ };
7
+ export declare const getMockBatchCreateTriggersResponse: () => {
8
+ url: string;
9
+ requestMethod: "POST";
10
+ response: null;
11
+ };
12
+ export declare const getMockBatchDeleteTriggersResponse: () => {
13
+ url: string;
14
+ requestMethod: "DELETE";
15
+ response: null;
16
+ };
17
+ export declare const MOCK_RAW_ON_CHAIN_NOTIFICATIONS: import("../types").OnChainRawNotification[];
18
+ export declare const getMockListNotificationsResponse: () => {
19
+ url: string;
20
+ requestMethod: "POST";
21
+ response: import("../types").OnChainRawNotification[];
22
+ };
23
+ export declare const getMockMarkNotificationsAsReadResponse: () => {
24
+ url: string;
25
+ requestMethod: "POST";
26
+ response: null;
27
+ };
28
+ //# sourceMappingURL=mockResponses.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockResponses.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/__fixtures__/mockResponses.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,mBAAmB,8DAA2C,CAAC;AAE5E,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,+BAA+B,6CACP,CAAC;AAEtC,eAAO,MAAM,gCAAgC;;;;CAM5C,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;CAMlD,CAAC"}
@@ -0,0 +1,12 @@
1
+ import nock from 'nock';
2
+ type MockReply = {
3
+ status: nock.StatusCode;
4
+ body?: nock.Body;
5
+ };
6
+ export declare const mockFetchFeatureAnnouncementNotifications: (mockReply?: MockReply) => nock.Scope;
7
+ export declare const mockBatchCreateTriggers: (mockReply?: MockReply) => nock.Scope;
8
+ export declare const mockBatchDeleteTriggers: (mockReply?: MockReply) => nock.Scope;
9
+ export declare const mockListNotifications: (mockReply?: MockReply) => nock.Scope;
10
+ export declare const mockMarkNotificationsAsRead: (mockReply?: MockReply) => nock.Scope;
11
+ export {};
12
+ //# sourceMappingURL=mockServices.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockServices.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/__fixtures__/mockServices.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAUxB,KAAK,SAAS,GAAG;IACf,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC;IACxB,IAAI,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,yCAAyC,eACxC,SAAS,eAUtB,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAAgB,SAAS,eAS5D,CAAC;AAEF,eAAO,MAAM,uBAAuB,eAAgB,SAAS,eAS5D,CAAC;AAEF,eAAO,MAAM,qBAAqB,eAAgB,SAAS,eAU1D,CAAC;AAEF,eAAO,MAAM,2BAA2B,eAAgB,SAAS,eAShE,CAAC"}
@@ -0,0 +1,14 @@
1
+ type WaitForOptions = {
2
+ intervalMs?: number;
3
+ timeoutMs?: number;
4
+ };
5
+ /**
6
+ * Testing Utility - waitFor. Waits for and checks (at an interval) if assertion is reached.
7
+ *
8
+ * @param assertionFn - assertion function
9
+ * @param options - set wait for options
10
+ * @returns promise that you need to await in tests
11
+ */
12
+ export declare const waitFor: (assertionFn: () => void, options?: WaitForOptions) => Promise<void>;
13
+ export {};
14
+ //# sourceMappingURL=test-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/__fixtures__/test-utils.ts"],"names":[],"mappings":"AAAA,KAAK,cAAc,GAAG;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,gBACL,MAAM,IAAI,YACd,cAAc,KACtB,QAAQ,IAAI,CAmBd,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const USER_STORAGE_VERSION = "1";
2
+ export declare const USER_STORAGE_VERSION_KEY: unique symbol;
3
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/constants/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAGxC,eAAO,MAAM,wBAAwB,EAAE,OAAO,MAAqB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './constants';
2
+ export * from './notification-schema';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,42 @@
1
+ export declare enum TRIGGER_TYPES {
2
+ FEATURES_ANNOUNCEMENT = "features_announcement",
3
+ METAMASK_SWAP_COMPLETED = "metamask_swap_completed",
4
+ ERC20_SENT = "erc20_sent",
5
+ ERC20_RECEIVED = "erc20_received",
6
+ ETH_SENT = "eth_sent",
7
+ ETH_RECEIVED = "eth_received",
8
+ ROCKETPOOL_STAKE_COMPLETED = "rocketpool_stake_completed",
9
+ ROCKETPOOL_UNSTAKE_COMPLETED = "rocketpool_unstake_completed",
10
+ LIDO_STAKE_COMPLETED = "lido_stake_completed",
11
+ LIDO_WITHDRAWAL_REQUESTED = "lido_withdrawal_requested",
12
+ LIDO_WITHDRAWAL_COMPLETED = "lido_withdrawal_completed",
13
+ LIDO_STAKE_READY_TO_BE_WITHDRAWN = "lido_stake_ready_to_be_withdrawn",
14
+ ERC721_SENT = "erc721_sent",
15
+ ERC721_RECEIVED = "erc721_received",
16
+ ERC1155_SENT = "erc1155_sent",
17
+ ERC1155_RECEIVED = "erc1155_received"
18
+ }
19
+ export declare const TRIGGER_TYPES_WALLET_SET: Set<string>;
20
+ export declare enum TRIGGER_TYPES_GROUPS {
21
+ RECEIVED = "received",
22
+ SENT = "sent",
23
+ DEFI = "defi"
24
+ }
25
+ export declare const NOTIFICATION_CHAINS: {
26
+ ETHEREUM: string;
27
+ OPTIMISM: string;
28
+ BSC: string;
29
+ POLYGON: string;
30
+ ARBITRUM: string;
31
+ AVALANCHE: string;
32
+ LINEA: string;
33
+ };
34
+ export declare const CHAIN_SYMBOLS: {
35
+ [x: string]: string;
36
+ };
37
+ export declare const SUPPORTED_CHAINS: string[];
38
+ export type Trigger = {
39
+ supported_chains: (typeof SUPPORTED_CHAINS)[number][];
40
+ };
41
+ export declare const TRIGGERS: Partial<Record<TRIGGER_TYPES, Trigger>>;
42
+ //# sourceMappingURL=notification-schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notification-schema.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/constants/notification-schema.ts"],"names":[],"mappings":"AACA,oBAAY,aAAa;IACvB,qBAAqB,0BAA0B;IAC/C,uBAAuB,4BAA4B;IACnD,UAAU,eAAe;IACzB,cAAc,mBAAmB;IACjC,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,0BAA0B,+BAA+B;IACzD,4BAA4B,iCAAiC;IAC7D,oBAAoB,yBAAyB;IAC7C,yBAAyB,8BAA8B;IACvD,yBAAyB,8BAA8B;IACvD,gCAAgC,qCAAqC;IACrE,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;CACtC;AAED,eAAO,MAAM,wBAAwB,EAAE,GAAG,CAAC,MAAM,CAgB4B,CAAC;AAE9E,oBAAY,oBAAoB;IAC9B,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,eAAO,MAAM,mBAAmB;;;;;;;;CAQ/B,CAAC;AAEF,eAAO,MAAM,aAAa;;CAQzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,UAQ5B,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,gBAAgB,EAAE,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;CACvD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,CAAC,CA8F5D,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './NotificationServicesController';
2
+ export * as Types from './types';
3
+ export * as Mocks from './__fixtures__';
4
+ export * as Processors from './processors';
5
+ export * as Constants from './constants';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/NotificationServicesController/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,OAAO,KAAK,KAAK,MAAM,SAAS,CAAC;AACjC,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './process-feature-announcement';
2
+ export * from './process-notifications';
3
+ export * from './process-onchain-notifications';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';
2
+ import type { INotification } from '../types/notification/notification';
3
+ /**
4
+ * Checks if a feature announcement should be read.
5
+ * Checks feature announcement state (from param), as well as if the notification is "expired"
6
+ *
7
+ * @param notification - notification to check
8
+ * @param readPlatformNotificationsList - list of read notifications
9
+ * @returns boolean if notification should be marked as read or unread
10
+ */
11
+ export declare function isFeatureAnnouncementRead(notification: Pick<INotification, 'id' | 'createdAt'>, readPlatformNotificationsList: string[]): boolean;
12
+ /**
13
+ * Processes a feature announcement into a shared/normalised notification shape.
14
+ *
15
+ * @param notification - raw feature announcement
16
+ * @returns a normalised feature announcement
17
+ */
18
+ export declare function processFeatureAnnouncement(notification: FeatureAnnouncementRawNotification): INotification;
19
+ //# sourceMappingURL=process-feature-announcement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-feature-announcement.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,MAAM,oDAAoD,CAAC;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAUxE;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,EACrD,6BAA6B,EAAE,MAAM,EAAE,GACtC,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kCAAkC,GAC/C,aAAa,CAQf"}
@@ -0,0 +1,19 @@
1
+ import type { INotification, NotificationUnion } from '../types/notification/notification';
2
+ /**
3
+ * Process feature announcement and wallet notifications into a shared/normalised notification shape.
4
+ * We can still differentiate notifications by the `type` property
5
+ *
6
+ * @param notification - a feature announcement or on chain notification
7
+ * @param readNotifications - all read notifications currently
8
+ * @returns a processed notification
9
+ */
10
+ export declare function processNotification(notification: NotificationUnion, readNotifications?: string[]): INotification;
11
+ /**
12
+ * Safe version of processing a notification. Rather than throwing an error if failed to process, it will return the Notification or undefined
13
+ *
14
+ * @param notification - notification to processes
15
+ * @param readNotifications - all read notifications currently
16
+ * @returns a process notification or undefined if failed to process
17
+ */
18
+ export declare function safeProcessNotification(notification: NotificationUnion, readNotifications?: string[]): INotification | undefined;
19
+ //# sourceMappingURL=process-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-notifications.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/processors/process-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;AAiB5C;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,iBAAiB,EAC/B,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,CAmBf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,iBAAiB,EAC/B,iBAAiB,GAAE,MAAM,EAAO,GAC/B,aAAa,GAAG,SAAS,CAU3B"}
@@ -0,0 +1,10 @@
1
+ import type { INotification } from '../types/notification/notification';
2
+ import type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';
3
+ /**
4
+ * Processes On-Chain notifications to a normalized notification
5
+ *
6
+ * @param notification - On-Chain Notification
7
+ * @returns Normalized Notification
8
+ */
9
+ export declare function processOnChainNotification(notification: OnChainRawNotification): INotification;
10
+ //# sourceMappingURL=process-onchain-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"process-onchain-notifications.d.ts","sourceRoot":"","sources":["../../../../src/NotificationServicesController/processors/process-onchain-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sDAAsD,CAAC;AAEnG;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,sBAAsB,GACnC,aAAa,CAOf"}