@metamask-previews/notification-services-controller 26.0.0-preview-0d2cbf546 → 26.0.0-preview-ec4680201

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 (216) hide show
  1. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs.map +1 -1
  2. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.cts.map +1 -1
  3. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.mts.map +1 -1
  4. package/dist/NotificationServicesController/NotificationServicesController-method-action-types.mjs.map +1 -1
  5. package/dist/NotificationServicesController/NotificationServicesController.cjs +20 -20
  6. package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -1
  7. package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -1
  8. package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -1
  9. package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -1
  10. package/dist/NotificationServicesController/constants/index.cjs.map +1 -1
  11. package/dist/NotificationServicesController/constants/index.d.cts.map +1 -1
  12. package/dist/NotificationServicesController/constants/index.d.mts.map +1 -1
  13. package/dist/NotificationServicesController/constants/index.mjs.map +1 -1
  14. package/dist/NotificationServicesController/index.cjs +7 -7
  15. package/dist/NotificationServicesController/index.cjs.map +1 -1
  16. package/dist/NotificationServicesController/index.d.cts.map +1 -1
  17. package/dist/NotificationServicesController/index.d.mts.map +1 -1
  18. package/dist/NotificationServicesController/index.mjs.map +1 -1
  19. package/dist/NotificationServicesController/mocks/index.cjs.map +1 -1
  20. package/dist/NotificationServicesController/mocks/index.d.cts.map +1 -1
  21. package/dist/NotificationServicesController/mocks/index.d.mts.map +1 -1
  22. package/dist/NotificationServicesController/mocks/index.mjs.map +1 -1
  23. package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs +2 -2
  24. package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs.map +1 -1
  25. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.cts.map +1 -1
  26. package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts.map +1 -1
  27. package/dist/NotificationServicesController/mocks/mock-feature-announcements.mjs.map +1 -1
  28. package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs +17 -17
  29. package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs.map +1 -1
  30. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts.map +1 -1
  31. package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts.map +1 -1
  32. package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs.map +1 -1
  33. package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs +2 -2
  34. package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs.map +1 -1
  35. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.cts.map +1 -1
  36. package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts.map +1 -1
  37. package/dist/NotificationServicesController/mocks/mock-snap-notification.mjs.map +1 -1
  38. package/dist/NotificationServicesController/mocks/mockResponses.cjs +12 -12
  39. package/dist/NotificationServicesController/mocks/mockResponses.cjs.map +1 -1
  40. package/dist/NotificationServicesController/mocks/mockResponses.d.cts.map +1 -1
  41. package/dist/NotificationServicesController/mocks/mockResponses.d.mts.map +1 -1
  42. package/dist/NotificationServicesController/mocks/mockResponses.mjs.map +1 -1
  43. package/dist/NotificationServicesController/processors/index.cjs.map +1 -1
  44. package/dist/NotificationServicesController/processors/index.d.cts.map +1 -1
  45. package/dist/NotificationServicesController/processors/index.d.mts.map +1 -1
  46. package/dist/NotificationServicesController/processors/index.mjs.map +1 -1
  47. package/dist/NotificationServicesController/processors/process-api-notifications.cjs +4 -4
  48. package/dist/NotificationServicesController/processors/process-api-notifications.cjs.map +1 -1
  49. package/dist/NotificationServicesController/processors/process-api-notifications.d.cts.map +1 -1
  50. package/dist/NotificationServicesController/processors/process-api-notifications.d.mts.map +1 -1
  51. package/dist/NotificationServicesController/processors/process-api-notifications.mjs.map +1 -1
  52. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +4 -4
  53. package/dist/NotificationServicesController/processors/process-feature-announcement.cjs.map +1 -1
  54. package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map +1 -1
  55. package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map +1 -1
  56. package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -1
  57. package/dist/NotificationServicesController/processors/process-notifications.cjs +11 -11
  58. package/dist/NotificationServicesController/processors/process-notifications.cjs.map +1 -1
  59. package/dist/NotificationServicesController/processors/process-notifications.d.cts.map +1 -1
  60. package/dist/NotificationServicesController/processors/process-notifications.d.mts.map +1 -1
  61. package/dist/NotificationServicesController/processors/process-notifications.mjs.map +1 -1
  62. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs +2 -2
  63. package/dist/NotificationServicesController/processors/process-snap-notifications.cjs.map +1 -1
  64. package/dist/NotificationServicesController/processors/process-snap-notifications.d.cts.map +1 -1
  65. package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts.map +1 -1
  66. package/dist/NotificationServicesController/processors/process-snap-notifications.mjs.map +1 -1
  67. package/dist/NotificationServicesController/services/api-notifications.cjs +9 -9
  68. package/dist/NotificationServicesController/services/api-notifications.cjs.map +1 -1
  69. package/dist/NotificationServicesController/services/api-notifications.d.cts.map +1 -1
  70. package/dist/NotificationServicesController/services/api-notifications.d.mts.map +1 -1
  71. package/dist/NotificationServicesController/services/api-notifications.mjs.map +1 -1
  72. package/dist/NotificationServicesController/services/feature-announcements.cjs +6 -6
  73. package/dist/NotificationServicesController/services/feature-announcements.cjs.map +1 -1
  74. package/dist/NotificationServicesController/services/feature-announcements.d.cts.map +1 -1
  75. package/dist/NotificationServicesController/services/feature-announcements.d.mts.map +1 -1
  76. package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -1
  77. package/dist/NotificationServicesController/services/perp-notifications.cjs.map +1 -1
  78. package/dist/NotificationServicesController/services/perp-notifications.d.cts.map +1 -1
  79. package/dist/NotificationServicesController/services/perp-notifications.d.mts.map +1 -1
  80. package/dist/NotificationServicesController/services/perp-notifications.mjs.map +1 -1
  81. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs.map +1 -1
  82. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.cts.map +1 -1
  83. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts.map +1 -1
  84. package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs.map +1 -1
  85. package/dist/NotificationServicesController/types/feature-announcement/index.cjs.map +1 -1
  86. package/dist/NotificationServicesController/types/feature-announcement/index.d.cts.map +1 -1
  87. package/dist/NotificationServicesController/types/feature-announcement/index.d.mts.map +1 -1
  88. package/dist/NotificationServicesController/types/feature-announcement/index.mjs.map +1 -1
  89. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs.map +1 -1
  90. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.cts.map +1 -1
  91. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts.map +1 -1
  92. package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs.map +1 -1
  93. package/dist/NotificationServicesController/types/index.cjs.map +1 -1
  94. package/dist/NotificationServicesController/types/index.d.cts +1 -1
  95. package/dist/NotificationServicesController/types/index.d.cts.map +1 -1
  96. package/dist/NotificationServicesController/types/index.d.mts +1 -1
  97. package/dist/NotificationServicesController/types/index.d.mts.map +1 -1
  98. package/dist/NotificationServicesController/types/index.mjs.map +1 -1
  99. package/dist/NotificationServicesController/types/notification/index.cjs.map +1 -1
  100. package/dist/NotificationServicesController/types/notification/index.d.cts.map +1 -1
  101. package/dist/NotificationServicesController/types/notification/index.d.mts.map +1 -1
  102. package/dist/NotificationServicesController/types/notification/index.mjs.map +1 -1
  103. package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -1
  104. package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -1
  105. package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -1
  106. package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -1
  107. package/dist/NotificationServicesController/types/notification-api/index.cjs.map +1 -1
  108. package/dist/NotificationServicesController/types/notification-api/index.d.cts.map +1 -1
  109. package/dist/NotificationServicesController/types/notification-api/index.d.mts.map +1 -1
  110. package/dist/NotificationServicesController/types/notification-api/index.mjs.map +1 -1
  111. package/dist/NotificationServicesController/types/notification-api/notification-api.cjs +1 -1
  112. package/dist/NotificationServicesController/types/notification-api/notification-api.cjs.map +1 -1
  113. package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts.map +1 -1
  114. package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts.map +1 -1
  115. package/dist/NotificationServicesController/types/notification-api/notification-api.mjs.map +1 -1
  116. package/dist/NotificationServicesController/types/perps/index.cjs.map +1 -1
  117. package/dist/NotificationServicesController/types/perps/index.d.cts.map +1 -1
  118. package/dist/NotificationServicesController/types/perps/index.d.mts.map +1 -1
  119. package/dist/NotificationServicesController/types/perps/index.mjs.map +1 -1
  120. package/dist/NotificationServicesController/types/perps/perp-types.cjs.map +1 -1
  121. package/dist/NotificationServicesController/types/perps/perp-types.d.cts.map +1 -1
  122. package/dist/NotificationServicesController/types/perps/perp-types.d.mts.map +1 -1
  123. package/dist/NotificationServicesController/types/perps/perp-types.mjs.map +1 -1
  124. package/dist/NotificationServicesController/types/snaps/index.cjs.map +1 -1
  125. package/dist/NotificationServicesController/types/snaps/index.d.cts.map +1 -1
  126. package/dist/NotificationServicesController/types/snaps/index.d.mts.map +1 -1
  127. package/dist/NotificationServicesController/types/snaps/index.mjs.map +1 -1
  128. package/dist/NotificationServicesController/types/snaps/snaps.cjs.map +1 -1
  129. package/dist/NotificationServicesController/types/snaps/snaps.d.cts.map +1 -1
  130. package/dist/NotificationServicesController/types/snaps/snaps.d.mts.map +1 -1
  131. package/dist/NotificationServicesController/types/snaps/snaps.mjs.map +1 -1
  132. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs +4 -4
  133. package/dist/NotificationServicesController/utils/get-notification-subtype.cjs.map +1 -1
  134. package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts.map +1 -1
  135. package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts.map +1 -1
  136. package/dist/NotificationServicesController/utils/get-notification-subtype.mjs.map +1 -1
  137. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs.map +1 -1
  138. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.cts.map +1 -1
  139. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts.map +1 -1
  140. package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.mjs.map +1 -1
  141. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs +6 -6
  142. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -1
  143. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -1
  144. package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -1
  145. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -1
  146. package/dist/NotificationServicesPushController/index.cjs +3 -3
  147. package/dist/NotificationServicesPushController/index.cjs.map +1 -1
  148. package/dist/NotificationServicesPushController/index.d.cts.map +1 -1
  149. package/dist/NotificationServicesPushController/index.d.mts.map +1 -1
  150. package/dist/NotificationServicesPushController/index.mjs.map +1 -1
  151. package/dist/NotificationServicesPushController/mocks/index.cjs.map +1 -1
  152. package/dist/NotificationServicesPushController/mocks/index.d.cts.map +1 -1
  153. package/dist/NotificationServicesPushController/mocks/index.d.mts.map +1 -1
  154. package/dist/NotificationServicesPushController/mocks/index.mjs.map +1 -1
  155. package/dist/NotificationServicesPushController/mocks/mockResponse.cjs +3 -3
  156. package/dist/NotificationServicesPushController/mocks/mockResponse.cjs.map +1 -1
  157. package/dist/NotificationServicesPushController/mocks/mockResponse.mjs.map +1 -1
  158. package/dist/NotificationServicesPushController/services/services.cjs.map +1 -1
  159. package/dist/NotificationServicesPushController/services/services.d.cts.map +1 -1
  160. package/dist/NotificationServicesPushController/services/services.d.mts.map +1 -1
  161. package/dist/NotificationServicesPushController/services/services.mjs.map +1 -1
  162. package/dist/NotificationServicesPushController/types/index.cjs.map +1 -1
  163. package/dist/NotificationServicesPushController/types/index.d.cts.map +1 -1
  164. package/dist/NotificationServicesPushController/types/index.d.mts.map +1 -1
  165. package/dist/NotificationServicesPushController/types/index.mjs.map +1 -1
  166. package/dist/NotificationServicesPushController/types/push-service-interface.cjs.map +1 -1
  167. package/dist/NotificationServicesPushController/types/push-service-interface.d.cts.map +1 -1
  168. package/dist/NotificationServicesPushController/types/push-service-interface.d.mts.map +1 -1
  169. package/dist/NotificationServicesPushController/types/push-service-interface.mjs.map +1 -1
  170. package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +5 -5
  171. package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +1 -1
  172. package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts.map +1 -1
  173. package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +1 -1
  174. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -1
  175. package/dist/NotificationServicesPushController/utils/index.cjs.map +1 -1
  176. package/dist/NotificationServicesPushController/utils/index.d.cts.map +1 -1
  177. package/dist/NotificationServicesPushController/utils/index.d.mts.map +1 -1
  178. package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -1
  179. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs.map +1 -1
  180. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts.map +1 -1
  181. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts.map +1 -1
  182. package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs.map +1 -1
  183. package/dist/NotificationServicesPushController/web/index.cjs +4 -4
  184. package/dist/NotificationServicesPushController/web/index.cjs.map +1 -1
  185. package/dist/NotificationServicesPushController/web/index.d.cts.map +1 -1
  186. package/dist/NotificationServicesPushController/web/index.d.mts.map +1 -1
  187. package/dist/NotificationServicesPushController/web/index.mjs.map +1 -1
  188. package/dist/NotificationServicesPushController/web/push-utils.cjs +2 -2
  189. package/dist/NotificationServicesPushController/web/push-utils.cjs.map +1 -1
  190. package/dist/NotificationServicesPushController/web/push-utils.d.cts +1 -1
  191. package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +1 -1
  192. package/dist/NotificationServicesPushController/web/push-utils.d.mts +1 -1
  193. package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +1 -1
  194. package/dist/NotificationServicesPushController/web/push-utils.mjs.map +1 -1
  195. package/dist/index.cjs +5 -5
  196. package/dist/index.cjs.map +1 -1
  197. package/dist/index.d.cts.map +1 -1
  198. package/dist/index.d.mts.map +1 -1
  199. package/dist/index.mjs.map +1 -1
  200. package/dist/shared/index.cjs.map +1 -1
  201. package/dist/shared/index.d.cts.map +1 -1
  202. package/dist/shared/index.d.mts.map +1 -1
  203. package/dist/shared/index.mjs.map +1 -1
  204. package/dist/shared/is-onchain-notification.cjs +2 -2
  205. package/dist/shared/is-onchain-notification.cjs.map +1 -1
  206. package/dist/shared/is-onchain-notification.d.cts.map +1 -1
  207. package/dist/shared/is-onchain-notification.d.mts.map +1 -1
  208. package/dist/shared/is-onchain-notification.mjs.map +1 -1
  209. package/dist/shared/notification-api-type-guards.cjs.map +1 -1
  210. package/dist/shared/notification-api-type-guards.d.cts.map +1 -1
  211. package/dist/shared/notification-api-type-guards.d.mts.map +1 -1
  212. package/dist/shared/notification-api-type-guards.mjs.map +1 -1
  213. package/dist/shared/to-raw-notification.cjs +4 -4
  214. package/dist/shared/to-raw-notification.cjs.map +1 -1
  215. package/dist/shared/to-raw-notification.mjs.map +1 -1
  216. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationServicesController-method-action-types.cjs","sourceRoot":"","sources":["../../src/NotificationServicesController/NotificationServicesController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NotificationServicesController } from './NotificationServicesController';\n\nexport type NotificationServicesControllerInitAction = {\n type: `NotificationServicesController:init`;\n handler: NotificationServicesController['init'];\n};\n\n/**\n * Public method to expose enabling push notifications\n */\nexport type NotificationServicesControllerEnablePushNotificationsAction = {\n type: `NotificationServicesController:enablePushNotifications`;\n handler: NotificationServicesController['enablePushNotifications'];\n};\n\n/**\n * Public method to expose disabling push notifications\n */\nexport type NotificationServicesControllerDisablePushNotificationsAction = {\n type: `NotificationServicesController:disablePushNotifications`;\n handler: NotificationServicesController['disablePushNotifications'];\n};\n\nexport type NotificationServicesControllerCheckAccountsPresenceAction = {\n type: `NotificationServicesController:checkAccountsPresence`;\n handler: NotificationServicesController['checkAccountsPresence'];\n};\n\n/**\n * Sets the enabled state of feature announcements.\n *\n * **Action** - used in the notification settings to enable/disable feature announcements.\n *\n * @param featureAnnouncementsEnabled - A boolean value indicating the desired enabled state of the feature announcements.\n * @async\n * @throws {Error} If fails to update\n */\nexport type NotificationServicesControllerSetFeatureAnnouncementsEnabledAction =\n {\n type: `NotificationServicesController:setFeatureAnnouncementsEnabled`;\n handler: NotificationServicesController['setFeatureAnnouncementsEnabled'];\n };\n\n/**\n * This creates/re-creates on-chain triggers defined in User Storage.\n *\n * **Action** - Used during Sign In / Enabling of notifications.\n *\n * Notification preferences are initialized only when\n * {@link AuthenticatedUserStorageService} has no stored preferences yet.\n * Existing preferences are left as-is.\n *\n * @param opts - optional options to mutate this functionality\n * @param opts.hasMarketingConsent - The user's marketing-consent flag.\n * Used only during initialization to seed marketing push notifications.\n * @param opts.productAnnouncementEnabled - The user's product-announcement flag.\n * Used only during initialization to seed marketing in-app notifications.\n * @param opts.registerPushNotifications - Whether to attempt FCM/device push registration.\n * @returns The updated or newly created user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerCreateOnChainTriggersAction = {\n type: `NotificationServicesController:createOnChainTriggers`;\n handler: NotificationServicesController['createOnChainTriggers'];\n};\n\n/**\n * Enables all MetaMask notifications for the user.\n * This is identical flow when initializing notifications for the first time.\n *\n * @param opts - Optional options to mutate this functionality.\n * @throws {Error} If there is an error during the process of enabling notifications.\n */\nexport type NotificationServicesControllerEnableMetamaskNotificationsAction = {\n type: `NotificationServicesController:enableMetamaskNotifications`;\n handler: NotificationServicesController['enableMetamaskNotifications'];\n};\n\n/**\n * Disables all MetaMask notifications for the user.\n * This method ensures that the user is authenticated, retrieves all linked accounts,\n * and disables on-chain triggers for each account. It also sets the global notification\n * settings for MetaMask, feature announcements to false.\n *\n * @throws {Error} If the user is not authenticated or if there is an error during the process.\n */\nexport type NotificationServicesControllerDisableNotificationServicesAction = {\n type: `NotificationServicesController:disableNotificationServices`;\n handler: NotificationServicesController['disableNotificationServices'];\n};\n\n/**\n * Deletes on-chain triggers associated with a specific account/s.\n * This method performs several key operations:\n * 1. Validates Auth\n * 2. Deletes accounts\n * (note) We do not need to look through push notifications as we've deleted triggers\n *\n * **Action** - When a user disables notifications for a given account in settings.\n *\n * @param accounts - The account for which on-chain triggers are to be deleted.\n * @returns A promise that resolves to void or an object containing a success message.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerDisableAccountsAction = {\n type: `NotificationServicesController:disableAccounts`;\n handler: NotificationServicesController['disableAccounts'];\n};\n\n/**\n * Updates/Creates on-chain triggers for a specific account.\n *\n * This method performs several key operations:\n * 1. Validates Auth & Storage\n * 2. Finds and creates any missing triggers associated with the account\n * 3. Enables any related push notifications\n * 4. Updates Storage to reflect new state.\n *\n * **Action** - When a user enables notifications for an account\n *\n * @param accounts - List of accounts you want to update.\n * @returns A promise that resolves to the updated user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerEnableAccountsAction = {\n type: `NotificationServicesController:enableAccounts`;\n handler: NotificationServicesController['enableAccounts'];\n};\n\n/**\n * Fetches the list of metamask notifications.\n * This includes OnChain notifications; Feature Announcements; and Snap Notifications.\n *\n * **Action** - When a user views the notification list page/dropdown\n *\n * @param previewToken - the preview token to use if needed\n * @returns A promise that resolves to the list of notifications.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerFetchAndUpdateMetamaskNotificationsAction =\n {\n type: `NotificationServicesController:fetchAndUpdateMetamaskNotifications`;\n handler: NotificationServicesController['fetchAndUpdateMetamaskNotifications'];\n };\n\n/**\n * Gets the specified type of notifications from state.\n *\n * @param type - The trigger type.\n * @returns An array of notifications of the passed in type.\n * @throws Throws an error if an invalid trigger type is passed.\n */\nexport type NotificationServicesControllerGetNotificationsByTypeAction = {\n type: `NotificationServicesController:getNotificationsByType`;\n handler: NotificationServicesController['getNotificationsByType'];\n};\n\n/**\n * Used to delete a notification by id.\n *\n * Note: This function should only be used for notifications that are stored\n * in this controller directly, currently only snaps notifications.\n *\n * @param id - The id of the notification to delete.\n */\nexport type NotificationServicesControllerDeleteNotificationByIdAction = {\n type: `NotificationServicesController:deleteNotificationById`;\n handler: NotificationServicesController['deleteNotificationById'];\n};\n\n/**\n * Used to batch delete notifications by id.\n *\n * Note: This function should only be used for notifications that are stored\n * in this controller directly, currently only snaps notifications.\n *\n * @param ids - The ids of the notifications to delete.\n */\nexport type NotificationServicesControllerDeleteNotificationsByIdAction = {\n type: `NotificationServicesController:deleteNotificationsById`;\n handler: NotificationServicesController['deleteNotificationsById'];\n};\n\n/**\n * Marks specified metamask notifications as read.\n *\n * @param notifications - An array of notifications to be marked as read. Each notification should include its type and read status.\n * @returns A promise that resolves when the operation is complete.\n */\nexport type NotificationServicesControllerMarkMetamaskNotificationsAsReadAction =\n {\n type: `NotificationServicesController:markMetamaskNotificationsAsRead`;\n handler: NotificationServicesController['markMetamaskNotificationsAsRead'];\n };\n\n/**\n * Updates the list of MetaMask notifications by adding a new notification at the beginning of the list.\n * This method ensures that the most recent notification is displayed first in the UI.\n *\n * @param notification - The new notification object to be added to the list.\n * @returns A promise that resolves when the notification list has been successfully updated.\n */\nexport type NotificationServicesControllerUpdateMetamaskNotificationsListAction =\n {\n type: `NotificationServicesController:updateMetamaskNotificationsList`;\n handler: NotificationServicesController['updateMetamaskNotificationsList'];\n };\n\n/**\n * Creates an perp order notification subscription.\n * Requires notifications and auth to be enabled to start receiving this notifications\n *\n * @param input perp input\n */\nexport type NotificationServicesControllerSendPerpPlaceOrderNotificationAction =\n {\n type: `NotificationServicesController:sendPerpPlaceOrderNotification`;\n handler: NotificationServicesController['sendPerpPlaceOrderNotification'];\n };\n\n/**\n * Union of all NotificationServicesController action types.\n */\nexport type NotificationServicesControllerMethodActions =\n | NotificationServicesControllerInitAction\n | NotificationServicesControllerEnablePushNotificationsAction\n | NotificationServicesControllerDisablePushNotificationsAction\n | NotificationServicesControllerCheckAccountsPresenceAction\n | NotificationServicesControllerSetFeatureAnnouncementsEnabledAction\n | NotificationServicesControllerCreateOnChainTriggersAction\n | NotificationServicesControllerEnableMetamaskNotificationsAction\n | NotificationServicesControllerDisableNotificationServicesAction\n | NotificationServicesControllerDisableAccountsAction\n | NotificationServicesControllerEnableAccountsAction\n | NotificationServicesControllerFetchAndUpdateMetamaskNotificationsAction\n | NotificationServicesControllerGetNotificationsByTypeAction\n | NotificationServicesControllerDeleteNotificationByIdAction\n | NotificationServicesControllerDeleteNotificationsByIdAction\n | NotificationServicesControllerMarkMetamaskNotificationsAsReadAction\n | NotificationServicesControllerUpdateMetamaskNotificationsListAction\n | NotificationServicesControllerSendPerpPlaceOrderNotificationAction;\n"]}
1
+ {"version":3,"file":"NotificationServicesController-method-action-types.cjs","sourceRoot":"","sources":["../../src/NotificationServicesController/NotificationServicesController-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NotificationServicesController } from './NotificationServicesController.js';\n\nexport type NotificationServicesControllerInitAction = {\n type: `NotificationServicesController:init`;\n handler: NotificationServicesController['init'];\n};\n\n/**\n * Public method to expose enabling push notifications\n */\nexport type NotificationServicesControllerEnablePushNotificationsAction = {\n type: `NotificationServicesController:enablePushNotifications`;\n handler: NotificationServicesController['enablePushNotifications'];\n};\n\n/**\n * Public method to expose disabling push notifications\n */\nexport type NotificationServicesControllerDisablePushNotificationsAction = {\n type: `NotificationServicesController:disablePushNotifications`;\n handler: NotificationServicesController['disablePushNotifications'];\n};\n\nexport type NotificationServicesControllerCheckAccountsPresenceAction = {\n type: `NotificationServicesController:checkAccountsPresence`;\n handler: NotificationServicesController['checkAccountsPresence'];\n};\n\n/**\n * Sets the enabled state of feature announcements.\n *\n * **Action** - used in the notification settings to enable/disable feature announcements.\n *\n * @param featureAnnouncementsEnabled - A boolean value indicating the desired enabled state of the feature announcements.\n * @async\n * @throws {Error} If fails to update\n */\nexport type NotificationServicesControllerSetFeatureAnnouncementsEnabledAction =\n {\n type: `NotificationServicesController:setFeatureAnnouncementsEnabled`;\n handler: NotificationServicesController['setFeatureAnnouncementsEnabled'];\n };\n\n/**\n * This creates/re-creates on-chain triggers defined in User Storage.\n *\n * **Action** - Used during Sign In / Enabling of notifications.\n *\n * Notification preferences are initialized only when\n * {@link AuthenticatedUserStorageService} has no stored preferences yet.\n * Existing preferences are left as-is.\n *\n * @param opts - optional options to mutate this functionality\n * @param opts.hasMarketingConsent - The user's marketing-consent flag.\n * Used only during initialization to seed marketing push notifications.\n * @param opts.productAnnouncementEnabled - The user's product-announcement flag.\n * Used only during initialization to seed marketing in-app notifications.\n * @param opts.registerPushNotifications - Whether to attempt FCM/device push registration.\n * @returns The updated or newly created user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerCreateOnChainTriggersAction = {\n type: `NotificationServicesController:createOnChainTriggers`;\n handler: NotificationServicesController['createOnChainTriggers'];\n};\n\n/**\n * Enables all MetaMask notifications for the user.\n * This is identical flow when initializing notifications for the first time.\n *\n * @param opts - Optional options to mutate this functionality.\n * @throws {Error} If there is an error during the process of enabling notifications.\n */\nexport type NotificationServicesControllerEnableMetamaskNotificationsAction = {\n type: `NotificationServicesController:enableMetamaskNotifications`;\n handler: NotificationServicesController['enableMetamaskNotifications'];\n};\n\n/**\n * Disables all MetaMask notifications for the user.\n * This method ensures that the user is authenticated, retrieves all linked accounts,\n * and disables on-chain triggers for each account. It also sets the global notification\n * settings for MetaMask, feature announcements to false.\n *\n * @throws {Error} If the user is not authenticated or if there is an error during the process.\n */\nexport type NotificationServicesControllerDisableNotificationServicesAction = {\n type: `NotificationServicesController:disableNotificationServices`;\n handler: NotificationServicesController['disableNotificationServices'];\n};\n\n/**\n * Deletes on-chain triggers associated with a specific account/s.\n * This method performs several key operations:\n * 1. Validates Auth\n * 2. Deletes accounts\n * (note) We do not need to look through push notifications as we've deleted triggers\n *\n * **Action** - When a user disables notifications for a given account in settings.\n *\n * @param accounts - The account for which on-chain triggers are to be deleted.\n * @returns A promise that resolves to void or an object containing a success message.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerDisableAccountsAction = {\n type: `NotificationServicesController:disableAccounts`;\n handler: NotificationServicesController['disableAccounts'];\n};\n\n/**\n * Updates/Creates on-chain triggers for a specific account.\n *\n * This method performs several key operations:\n * 1. Validates Auth & Storage\n * 2. Finds and creates any missing triggers associated with the account\n * 3. Enables any related push notifications\n * 4. Updates Storage to reflect new state.\n *\n * **Action** - When a user enables notifications for an account\n *\n * @param accounts - List of accounts you want to update.\n * @returns A promise that resolves to the updated user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerEnableAccountsAction = {\n type: `NotificationServicesController:enableAccounts`;\n handler: NotificationServicesController['enableAccounts'];\n};\n\n/**\n * Fetches the list of metamask notifications.\n * This includes OnChain notifications; Feature Announcements; and Snap Notifications.\n *\n * **Action** - When a user views the notification list page/dropdown\n *\n * @param previewToken - the preview token to use if needed\n * @returns A promise that resolves to the list of notifications.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerFetchAndUpdateMetamaskNotificationsAction =\n {\n type: `NotificationServicesController:fetchAndUpdateMetamaskNotifications`;\n handler: NotificationServicesController['fetchAndUpdateMetamaskNotifications'];\n };\n\n/**\n * Gets the specified type of notifications from state.\n *\n * @param type - The trigger type.\n * @returns An array of notifications of the passed in type.\n * @throws Throws an error if an invalid trigger type is passed.\n */\nexport type NotificationServicesControllerGetNotificationsByTypeAction = {\n type: `NotificationServicesController:getNotificationsByType`;\n handler: NotificationServicesController['getNotificationsByType'];\n};\n\n/**\n * Used to delete a notification by id.\n *\n * Note: This function should only be used for notifications that are stored\n * in this controller directly, currently only snaps notifications.\n *\n * @param id - The id of the notification to delete.\n */\nexport type NotificationServicesControllerDeleteNotificationByIdAction = {\n type: `NotificationServicesController:deleteNotificationById`;\n handler: NotificationServicesController['deleteNotificationById'];\n};\n\n/**\n * Used to batch delete notifications by id.\n *\n * Note: This function should only be used for notifications that are stored\n * in this controller directly, currently only snaps notifications.\n *\n * @param ids - The ids of the notifications to delete.\n */\nexport type NotificationServicesControllerDeleteNotificationsByIdAction = {\n type: `NotificationServicesController:deleteNotificationsById`;\n handler: NotificationServicesController['deleteNotificationsById'];\n};\n\n/**\n * Marks specified metamask notifications as read.\n *\n * @param notifications - An array of notifications to be marked as read. Each notification should include its type and read status.\n * @returns A promise that resolves when the operation is complete.\n */\nexport type NotificationServicesControllerMarkMetamaskNotificationsAsReadAction =\n {\n type: `NotificationServicesController:markMetamaskNotificationsAsRead`;\n handler: NotificationServicesController['markMetamaskNotificationsAsRead'];\n };\n\n/**\n * Updates the list of MetaMask notifications by adding a new notification at the beginning of the list.\n * This method ensures that the most recent notification is displayed first in the UI.\n *\n * @param notification - The new notification object to be added to the list.\n * @returns A promise that resolves when the notification list has been successfully updated.\n */\nexport type NotificationServicesControllerUpdateMetamaskNotificationsListAction =\n {\n type: `NotificationServicesController:updateMetamaskNotificationsList`;\n handler: NotificationServicesController['updateMetamaskNotificationsList'];\n };\n\n/**\n * Creates an perp order notification subscription.\n * Requires notifications and auth to be enabled to start receiving this notifications\n *\n * @param input perp input\n */\nexport type NotificationServicesControllerSendPerpPlaceOrderNotificationAction =\n {\n type: `NotificationServicesController:sendPerpPlaceOrderNotification`;\n handler: NotificationServicesController['sendPerpPlaceOrderNotification'];\n };\n\n/**\n * Union of all NotificationServicesController action types.\n */\nexport type NotificationServicesControllerMethodActions =\n | NotificationServicesControllerInitAction\n | NotificationServicesControllerEnablePushNotificationsAction\n | NotificationServicesControllerDisablePushNotificationsAction\n | NotificationServicesControllerCheckAccountsPresenceAction\n | NotificationServicesControllerSetFeatureAnnouncementsEnabledAction\n | NotificationServicesControllerCreateOnChainTriggersAction\n | NotificationServicesControllerEnableMetamaskNotificationsAction\n | NotificationServicesControllerDisableNotificationServicesAction\n | NotificationServicesControllerDisableAccountsAction\n | NotificationServicesControllerEnableAccountsAction\n | NotificationServicesControllerFetchAndUpdateMetamaskNotificationsAction\n | NotificationServicesControllerGetNotificationsByTypeAction\n | NotificationServicesControllerDeleteNotificationByIdAction\n | NotificationServicesControllerDeleteNotificationsByIdAction\n | NotificationServicesControllerMarkMetamaskNotificationsAsReadAction\n | NotificationServicesControllerUpdateMetamaskNotificationsListAction\n | NotificationServicesControllerSendPerpPlaceOrderNotificationAction;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationServicesController-method-action-types.d.cts","sourceRoot":"","sources":["../../src/NotificationServicesController/NotificationServicesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,6CAAyC;AAEvF,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,8BAA8B,CAAC,MAAM,CAAC,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2DAA2D,GAAG;IACxE,IAAI,EAAE,wDAAwD,CAAC;IAC/D,OAAO,E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,GACnD,kDAAkD,GAClD,uEAAuE,GACvE,0DAA0D,GAC1D,0DAA0D,GAC1D,2DAA2D,GAC3D,mEAAmE,GACnE,mEAAmE,GACnE,kEAAkE,CAAC"}
1
+ {"version":3,"file":"NotificationServicesController-method-action-types.d.cts","sourceRoot":"","sources":["../../src/NotificationServicesController/NotificationServicesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,6CAA4C;AAE1F,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,8BAA8B,CAAC,MAAM,CAAC,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2DAA2D,GAAG;IACxE,IAAI,EAAE,wDAAwD,CAAC;IAC/D,OAAO,EAAE,8BAA8B,CAAC,yBAAyB,CAAC,CAAC;CACpE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4DAA4D,GAAG;IACzE,IAAI,EAAE,yDAAyD,CAAC;IAChE,OAAO,EAAE,8BAA8B,CAAC,0BAA0B,CAAC,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,8BAA8B,CAAC,uBAAuB,CAAC,CAAC;CAClE,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,kEAAkE,GAC5E;IACE,IAAI,EAAE,+DAA+D,CAAC;IACtE,OAAO,EAAE,8BAA8B,CAAC,gCAAgC,CAAC,CAAC;CAC3E,CAAC;AAEJ;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,8BAA8B,CAAC,uBAAuB,CAAC,CAAC;CAClE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,+DAA+D,GAAG;IAC5E,IAAI,EAAE,4DAA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,8BAA8B,CAAC,iCAAiC,CAAC,CAAC;CAC5E,CAAC;AAEJ;;;;;;GAMG;AACH,MAAM,MAAM,mEAAmE,GAC7E;IACE,IAAI,EAAE,gEAAgE,CAAC;IACvE,OAAO,EAAE,8BAA8B,CAAC,iCAAiC,CAAC,CAAC;CAC5E,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,MAAM,kEAAkE,GAC5E;IACE,IAAI,EAAE,+DAA+D,CAAC;IACtE,OAAO,EAAE,8BAA8B,CAAC,gCAAgC,CAAC,CAAC;CAC3E,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,2CAA2C,GACnD,wCAAwC,GACxC,2DAA2D,GAC3D,4DAA4D,GAC5D,yDAAyD,GACzD,kEAAkE,GAClE,yDAAyD,GACzD,+DAA+D,GAC/D,+DAA+D,GAC/D,mDAAmD,GACnD,kDAAkD,GAClD,uEAAuE,GACvE,0DAA0D,GAC1D,0DAA0D,GAC1D,2DAA2D,GAC3D,mEAAmE,GACnE,mEAAmE,GACnE,kEAAkE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationServicesController-method-action-types.d.mts","sourceRoot":"","sources":["../../src/NotificationServicesController/NotificationServicesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,6CAAyC;AAEvF,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,8BAA8B,CAAC,MAAM,CAAC,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2DAA2D,GAAG;IACxE,IAAI,EAAE,wDAAwD,CAAC;IAC/D,OAAO,EAAE,8BAA8B,CAAC,yBAAyB,CAAC,CAAC;CACpE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4DAA4D,GAAG;IACzE,IAAI,EAAE,yDAAyD,CAAC;IAChE,OAAO,EAAE,8BAA8B,CAAC,0BAA0B,CAAC,CAA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","sources":["../../src/NotificationServicesController/NotificationServicesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,6CAA4C;AAE1F,MAAM,MAAM,wCAAwC,GAAG;IACrD,IAAI,EAAE,qCAAqC,CAAC;IAC5C,OAAO,EAAE,8BAA8B,CAAC,MAAM,CAAC,CAAC;CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2DAA2D,GAAG;IACxE,IAAI,EAAE,wDAAwD,CAAC;IAC/D,OAAO,EAAE,8BAA8B,CAAC,yBAAyB,CAAC,CAAC;CACpE,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,4DAA4D,GAAG;IACzE,IAAI,EAAE,yDAAyD,CAAC;IAChE,OAAO,EAAE,8BAA8B,CAAC,0BAA0B,CAAC,CAAC;CACrE,CAAC;AAEF,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,8BAA8B,CAAC,uBAAuB,CAAC,CAAC;CAClE,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,kEAAkE,GAC5E;IACE,IAAI,EAAE,+DAA+D,CAAC;IACtE,OAAO,EAAE,8BAA8B,CAAC,gCAAgC,CAAC,CAAC;CAC3E,CAAC;AAEJ;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,yDAAyD,GAAG;IACtE,IAAI,EAAE,sDAAsD,CAAC;IAC7D,OAAO,EAAE,8BAA8B,CAAC,uBAAuB,CAAC,CAAC;CAClE,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,+DAA+D,GAAG;IAC5E,IAAI,EAAE,4DAA4D,CAAC;IACnE,OAAO,EAAE,8BAA8B,CAAC,6BAA6B,CAAC,CAAC;CACxE,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,+DAA+D,GAAG;IAC5E,IAAI,EAAE,4DAA4D,CAAC;IACnE,OAAO,EAAE,8B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CAAC;CAC5E,CAAC;AAEJ;;;;;GAKG;AACH,MAAM,MAAM,kEAAkE,GAC5E;IACE,IAAI,EAAE,+DAA+D,CAAC;IACtE,OAAO,EAAE,8BAA8B,CAAC,gCAAgC,CAAC,CAAC;CAC3E,CAAC;AAEJ;;GAEG;AACH,MAAM,MAAM,2CAA2C,GACnD,wCAAwC,GACxC,2DAA2D,GAC3D,4DAA4D,GAC5D,yDAAyD,GACzD,kEAAkE,GAClE,yDAAyD,GACzD,+DAA+D,GAC/D,+DAA+D,GAC/D,mDAAmD,GACnD,kDAAkD,GAClD,uEAAuE,GACvE,0DAA0D,GAC1D,0DAA0D,GAC1D,2DAA2D,GAC3D,mEAAmE,GACnE,mEAAmE,GACnE,kEAAkE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationServicesController-method-action-types.mjs","sourceRoot":"","sources":["../../src/NotificationServicesController/NotificationServicesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NotificationServicesController } from './NotificationServicesController';\n\nexport type NotificationServicesControllerInitAction = {\n type: `NotificationServicesController:init`;\n handler: NotificationServicesController['init'];\n};\n\n/**\n * Public method to expose enabling push notifications\n */\nexport type NotificationServicesControllerEnablePushNotificationsAction = {\n type: `NotificationServicesController:enablePushNotifications`;\n handler: NotificationServicesController['enablePushNotifications'];\n};\n\n/**\n * Public method to expose disabling push notifications\n */\nexport type NotificationServicesControllerDisablePushNotificationsAction = {\n type: `NotificationServicesController:disablePushNotifications`;\n handler: NotificationServicesController['disablePushNotifications'];\n};\n\nexport type NotificationServicesControllerCheckAccountsPresenceAction = {\n type: `NotificationServicesController:checkAccountsPresence`;\n handler: NotificationServicesController['checkAccountsPresence'];\n};\n\n/**\n * Sets the enabled state of feature announcements.\n *\n * **Action** - used in the notification settings to enable/disable feature announcements.\n *\n * @param featureAnnouncementsEnabled - A boolean value indicating the desired enabled state of the feature announcements.\n * @async\n * @throws {Error} If fails to update\n */\nexport type NotificationServicesControllerSetFeatureAnnouncementsEnabledAction =\n {\n type: `NotificationServicesController:setFeatureAnnouncementsEnabled`;\n handler: NotificationServicesController['setFeatureAnnouncementsEnabled'];\n };\n\n/**\n * This creates/re-creates on-chain triggers defined in User Storage.\n *\n * **Action** - Used during Sign In / Enabling of notifications.\n *\n * Notification preferences are initialized only when\n * {@link AuthenticatedUserStorageService} has no stored preferences yet.\n * Existing preferences are left as-is.\n *\n * @param opts - optional options to mutate this functionality\n * @param opts.hasMarketingConsent - The user's marketing-consent flag.\n * Used only during initialization to seed marketing push notifications.\n * @param opts.productAnnouncementEnabled - The user's product-announcement flag.\n * Used only during initialization to seed marketing in-app notifications.\n * @param opts.registerPushNotifications - Whether to attempt FCM/device push registration.\n * @returns The updated or newly created user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerCreateOnChainTriggersAction = {\n type: `NotificationServicesController:createOnChainTriggers`;\n handler: NotificationServicesController['createOnChainTriggers'];\n};\n\n/**\n * Enables all MetaMask notifications for the user.\n * This is identical flow when initializing notifications for the first time.\n *\n * @param opts - Optional options to mutate this functionality.\n * @throws {Error} If there is an error during the process of enabling notifications.\n */\nexport type NotificationServicesControllerEnableMetamaskNotificationsAction = {\n type: `NotificationServicesController:enableMetamaskNotifications`;\n handler: NotificationServicesController['enableMetamaskNotifications'];\n};\n\n/**\n * Disables all MetaMask notifications for the user.\n * This method ensures that the user is authenticated, retrieves all linked accounts,\n * and disables on-chain triggers for each account. It also sets the global notification\n * settings for MetaMask, feature announcements to false.\n *\n * @throws {Error} If the user is not authenticated or if there is an error during the process.\n */\nexport type NotificationServicesControllerDisableNotificationServicesAction = {\n type: `NotificationServicesController:disableNotificationServices`;\n handler: NotificationServicesController['disableNotificationServices'];\n};\n\n/**\n * Deletes on-chain triggers associated with a specific account/s.\n * This method performs several key operations:\n * 1. Validates Auth\n * 2. Deletes accounts\n * (note) We do not need to look through push notifications as we've deleted triggers\n *\n * **Action** - When a user disables notifications for a given account in settings.\n *\n * @param accounts - The account for which on-chain triggers are to be deleted.\n * @returns A promise that resolves to void or an object containing a success message.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerDisableAccountsAction = {\n type: `NotificationServicesController:disableAccounts`;\n handler: NotificationServicesController['disableAccounts'];\n};\n\n/**\n * Updates/Creates on-chain triggers for a specific account.\n *\n * This method performs several key operations:\n * 1. Validates Auth & Storage\n * 2. Finds and creates any missing triggers associated with the account\n * 3. Enables any related push notifications\n * 4. Updates Storage to reflect new state.\n *\n * **Action** - When a user enables notifications for an account\n *\n * @param accounts - List of accounts you want to update.\n * @returns A promise that resolves to the updated user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerEnableAccountsAction = {\n type: `NotificationServicesController:enableAccounts`;\n handler: NotificationServicesController['enableAccounts'];\n};\n\n/**\n * Fetches the list of metamask notifications.\n * This includes OnChain notifications; Feature Announcements; and Snap Notifications.\n *\n * **Action** - When a user views the notification list page/dropdown\n *\n * @param previewToken - the preview token to use if needed\n * @returns A promise that resolves to the list of notifications.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerFetchAndUpdateMetamaskNotificationsAction =\n {\n type: `NotificationServicesController:fetchAndUpdateMetamaskNotifications`;\n handler: NotificationServicesController['fetchAndUpdateMetamaskNotifications'];\n };\n\n/**\n * Gets the specified type of notifications from state.\n *\n * @param type - The trigger type.\n * @returns An array of notifications of the passed in type.\n * @throws Throws an error if an invalid trigger type is passed.\n */\nexport type NotificationServicesControllerGetNotificationsByTypeAction = {\n type: `NotificationServicesController:getNotificationsByType`;\n handler: NotificationServicesController['getNotificationsByType'];\n};\n\n/**\n * Used to delete a notification by id.\n *\n * Note: This function should only be used for notifications that are stored\n * in this controller directly, currently only snaps notifications.\n *\n * @param id - The id of the notification to delete.\n */\nexport type NotificationServicesControllerDeleteNotificationByIdAction = {\n type: `NotificationServicesController:deleteNotificationById`;\n handler: NotificationServicesController['deleteNotificationById'];\n};\n\n/**\n * Used to batch delete notifications by id.\n *\n * Note: This function should only be used for notifications that are stored\n * in this controller directly, currently only snaps notifications.\n *\n * @param ids - The ids of the notifications to delete.\n */\nexport type NotificationServicesControllerDeleteNotificationsByIdAction = {\n type: `NotificationServicesController:deleteNotificationsById`;\n handler: NotificationServicesController['deleteNotificationsById'];\n};\n\n/**\n * Marks specified metamask notifications as read.\n *\n * @param notifications - An array of notifications to be marked as read. Each notification should include its type and read status.\n * @returns A promise that resolves when the operation is complete.\n */\nexport type NotificationServicesControllerMarkMetamaskNotificationsAsReadAction =\n {\n type: `NotificationServicesController:markMetamaskNotificationsAsRead`;\n handler: NotificationServicesController['markMetamaskNotificationsAsRead'];\n };\n\n/**\n * Updates the list of MetaMask notifications by adding a new notification at the beginning of the list.\n * This method ensures that the most recent notification is displayed first in the UI.\n *\n * @param notification - The new notification object to be added to the list.\n * @returns A promise that resolves when the notification list has been successfully updated.\n */\nexport type NotificationServicesControllerUpdateMetamaskNotificationsListAction =\n {\n type: `NotificationServicesController:updateMetamaskNotificationsList`;\n handler: NotificationServicesController['updateMetamaskNotificationsList'];\n };\n\n/**\n * Creates an perp order notification subscription.\n * Requires notifications and auth to be enabled to start receiving this notifications\n *\n * @param input perp input\n */\nexport type NotificationServicesControllerSendPerpPlaceOrderNotificationAction =\n {\n type: `NotificationServicesController:sendPerpPlaceOrderNotification`;\n handler: NotificationServicesController['sendPerpPlaceOrderNotification'];\n };\n\n/**\n * Union of all NotificationServicesController action types.\n */\nexport type NotificationServicesControllerMethodActions =\n | NotificationServicesControllerInitAction\n | NotificationServicesControllerEnablePushNotificationsAction\n | NotificationServicesControllerDisablePushNotificationsAction\n | NotificationServicesControllerCheckAccountsPresenceAction\n | NotificationServicesControllerSetFeatureAnnouncementsEnabledAction\n | NotificationServicesControllerCreateOnChainTriggersAction\n | NotificationServicesControllerEnableMetamaskNotificationsAction\n | NotificationServicesControllerDisableNotificationServicesAction\n | NotificationServicesControllerDisableAccountsAction\n | NotificationServicesControllerEnableAccountsAction\n | NotificationServicesControllerFetchAndUpdateMetamaskNotificationsAction\n | NotificationServicesControllerGetNotificationsByTypeAction\n | NotificationServicesControllerDeleteNotificationByIdAction\n | NotificationServicesControllerDeleteNotificationsByIdAction\n | NotificationServicesControllerMarkMetamaskNotificationsAsReadAction\n | NotificationServicesControllerUpdateMetamaskNotificationsListAction\n | NotificationServicesControllerSendPerpPlaceOrderNotificationAction;\n"]}
1
+ {"version":3,"file":"NotificationServicesController-method-action-types.mjs","sourceRoot":"","sources":["../../src/NotificationServicesController/NotificationServicesController-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { NotificationServicesController } from './NotificationServicesController.js';\n\nexport type NotificationServicesControllerInitAction = {\n type: `NotificationServicesController:init`;\n handler: NotificationServicesController['init'];\n};\n\n/**\n * Public method to expose enabling push notifications\n */\nexport type NotificationServicesControllerEnablePushNotificationsAction = {\n type: `NotificationServicesController:enablePushNotifications`;\n handler: NotificationServicesController['enablePushNotifications'];\n};\n\n/**\n * Public method to expose disabling push notifications\n */\nexport type NotificationServicesControllerDisablePushNotificationsAction = {\n type: `NotificationServicesController:disablePushNotifications`;\n handler: NotificationServicesController['disablePushNotifications'];\n};\n\nexport type NotificationServicesControllerCheckAccountsPresenceAction = {\n type: `NotificationServicesController:checkAccountsPresence`;\n handler: NotificationServicesController['checkAccountsPresence'];\n};\n\n/**\n * Sets the enabled state of feature announcements.\n *\n * **Action** - used in the notification settings to enable/disable feature announcements.\n *\n * @param featureAnnouncementsEnabled - A boolean value indicating the desired enabled state of the feature announcements.\n * @async\n * @throws {Error} If fails to update\n */\nexport type NotificationServicesControllerSetFeatureAnnouncementsEnabledAction =\n {\n type: `NotificationServicesController:setFeatureAnnouncementsEnabled`;\n handler: NotificationServicesController['setFeatureAnnouncementsEnabled'];\n };\n\n/**\n * This creates/re-creates on-chain triggers defined in User Storage.\n *\n * **Action** - Used during Sign In / Enabling of notifications.\n *\n * Notification preferences are initialized only when\n * {@link AuthenticatedUserStorageService} has no stored preferences yet.\n * Existing preferences are left as-is.\n *\n * @param opts - optional options to mutate this functionality\n * @param opts.hasMarketingConsent - The user's marketing-consent flag.\n * Used only during initialization to seed marketing push notifications.\n * @param opts.productAnnouncementEnabled - The user's product-announcement flag.\n * Used only during initialization to seed marketing in-app notifications.\n * @param opts.registerPushNotifications - Whether to attempt FCM/device push registration.\n * @returns The updated or newly created user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerCreateOnChainTriggersAction = {\n type: `NotificationServicesController:createOnChainTriggers`;\n handler: NotificationServicesController['createOnChainTriggers'];\n};\n\n/**\n * Enables all MetaMask notifications for the user.\n * This is identical flow when initializing notifications for the first time.\n *\n * @param opts - Optional options to mutate this functionality.\n * @throws {Error} If there is an error during the process of enabling notifications.\n */\nexport type NotificationServicesControllerEnableMetamaskNotificationsAction = {\n type: `NotificationServicesController:enableMetamaskNotifications`;\n handler: NotificationServicesController['enableMetamaskNotifications'];\n};\n\n/**\n * Disables all MetaMask notifications for the user.\n * This method ensures that the user is authenticated, retrieves all linked accounts,\n * and disables on-chain triggers for each account. It also sets the global notification\n * settings for MetaMask, feature announcements to false.\n *\n * @throws {Error} If the user is not authenticated or if there is an error during the process.\n */\nexport type NotificationServicesControllerDisableNotificationServicesAction = {\n type: `NotificationServicesController:disableNotificationServices`;\n handler: NotificationServicesController['disableNotificationServices'];\n};\n\n/**\n * Deletes on-chain triggers associated with a specific account/s.\n * This method performs several key operations:\n * 1. Validates Auth\n * 2. Deletes accounts\n * (note) We do not need to look through push notifications as we've deleted triggers\n *\n * **Action** - When a user disables notifications for a given account in settings.\n *\n * @param accounts - The account for which on-chain triggers are to be deleted.\n * @returns A promise that resolves to void or an object containing a success message.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerDisableAccountsAction = {\n type: `NotificationServicesController:disableAccounts`;\n handler: NotificationServicesController['disableAccounts'];\n};\n\n/**\n * Updates/Creates on-chain triggers for a specific account.\n *\n * This method performs several key operations:\n * 1. Validates Auth & Storage\n * 2. Finds and creates any missing triggers associated with the account\n * 3. Enables any related push notifications\n * 4. Updates Storage to reflect new state.\n *\n * **Action** - When a user enables notifications for an account\n *\n * @param accounts - List of accounts you want to update.\n * @returns A promise that resolves to the updated user storage.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerEnableAccountsAction = {\n type: `NotificationServicesController:enableAccounts`;\n handler: NotificationServicesController['enableAccounts'];\n};\n\n/**\n * Fetches the list of metamask notifications.\n * This includes OnChain notifications; Feature Announcements; and Snap Notifications.\n *\n * **Action** - When a user views the notification list page/dropdown\n *\n * @param previewToken - the preview token to use if needed\n * @returns A promise that resolves to the list of notifications.\n * @throws {Error} Throws an error if unauthenticated or from other operations.\n */\nexport type NotificationServicesControllerFetchAndUpdateMetamaskNotificationsAction =\n {\n type: `NotificationServicesController:fetchAndUpdateMetamaskNotifications`;\n handler: NotificationServicesController['fetchAndUpdateMetamaskNotifications'];\n };\n\n/**\n * Gets the specified type of notifications from state.\n *\n * @param type - The trigger type.\n * @returns An array of notifications of the passed in type.\n * @throws Throws an error if an invalid trigger type is passed.\n */\nexport type NotificationServicesControllerGetNotificationsByTypeAction = {\n type: `NotificationServicesController:getNotificationsByType`;\n handler: NotificationServicesController['getNotificationsByType'];\n};\n\n/**\n * Used to delete a notification by id.\n *\n * Note: This function should only be used for notifications that are stored\n * in this controller directly, currently only snaps notifications.\n *\n * @param id - The id of the notification to delete.\n */\nexport type NotificationServicesControllerDeleteNotificationByIdAction = {\n type: `NotificationServicesController:deleteNotificationById`;\n handler: NotificationServicesController['deleteNotificationById'];\n};\n\n/**\n * Used to batch delete notifications by id.\n *\n * Note: This function should only be used for notifications that are stored\n * in this controller directly, currently only snaps notifications.\n *\n * @param ids - The ids of the notifications to delete.\n */\nexport type NotificationServicesControllerDeleteNotificationsByIdAction = {\n type: `NotificationServicesController:deleteNotificationsById`;\n handler: NotificationServicesController['deleteNotificationsById'];\n};\n\n/**\n * Marks specified metamask notifications as read.\n *\n * @param notifications - An array of notifications to be marked as read. Each notification should include its type and read status.\n * @returns A promise that resolves when the operation is complete.\n */\nexport type NotificationServicesControllerMarkMetamaskNotificationsAsReadAction =\n {\n type: `NotificationServicesController:markMetamaskNotificationsAsRead`;\n handler: NotificationServicesController['markMetamaskNotificationsAsRead'];\n };\n\n/**\n * Updates the list of MetaMask notifications by adding a new notification at the beginning of the list.\n * This method ensures that the most recent notification is displayed first in the UI.\n *\n * @param notification - The new notification object to be added to the list.\n * @returns A promise that resolves when the notification list has been successfully updated.\n */\nexport type NotificationServicesControllerUpdateMetamaskNotificationsListAction =\n {\n type: `NotificationServicesController:updateMetamaskNotificationsList`;\n handler: NotificationServicesController['updateMetamaskNotificationsList'];\n };\n\n/**\n * Creates an perp order notification subscription.\n * Requires notifications and auth to be enabled to start receiving this notifications\n *\n * @param input perp input\n */\nexport type NotificationServicesControllerSendPerpPlaceOrderNotificationAction =\n {\n type: `NotificationServicesController:sendPerpPlaceOrderNotification`;\n handler: NotificationServicesController['sendPerpPlaceOrderNotification'];\n };\n\n/**\n * Union of all NotificationServicesController action types.\n */\nexport type NotificationServicesControllerMethodActions =\n | NotificationServicesControllerInitAction\n | NotificationServicesControllerEnablePushNotificationsAction\n | NotificationServicesControllerDisablePushNotificationsAction\n | NotificationServicesControllerCheckAccountsPresenceAction\n | NotificationServicesControllerSetFeatureAnnouncementsEnabledAction\n | NotificationServicesControllerCreateOnChainTriggersAction\n | NotificationServicesControllerEnableMetamaskNotificationsAction\n | NotificationServicesControllerDisableNotificationServicesAction\n | NotificationServicesControllerDisableAccountsAction\n | NotificationServicesControllerEnableAccountsAction\n | NotificationServicesControllerFetchAndUpdateMetamaskNotificationsAction\n | NotificationServicesControllerGetNotificationsByTypeAction\n | NotificationServicesControllerDeleteNotificationByIdAction\n | NotificationServicesControllerDeleteNotificationsByIdAction\n | NotificationServicesControllerMarkMetamaskNotificationsAsReadAction\n | NotificationServicesControllerUpdateMetamaskNotificationsListAction\n | NotificationServicesControllerSendPerpPlaceOrderNotificationAction;\n"]}
@@ -22,11 +22,11 @@ const controller_utils_1 = require("@metamask/controller-utils");
22
22
  const utils_1 = require("@metamask/utils");
23
23
  const lodash_1 = require("lodash");
24
24
  const loglevel_1 = __importDefault(require("loglevel"));
25
- const notification_schema_1 = require("./constants/notification-schema.cjs");
26
- const process_notifications_1 = require("./processors/process-notifications.cjs");
27
- const api_notifications_1 = require("./services/api-notifications.cjs");
28
- const feature_announcements_1 = require("./services/feature-announcements.cjs");
29
- const perp_notifications_1 = require("./services/perp-notifications.cjs");
25
+ const notification_schema_js_1 = require("./constants/notification-schema.cjs");
26
+ const process_notifications_js_1 = require("./processors/process-notifications.cjs");
27
+ const api_notifications_js_1 = require("./services/api-notifications.cjs");
28
+ const feature_announcements_js_1 = require("./services/feature-announcements.cjs");
29
+ const perp_notifications_js_1 = require("./services/perp-notifications.cjs");
30
30
  // Unique name for the controller
31
31
  const controllerName = 'NotificationServicesController';
32
32
  exports.ACCOUNTS_UPDATE_DEBOUNCE_TIME_MS = 1000;
@@ -105,7 +105,7 @@ exports.defaultState = {
105
105
  isCheckingAccountsPresence: false,
106
106
  };
107
107
  const locallyPersistedNotificationTypes = new Set([
108
- notification_schema_1.TRIGGER_TYPES.SNAP,
108
+ notification_schema_js_1.TRIGGER_TYPES.SNAP,
109
109
  ]);
110
110
  /**
111
111
  * Hardcoded default Perps notification preferences. Applied when notification
@@ -152,7 +152,7 @@ const buildWalletActivityAccounts = (accounts) => accounts.map(({ address, enabl
152
152
  * @returns Wallet-activity account initialization entries.
153
153
  */
154
154
  const buildWalletActivityAccountsFromTriggerConfig = async (bearerToken, accounts, env) => {
155
- const triggerConfig = await (0, api_notifications_1.getNotificationsApiConfigCached)(bearerToken, accounts, env);
155
+ const triggerConfig = await (0, api_notifications_js_1.getNotificationsApiConfigCached)(bearerToken, accounts, env);
156
156
  const triggerConfigByAddress = new Map(triggerConfig.map(({ address, enabled }) => [
157
157
  address.toLowerCase(),
158
158
  enabled,
@@ -650,7 +650,7 @@ class NotificationServicesController extends base_controller_1.BaseController {
650
650
  // Do nothing
651
651
  }
652
652
  // Update State: remove non-permitted notifications & disable flags
653
- const snapNotifications = this.state.metamaskNotificationsList.filter((notification) => notification.type === notification_schema_1.TRIGGER_TYPES.SNAP);
653
+ const snapNotifications = this.state.metamaskNotificationsList.filter((notification) => notification.type === notification_schema_js_1.TRIGGER_TYPES.SNAP);
654
654
  this.update((state) => {
655
655
  state.isNotificationServicesEnabled = false;
656
656
  state.isFeatureAnnouncementsEnabled = false;
@@ -744,7 +744,7 @@ class NotificationServicesController extends base_controller_1.BaseController {
744
744
  // Raw Feature Notifications
745
745
  const rawAnnouncements = isGlobalNotifsEnabled &&
746
746
  notificationPreferences?.marketing.inAppNotificationsEnabled
747
- ? await (0, feature_announcements_1.getFeatureAnnouncementNotifications)(__classPrivateFieldGet(this, _NotificationServicesController_featureAnnouncementEnv, "f"), previewToken).catch(() => [])
747
+ ? await (0, feature_announcements_js_1.getFeatureAnnouncementNotifications)(__classPrivateFieldGet(this, _NotificationServicesController_featureAnnouncementEnv, "f"), previewToken).catch(() => [])
748
748
  : [];
749
749
  // Raw On Chain Notifications
750
750
  const rawOnChainNotifications = [];
@@ -754,7 +754,7 @@ class NotificationServicesController extends base_controller_1.BaseController {
754
754
  const addressesWithNotifications = (notificationPreferences?.walletActivity.accounts ?? [])
755
755
  .filter((account) => account.enabled)
756
756
  .map((account) => account.address);
757
- const notifications = await (0, api_notifications_1.getAPINotifications)(bearerToken, addressesWithNotifications, __classPrivateFieldGet(this, _NotificationServicesController_locale, "f").call(this), __classPrivateFieldGet(this, _NotificationServicesController_featureAnnouncementEnv, "f").platform, __classPrivateFieldGet(this, _NotificationServicesController_env, "f")).catch(() => []);
757
+ const notifications = await (0, api_notifications_js_1.getAPINotifications)(bearerToken, addressesWithNotifications, __classPrivateFieldGet(this, _NotificationServicesController_locale, "f").call(this), __classPrivateFieldGet(this, _NotificationServicesController_featureAnnouncementEnv, "f").platform, __classPrivateFieldGet(this, _NotificationServicesController_env, "f")).catch(() => []);
758
758
  rawOnChainNotifications.push(...notifications);
759
759
  }
760
760
  catch {
@@ -763,12 +763,12 @@ class NotificationServicesController extends base_controller_1.BaseController {
763
763
  }
764
764
  // Snap Notifications (original)
765
765
  // We do not want to remove them
766
- const snapNotifications = this.state.metamaskNotificationsList.filter((notification) => notification.type === notification_schema_1.TRIGGER_TYPES.SNAP);
766
+ const snapNotifications = this.state.metamaskNotificationsList.filter((notification) => notification.type === notification_schema_js_1.TRIGGER_TYPES.SNAP);
767
767
  const readIds = this.state.metamaskNotificationsReadList;
768
768
  // Combine Notifications
769
769
  const metamaskNotifications = [
770
- ...(0, process_notifications_1.processAndFilterNotifications)(rawAnnouncements, readIds),
771
- ...(0, process_notifications_1.processAndFilterNotifications)(rawOnChainNotifications, readIds),
770
+ ...(0, process_notifications_js_1.processAndFilterNotifications)(rawAnnouncements, readIds),
771
+ ...(0, process_notifications_js_1.processAndFilterNotifications)(rawOnChainNotifications, readIds),
772
772
  ...snapNotifications,
773
773
  ];
774
774
  // Sort Notifications
@@ -796,7 +796,7 @@ class NotificationServicesController extends base_controller_1.BaseController {
796
796
  * @throws Throws an error if an invalid trigger type is passed.
797
797
  */
798
798
  getNotificationsByType(type) {
799
- (0, utils_1.assert)(Object.values(notification_schema_1.TRIGGER_TYPES).includes(type), 'Invalid trigger type.');
799
+ (0, utils_1.assert)(Object.values(notification_schema_js_1.TRIGGER_TYPES).includes(type), 'Invalid trigger type.');
800
800
  return this.state.metamaskNotificationsList.filter((notification) => notification.type === type);
801
801
  }
802
802
  /**
@@ -848,10 +848,10 @@ class NotificationServicesController extends base_controller_1.BaseController {
848
848
  const [onChainNotifications, featureAnnouncementNotifications, snapNotifications,] = notifications.reduce((allNotifications, notification) => {
849
849
  if (!notification.isRead) {
850
850
  switch (notification.type) {
851
- case notification_schema_1.TRIGGER_TYPES.FEATURES_ANNOUNCEMENT:
851
+ case notification_schema_js_1.TRIGGER_TYPES.FEATURES_ANNOUNCEMENT:
852
852
  allNotifications[1].push(notification);
853
853
  break;
854
- case notification_schema_1.TRIGGER_TYPES.SNAP:
854
+ case notification_schema_js_1.TRIGGER_TYPES.SNAP:
855
855
  allNotifications[2].push(notification);
856
856
  break;
857
857
  default:
@@ -865,7 +865,7 @@ class NotificationServicesController extends base_controller_1.BaseController {
865
865
  const bearerToken = await __classPrivateFieldGet(this, _NotificationServicesController_auth, "f").getBearerToken();
866
866
  if (bearerToken) {
867
867
  onchainNotificationIds = onChainNotifications.map((notification) => notification.id);
868
- await (0, api_notifications_1.markNotificationsAsRead)(bearerToken, onchainNotificationIds, __classPrivateFieldGet(this, _NotificationServicesController_env, "f")).catch(() => {
868
+ await (0, api_notifications_js_1.markNotificationsAsRead)(bearerToken, onchainNotificationIds, __classPrivateFieldGet(this, _NotificationServicesController_env, "f")).catch(() => {
869
869
  onchainNotificationIds = [];
870
870
  loglevel_1.default.warn('Unable to mark onchain notifications as read');
871
871
  });
@@ -896,7 +896,7 @@ class NotificationServicesController extends base_controller_1.BaseController {
896
896
  state.metamaskNotificationsList = state.metamaskNotificationsList.map((notification) => {
897
897
  if (newReadIds.includes(notification.id) ||
898
898
  onchainNotificationIds.includes(notification.id)) {
899
- if (notification.type === notification_schema_1.TRIGGER_TYPES.SNAP) {
899
+ if (notification.type === notification_schema_js_1.TRIGGER_TYPES.SNAP) {
900
900
  return {
901
901
  ...notification,
902
902
  isRead: true,
@@ -921,7 +921,7 @@ class NotificationServicesController extends base_controller_1.BaseController {
921
921
  if (this.state.metamaskNotificationsList.some((existingNotification) => existingNotification.id === notification.id)) {
922
922
  return;
923
923
  }
924
- const processedNotification = (0, process_notifications_1.safeProcessNotification)(notification);
924
+ const processedNotification = (0, process_notifications_js_1.safeProcessNotification)(notification);
925
925
  if (processedNotification) {
926
926
  this.update((state) => {
927
927
  const existingNotificationIds = new Set(state.metamaskNotificationsList.map((existingNotification) => existingNotification.id));
@@ -945,7 +945,7 @@ class NotificationServicesController extends base_controller_1.BaseController {
945
945
  async sendPerpPlaceOrderNotification(input) {
946
946
  try {
947
947
  const { bearerToken } = await __classPrivateFieldGet(this, _NotificationServicesController_instances, "m", _NotificationServicesController_getBearerToken).call(this);
948
- await (0, perp_notifications_1.createPerpOrderNotification)(bearerToken, input);
948
+ await (0, perp_notifications_js_1.createPerpOrderNotification)(bearerToken, input);
949
949
  }
950
950
  catch {
951
951
  // Do Nothing