@metamask-previews/notification-services-controller 0.5.0-preview-367cb1da → 0.5.0-preview-cf09c0a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NotificationServicesController/NotificationServicesController.cjs +803 -0
- package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/NotificationServicesController.d.ts → NotificationServicesController/NotificationServicesController.d.cts} +7 -7
- package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController.d.mts +238 -0
- package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController.mjs +779 -17
- package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -1
- package/dist/NotificationServicesController/__fixtures__/index.cjs +22 -0
- package/dist/NotificationServicesController/__fixtures__/index.cjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/index.d.cts +6 -0
- package/dist/NotificationServicesController/__fixtures__/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/index.d.mts +6 -0
- package/dist/NotificationServicesController/__fixtures__/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/index.mjs +6 -0
- package/dist/NotificationServicesController/__fixtures__/index.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.cjs +210 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mock-feature-announcements.d.ts → NotificationServicesController/__fixtures__/mock-feature-announcements.d.cts} +3 -3
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.d.mts +15 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.mjs +205 -0
- package/dist/NotificationServicesController/__fixtures__/mock-feature-announcements.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.cjs +22 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mock-notification-trigger.d.ts → NotificationServicesController/__fixtures__/mock-notification-trigger.d.cts} +2 -2
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.d.mts +9 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.mjs +18 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-trigger.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.cjs +82 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.ts → NotificationServicesController/__fixtures__/mock-notification-user-storage.d.cts} +3 -3
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.mts +35 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.mjs +76 -0
- package/dist/NotificationServicesController/__fixtures__/mock-notification-user-storage.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.cjs +624 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mock-raw-notifications.d.ts → NotificationServicesController/__fixtures__/mock-raw-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.d.mts +82 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.mjs +605 -0
- package/dist/NotificationServicesController/__fixtures__/mock-raw-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.cjs +50 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mockResponses.d.ts → NotificationServicesController/__fixtures__/mockResponses.d.cts} +5 -5
- package/dist/NotificationServicesController/__fixtures__/mockResponses.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.d.mts +28 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.mjs +42 -0
- package/dist/NotificationServicesController/__fixtures__/mockResponses.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.cjs +56 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/mockServices.d.ts → NotificationServicesController/__fixtures__/mockServices.d.cts} +2 -2
- package/dist/NotificationServicesController/__fixtures__/mockServices.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.d.mts +12 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.mjs +52 -0
- package/dist/NotificationServicesController/__fixtures__/mockServices.mjs.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.cjs +31 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/__fixtures__/test-utils.d.ts → NotificationServicesController/__fixtures__/test-utils.d.cts} +1 -1
- package/dist/NotificationServicesController/__fixtures__/test-utils.d.cts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.d.mts +14 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.d.mts.map +1 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.mjs +27 -0
- package/dist/NotificationServicesController/__fixtures__/test-utils.mjs.map +1 -0
- package/dist/NotificationServicesController/constants/constants.cjs +7 -0
- package/dist/NotificationServicesController/constants/constants.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/constants/constants.d.ts → NotificationServicesController/constants/constants.d.cts} +1 -1
- package/dist/NotificationServicesController/constants/constants.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/constants.d.mts +3 -0
- package/dist/NotificationServicesController/constants/constants.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/constants.mjs +3 -9
- package/dist/NotificationServicesController/constants/constants.mjs.map +1 -1
- package/dist/NotificationServicesController/constants/index.cjs +19 -0
- package/dist/NotificationServicesController/constants/index.cjs.map +1 -0
- package/dist/NotificationServicesController/constants/index.d.cts +3 -0
- package/dist/NotificationServicesController/constants/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/index.d.mts +3 -0
- package/dist/NotificationServicesController/constants/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/index.mjs +2 -28
- package/dist/NotificationServicesController/constants/index.mjs.map +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.cjs +170 -0
- package/dist/NotificationServicesController/constants/notification-schema.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/constants/notification-schema.d.ts → NotificationServicesController/constants/notification-schema.d.cts} +2 -2
- package/dist/NotificationServicesController/constants/notification-schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/notification-schema.d.mts +48 -0
- package/dist/NotificationServicesController/constants/notification-schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/notification-schema.mjs +165 -20
- package/dist/NotificationServicesController/constants/notification-schema.mjs.map +1 -1
- package/dist/NotificationServicesController/index.cjs +46 -0
- package/dist/NotificationServicesController/index.cjs.map +1 -0
- package/dist/NotificationServicesController/index.d.cts +14 -0
- package/dist/NotificationServicesController/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/index.d.mts +14 -0
- package/dist/NotificationServicesController/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/index.mjs +13 -86
- package/dist/NotificationServicesController/index.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/index.cjs +20 -0
- package/dist/NotificationServicesController/processors/index.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/index.d.cts +4 -0
- package/dist/NotificationServicesController/processors/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/index.d.mts +4 -0
- package/dist/NotificationServicesController/processors/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/index.mjs +3 -21
- package/dist/NotificationServicesController/processors/index.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +41 -0
- package/dist/{chunk-52CALMRA.js.map → NotificationServicesController/processors/process-feature-announcement.cjs.map} +1 -1
- package/dist/{types/NotificationServicesController/processors/process-feature-announcement.d.ts → NotificationServicesController/processors/process-feature-announcement.d.cts} +3 -3
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts +19 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +34 -8
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.cjs +50 -0
- package/dist/NotificationServicesController/processors/process-notifications.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/processors/process-notifications.d.ts → NotificationServicesController/processors/process-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/processors/process-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-notifications.d.mts +19 -0
- package/dist/NotificationServicesController/processors/process-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/process-notifications.mjs +44 -12
- package/dist/NotificationServicesController/processors/process-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.cjs +19 -0
- package/dist/NotificationServicesController/processors/process-onchain-notifications.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/processors/process-onchain-notifications.d.ts → NotificationServicesController/processors/process-onchain-notifications.d.cts} +3 -3
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts +10 -0
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +14 -7
- package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/services/feature-announcements.cjs +97 -0
- package/dist/NotificationServicesController/services/feature-announcements.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/services/feature-announcements.d.ts → NotificationServicesController/services/feature-announcements.d.cts} +4 -4
- package/dist/NotificationServicesController/services/feature-announcements.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/feature-announcements.d.mts +28 -0
- package/dist/NotificationServicesController/services/feature-announcements.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/feature-announcements.mjs +91 -12
- package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -1
- package/dist/NotificationServicesController/services/onchain-notifications.cjs +195 -0
- package/dist/NotificationServicesController/services/onchain-notifications.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/services/onchain-notifications.d.ts → NotificationServicesController/services/onchain-notifications.d.cts} +3 -3
- package/dist/NotificationServicesController/services/onchain-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/onchain-notifications.d.mts +62 -0
- package/dist/NotificationServicesController/services/onchain-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/onchain-notifications.mjs +190 -29
- package/dist/NotificationServicesController/services/onchain-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs +3 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts → NotificationServicesController/types/feature-announcement/feature-announcement.d.cts} +3 -3
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts +32 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs.map +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/index.cjs +20 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.d.cts +4 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.d.mts +4 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.mjs +3 -4
- package/dist/NotificationServicesController/types/feature-announcement/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs +3 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts → NotificationServicesController/types/feature-announcement/type-feature-announcement.d.cts} +3 -3
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts +39 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs.map +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-links.cjs +3 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/feature-announcement/type-links.d.ts → NotificationServicesController/types/feature-announcement/type-links.d.cts} +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-links.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.d.mts +29 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs +1 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs.map +1 -1
- package/dist/NotificationServicesController/types/index.cjs +21 -0
- package/dist/NotificationServicesController/types/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/index.d.cts +5 -0
- package/dist/NotificationServicesController/types/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/index.d.mts +5 -0
- package/dist/NotificationServicesController/types/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/index.mjs +4 -11
- package/dist/NotificationServicesController/types/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/notification/index.cjs +18 -0
- package/dist/NotificationServicesController/types/notification/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/notification/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/notification/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification/index.mjs +1 -2
- package/dist/NotificationServicesController/types/notification/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/notification/notification.cjs +3 -0
- package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/notification/notification.d.ts → NotificationServicesController/types/notification/notification.d.cts} +4 -4
- package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.d.mts +25 -0
- package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.mjs +1 -1
- package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/index.cjs +18 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/index.mjs +1 -2
- package/dist/NotificationServicesController/types/on-chain-notification/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.cjs +3 -0
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.ts → NotificationServicesController/types/on-chain-notification/on-chain-notification.d.cts} +4 -4
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.mts +43 -0
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs.map +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.cjs +9 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/on-chain-notification/schema.d.ts → NotificationServicesController/types/on-chain-notification/schema.d.cts} +1 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.mts +283 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.mjs +7 -0
- package/dist/NotificationServicesController/types/on-chain-notification/schema.mjs.map +1 -1
- package/dist/NotificationServicesController/types/type-utils.cjs +3 -0
- package/dist/NotificationServicesController/types/type-utils.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/type-utils.d.ts → NotificationServicesController/types/type-utils.d.cts} +1 -1
- package/dist/NotificationServicesController/types/type-utils.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/type-utils.d.mts +7 -0
- package/dist/NotificationServicesController/types/type-utils.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/type-utils.mjs +1 -0
- package/dist/NotificationServicesController/types/type-utils.mjs.map +1 -1
- package/dist/NotificationServicesController/types/user-storage/index.cjs +18 -0
- package/dist/NotificationServicesController/types/user-storage/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/user-storage/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/user-storage/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/index.mjs +1 -2
- package/dist/NotificationServicesController/types/user-storage/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/user-storage/user-storage.cjs +3 -0
- package/dist/NotificationServicesController/types/user-storage/user-storage.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/types/user-storage/user-storage.d.ts → NotificationServicesController/types/user-storage/user-storage.d.cts} +3 -3
- package/dist/NotificationServicesController/types/user-storage/user-storage.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/user-storage.d.mts +26 -0
- package/dist/NotificationServicesController/types/user-storage/user-storage.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/user-storage/user-storage.mjs +1 -1
- package/dist/NotificationServicesController/types/user-storage/user-storage.mjs.map +1 -1
- package/dist/NotificationServicesController/ui/constants.cjs +62 -0
- package/dist/NotificationServicesController/ui/constants.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/ui/constants.d.ts → NotificationServicesController/ui/constants.d.cts} +2 -2
- package/dist/NotificationServicesController/ui/constants.d.cts.map +1 -0
- package/dist/NotificationServicesController/ui/constants.d.mts +54 -0
- package/dist/NotificationServicesController/ui/constants.d.mts.map +1 -0
- package/dist/NotificationServicesController/ui/constants.mjs +56 -14
- package/dist/NotificationServicesController/ui/constants.mjs.map +1 -1
- package/dist/NotificationServicesController/ui/index.cjs +18 -0
- package/dist/NotificationServicesController/ui/index.cjs.map +1 -0
- package/dist/NotificationServicesController/ui/index.d.cts +2 -0
- package/dist/NotificationServicesController/ui/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/ui/index.d.mts +2 -0
- package/dist/NotificationServicesController/ui/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/ui/index.mjs +1 -16
- package/dist/NotificationServicesController/ui/index.mjs.map +1 -1
- package/dist/NotificationServicesController/utils/utils.cjs +348 -0
- package/dist/NotificationServicesController/utils/utils.cjs.map +1 -0
- package/dist/{types/NotificationServicesController/utils/utils.d.ts → NotificationServicesController/utils/utils.d.cts} +3 -3
- package/dist/NotificationServicesController/utils/utils.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/utils.d.mts +142 -0
- package/dist/NotificationServicesController/utils/utils.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/utils.mjs +332 -31
- package/dist/NotificationServicesController/utils/utils.mjs.map +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs +215 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/NotificationServicesPushController.d.ts → NotificationServicesPushController/NotificationServicesPushController.d.cts} +6 -6
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +112 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +214 -37
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -1
- package/dist/NotificationServicesPushController/__fixtures__/index.cjs +18 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.d.cts +2 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.d.mts +2 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.mjs +2 -0
- package/dist/NotificationServicesPushController/__fixtures__/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.cjs +57 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/__fixtures__/mockResponse.d.ts → NotificationServicesPushController/__fixtures__/mockResponse.d.cts} +2 -2
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.d.mts +43 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.mjs +50 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockResponse.mjs.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.cjs +31 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/__fixtures__/mockServices.d.ts → NotificationServicesPushController/__fixtures__/mockServices.d.cts} +2 -2
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.mts +9 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.mjs +30 -0
- package/dist/NotificationServicesPushController/__fixtures__/mockServices.mjs.map +1 -0
- package/dist/NotificationServicesPushController/constants.cjs +14 -0
- package/dist/NotificationServicesPushController/constants.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/constants.d.ts → NotificationServicesPushController/constants.d.cts} +1 -1
- package/dist/NotificationServicesPushController/constants.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/constants.d.mts +11 -0
- package/dist/NotificationServicesPushController/constants.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/constants.mjs +10 -25
- package/dist/NotificationServicesPushController/constants.mjs.map +1 -1
- package/dist/NotificationServicesPushController/index.cjs +43 -0
- package/dist/NotificationServicesPushController/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/index.d.cts +11 -0
- package/dist/NotificationServicesPushController/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/index.d.mts +11 -0
- package/dist/NotificationServicesPushController/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/index.mjs +10 -71
- package/dist/NotificationServicesPushController/index.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.cjs +6 -0
- package/dist/NotificationServicesPushController/services/endpoints.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/services/endpoints.d.ts → NotificationServicesPushController/services/endpoints.d.cts} +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/endpoints.d.mts +2 -0
- package/dist/NotificationServicesPushController/services/endpoints.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/endpoints.mjs +2 -7
- package/dist/NotificationServicesPushController/services/endpoints.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/push/index.cjs +3 -0
- package/dist/NotificationServicesPushController/services/push/index.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/services/push/index.d.ts → NotificationServicesPushController/services/push/index.d.cts} +2 -2
- package/dist/NotificationServicesPushController/services/push/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/push/index.d.mts +6 -0
- package/dist/NotificationServicesPushController/services/push/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/push/index.mjs +1 -0
- package/dist/NotificationServicesPushController/services/push/index.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/push/push-web.cjs +121 -0
- package/dist/NotificationServicesPushController/services/push/push-web.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/services/push/push-web.d.ts → NotificationServicesPushController/services/push/push-web.d.cts} +3 -3
- package/dist/NotificationServicesPushController/services/push/push-web.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/push/push-web.d.mts +32 -0
- package/dist/NotificationServicesPushController/services/push/push-web.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/push/push-web.mjs +116 -38
- package/dist/NotificationServicesPushController/services/push/push-web.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/services.cjs +197 -0
- package/dist/NotificationServicesPushController/services/services.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/services/services.d.ts → NotificationServicesPushController/services/services.d.cts} +4 -4
- package/dist/NotificationServicesPushController/services/services.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/services.d.mts +95 -0
- package/dist/NotificationServicesPushController/services/services.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/services.mjs +168 -45
- package/dist/NotificationServicesPushController/services/services.mjs.map +1 -1
- package/dist/NotificationServicesPushController/types/firebase.cjs +3 -0
- package/dist/NotificationServicesPushController/types/firebase.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/types/firebase.d.ts → NotificationServicesPushController/types/firebase.d.cts} +1 -1
- package/dist/NotificationServicesPushController/types/firebase.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/firebase.d.mts +53 -0
- package/dist/NotificationServicesPushController/types/firebase.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/firebase.mjs +1 -1
- package/dist/NotificationServicesPushController/types/firebase.mjs.map +1 -1
- package/dist/NotificationServicesPushController/types/index.cjs +18 -0
- package/dist/NotificationServicesPushController/types/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/index.d.cts +2 -0
- package/dist/NotificationServicesPushController/types/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/index.d.mts +2 -0
- package/dist/NotificationServicesPushController/types/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/index.mjs +1 -2
- package/dist/NotificationServicesPushController/types/index.mjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs +84 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/utils/get-notification-data.d.ts → NotificationServicesPushController/utils/get-notification-data.d.cts} +2 -2
- package/dist/NotificationServicesPushController/utils/get-notification-data.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.d.mts +42 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.mjs +76 -12
- package/dist/NotificationServicesPushController/utils/get-notification-data.mjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +190 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +1 -0
- package/dist/{types/NotificationServicesPushController/utils/get-notification-message.d.ts → NotificationServicesPushController/utils/get-notification-message.d.cts} +3 -3
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts +67 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +182 -37
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/index.cjs +19 -0
- package/dist/NotificationServicesPushController/utils/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.d.cts +3 -0
- package/dist/NotificationServicesPushController/utils/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.d.mts +3 -0
- package/dist/NotificationServicesPushController/utils/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.mjs +2 -48
- package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -1
- package/dist/index.cjs +29 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +3 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +3 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -45
- package/dist/index.mjs.map +1 -1
- package/dist/shared/to-raw-notification.cjs +19 -0
- package/dist/shared/to-raw-notification.cjs.map +1 -0
- package/dist/{types/shared/to-raw-notification.d.ts → shared/to-raw-notification.d.cts} +2 -2
- package/dist/shared/to-raw-notification.d.cts.map +1 -0
- package/dist/shared/to-raw-notification.d.mts +11 -0
- package/dist/shared/to-raw-notification.d.mts.map +1 -0
- package/dist/shared/to-raw-notification.mjs +14 -7
- package/dist/shared/to-raw-notification.mjs.map +1 -1
- package/package.json +12 -7
- package/dist/NotificationServicesController/NotificationServicesController.js +0 -19
- package/dist/NotificationServicesController/NotificationServicesController.js.map +0 -1
- package/dist/NotificationServicesController/constants/constants.js +0 -10
- package/dist/NotificationServicesController/constants/constants.js.map +0 -1
- package/dist/NotificationServicesController/constants/index.js +0 -29
- package/dist/NotificationServicesController/constants/index.js.map +0 -1
- package/dist/NotificationServicesController/constants/notification-schema.js +0 -22
- package/dist/NotificationServicesController/constants/notification-schema.js.map +0 -1
- package/dist/NotificationServicesController/index.js +0 -87
- package/dist/NotificationServicesController/index.js.map +0 -1
- package/dist/NotificationServicesController/processors/index.js +0 -22
- package/dist/NotificationServicesController/processors/index.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.js +0 -10
- package/dist/NotificationServicesController/processors/process-feature-announcement.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-notifications.js +0 -13
- package/dist/NotificationServicesController/processors/process-notifications.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.js +0 -8
- package/dist/NotificationServicesController/processors/process-onchain-notifications.js.map +0 -1
- package/dist/NotificationServicesController/services/feature-announcements.js +0 -14
- package/dist/NotificationServicesController/services/feature-announcements.js.map +0 -1
- package/dist/NotificationServicesController/services/onchain-notifications.js +0 -30
- package/dist/NotificationServicesController/services/onchain-notifications.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js +0 -2
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/index.js +0 -5
- package/dist/NotificationServicesController/types/feature-announcement/index.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js +0 -2
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-links.js +0 -2
- package/dist/NotificationServicesController/types/feature-announcement/type-links.js.map +0 -1
- package/dist/NotificationServicesController/types/index.js +0 -12
- package/dist/NotificationServicesController/types/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification/index.js +0 -3
- package/dist/NotificationServicesController/types/notification/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification/notification.js +0 -2
- package/dist/NotificationServicesController/types/notification/notification.js.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/index.js +0 -3
- package/dist/NotificationServicesController/types/on-chain-notification/index.js.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.js +0 -2
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.js.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.js +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.js.map +0 -1
- package/dist/NotificationServicesController/types/type-utils.js +0 -1
- package/dist/NotificationServicesController/types/type-utils.js.map +0 -1
- package/dist/NotificationServicesController/types/user-storage/index.js +0 -3
- package/dist/NotificationServicesController/types/user-storage/index.js.map +0 -1
- package/dist/NotificationServicesController/types/user-storage/user-storage.js +0 -2
- package/dist/NotificationServicesController/types/user-storage/user-storage.js.map +0 -1
- package/dist/NotificationServicesController/ui/constants.js +0 -16
- package/dist/NotificationServicesController/ui/constants.js.map +0 -1
- package/dist/NotificationServicesController/ui/index.js +0 -17
- package/dist/NotificationServicesController/ui/index.js.map +0 -1
- package/dist/NotificationServicesController/utils/utils.js +0 -32
- package/dist/NotificationServicesController/utils/utils.js.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js +0 -39
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js.map +0 -1
- package/dist/NotificationServicesPushController/constants.js +0 -26
- package/dist/NotificationServicesPushController/constants.js.map +0 -1
- package/dist/NotificationServicesPushController/index.js +0 -72
- package/dist/NotificationServicesPushController/index.js.map +0 -1
- package/dist/NotificationServicesPushController/services/endpoints.js +0 -8
- package/dist/NotificationServicesPushController/services/endpoints.js.map +0 -1
- package/dist/NotificationServicesPushController/services/push/index.js +0 -1
- package/dist/NotificationServicesPushController/services/push/index.js.map +0 -1
- package/dist/NotificationServicesPushController/services/push/push-web.js +0 -40
- package/dist/NotificationServicesPushController/services/push/push-web.js.map +0 -1
- package/dist/NotificationServicesPushController/services/services.js +0 -46
- package/dist/NotificationServicesPushController/services/services.js.map +0 -1
- package/dist/NotificationServicesPushController/types/firebase.js +0 -2
- package/dist/NotificationServicesPushController/types/firebase.js.map +0 -1
- package/dist/NotificationServicesPushController/types/index.js +0 -3
- package/dist/NotificationServicesPushController/types/index.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.js +0 -14
- package/dist/NotificationServicesPushController/utils/get-notification-data.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.js +0 -39
- package/dist/NotificationServicesPushController/utils/get-notification-message.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/index.js +0 -49
- package/dist/NotificationServicesPushController/utils/index.js.map +0 -1
- package/dist/chunk-232HZSEV.js +0 -7
- package/dist/chunk-232HZSEV.js.map +0 -1
- package/dist/chunk-2P5WP5NT.mjs +0 -37
- package/dist/chunk-2P5WP5NT.mjs.map +0 -1
- package/dist/chunk-3ZS2HAEG.js +0 -1
- package/dist/chunk-3ZS2HAEG.js.map +0 -1
- package/dist/chunk-4BTNTREI.mjs +0 -1
- package/dist/chunk-4BTNTREI.mjs.map +0 -1
- package/dist/chunk-4QXAPVW3.mjs +0 -1
- package/dist/chunk-4QXAPVW3.mjs.map +0 -1
- package/dist/chunk-52CALMRA.js +0 -28
- package/dist/chunk-53F3SYYM.mjs +0 -178
- package/dist/chunk-53F3SYYM.mjs.map +0 -1
- package/dist/chunk-5FAAZCBK.mjs +0 -29
- package/dist/chunk-5FAAZCBK.mjs.map +0 -1
- package/dist/chunk-6FLC6CJD.js +0 -149
- package/dist/chunk-6FLC6CJD.js.map +0 -1
- package/dist/chunk-6ZDVTRRT.mjs +0 -9
- package/dist/chunk-6ZDVTRRT.mjs.map +0 -1
- package/dist/chunk-77QIITUL.mjs +0 -67
- package/dist/chunk-77QIITUL.mjs.map +0 -1
- package/dist/chunk-7LWR54U7.js +0 -7
- package/dist/chunk-7LWR54U7.js.map +0 -1
- package/dist/chunk-7PWKQSM2.mjs +0 -972
- package/dist/chunk-7PWKQSM2.mjs.map +0 -1
- package/dist/chunk-7RM3YNTD.mjs +0 -1
- package/dist/chunk-7RM3YNTD.mjs.map +0 -1
- package/dist/chunk-A2RPVX47.mjs +0 -1
- package/dist/chunk-A2RPVX47.mjs.map +0 -1
- package/dist/chunk-B25TJ7KS.js +0 -8
- package/dist/chunk-B25TJ7KS.js.map +0 -1
- package/dist/chunk-B4ECJJ5C.mjs +0 -7
- package/dist/chunk-B4ECJJ5C.mjs.map +0 -1
- package/dist/chunk-BONB66A2.mjs +0 -14
- package/dist/chunk-BONB66A2.mjs.map +0 -1
- package/dist/chunk-C62SK2KY.mjs +0 -92
- package/dist/chunk-C62SK2KY.mjs.map +0 -1
- package/dist/chunk-CGPMMFUQ.mjs +0 -96
- package/dist/chunk-CGPMMFUQ.mjs.map +0 -1
- package/dist/chunk-CWZQMK63.mjs +0 -118
- package/dist/chunk-CWZQMK63.mjs.map +0 -1
- package/dist/chunk-D42BBXBM.mjs +0 -28
- package/dist/chunk-D42BBXBM.mjs.map +0 -1
- package/dist/chunk-DINCLRZT.mjs +0 -12
- package/dist/chunk-DINCLRZT.mjs.map +0 -1
- package/dist/chunk-DMH4NSLF.js +0 -1
- package/dist/chunk-DMH4NSLF.js.map +0 -1
- package/dist/chunk-DT6SLUWJ.js +0 -12
- package/dist/chunk-DT6SLUWJ.js.map +0 -1
- package/dist/chunk-EJ52BDLB.js +0 -55
- package/dist/chunk-EJ52BDLB.js.map +0 -1
- package/dist/chunk-ER475D6V.mjs +0 -231
- package/dist/chunk-ER475D6V.mjs.map +0 -1
- package/dist/chunk-G52DNXFH.mjs +0 -1
- package/dist/chunk-G52DNXFH.mjs.map +0 -1
- package/dist/chunk-GETQWOTI.js +0 -1
- package/dist/chunk-GETQWOTI.js.map +0 -1
- package/dist/chunk-HCDICNYK.js +0 -207
- package/dist/chunk-HCDICNYK.js.map +0 -1
- package/dist/chunk-HE3P5RM7.js +0 -178
- package/dist/chunk-HE3P5RM7.js.map +0 -1
- package/dist/chunk-HPUQYDVC.js +0 -1
- package/dist/chunk-HPUQYDVC.js.map +0 -1
- package/dist/chunk-HT6T5R4U.js +0 -96
- package/dist/chunk-HT6T5R4U.js.map +0 -1
- package/dist/chunk-IDO4JFV5.mjs +0 -1
- package/dist/chunk-IDO4JFV5.mjs.map +0 -1
- package/dist/chunk-IGY2S5BC.js +0 -36
- package/dist/chunk-IGY2S5BC.js.map +0 -1
- package/dist/chunk-IKWNHNJQ.mjs +0 -8
- package/dist/chunk-IKWNHNJQ.mjs.map +0 -1
- package/dist/chunk-IOMDG67D.mjs +0 -7
- package/dist/chunk-IOMDG67D.mjs.map +0 -1
- package/dist/chunk-IPI7BAW3.js +0 -1
- package/dist/chunk-IPI7BAW3.js.map +0 -1
- package/dist/chunk-JIJXHO5V.js +0 -885
- package/dist/chunk-JIJXHO5V.js.map +0 -1
- package/dist/chunk-JQ7WKFCI.mjs +0 -1
- package/dist/chunk-JQ7WKFCI.mjs.map +0 -1
- package/dist/chunk-JW3TK3NU.js +0 -221
- package/dist/chunk-JW3TK3NU.js.map +0 -1
- package/dist/chunk-KGLHGLER.js +0 -231
- package/dist/chunk-KGLHGLER.js.map +0 -1
- package/dist/chunk-LGXHJ24K.js +0 -92
- package/dist/chunk-LGXHJ24K.js.map +0 -1
- package/dist/chunk-LYEXYTOI.js +0 -14
- package/dist/chunk-LYEXYTOI.js.map +0 -1
- package/dist/chunk-LZMC2QML.mjs +0 -25
- package/dist/chunk-LZMC2QML.mjs.map +0 -1
- package/dist/chunk-MG5QDUDI.mjs +0 -48
- package/dist/chunk-MG5QDUDI.mjs.map +0 -1
- package/dist/chunk-MNBV5FJI.mjs +0 -31
- package/dist/chunk-MNBV5FJI.mjs.map +0 -1
- package/dist/chunk-NIPCK74T.js +0 -185
- package/dist/chunk-NIPCK74T.js.map +0 -1
- package/dist/chunk-O45HYLIV.js +0 -67
- package/dist/chunk-O45HYLIV.js.map +0 -1
- package/dist/chunk-ODI2BTKS.mjs +0 -55
- package/dist/chunk-ODI2BTKS.mjs.map +0 -1
- package/dist/chunk-OHFX4S6R.mjs +0 -185
- package/dist/chunk-OHFX4S6R.mjs.map +0 -1
- package/dist/chunk-OMBFVTP2.js +0 -37
- package/dist/chunk-OMBFVTP2.js.map +0 -1
- package/dist/chunk-PJMQ2XEG.js +0 -29
- package/dist/chunk-PJMQ2XEG.js.map +0 -1
- package/dist/chunk-PNCS6GEX.mjs +0 -1
- package/dist/chunk-PNCS6GEX.mjs.map +0 -1
- package/dist/chunk-PROWNV4M.js +0 -1
- package/dist/chunk-PROWNV4M.js.map +0 -1
- package/dist/chunk-QAOZN4AX.js +0 -25
- package/dist/chunk-QAOZN4AX.js.map +0 -1
- package/dist/chunk-QB5IFRLA.mjs +0 -1
- package/dist/chunk-QB5IFRLA.mjs.map +0 -1
- package/dist/chunk-RAUV5UV4.mjs +0 -1
- package/dist/chunk-RAUV5UV4.mjs.map +0 -1
- package/dist/chunk-SGLVWM4N.js +0 -48
- package/dist/chunk-SGLVWM4N.js.map +0 -1
- package/dist/chunk-TLX5QQK5.js +0 -9
- package/dist/chunk-TLX5QQK5.js.map +0 -1
- package/dist/chunk-U5UIDVOO.mjs +0 -36
- package/dist/chunk-U5UIDVOO.mjs.map +0 -1
- package/dist/chunk-U74Q3BRP.mjs +0 -1
- package/dist/chunk-U74Q3BRP.mjs.map +0 -1
- package/dist/chunk-UQ6MTYIR.js +0 -972
- package/dist/chunk-UQ6MTYIR.js.map +0 -1
- package/dist/chunk-UZHUVXRM.js +0 -31
- package/dist/chunk-UZHUVXRM.js.map +0 -1
- package/dist/chunk-V5HMYDWE.js +0 -1
- package/dist/chunk-V5HMYDWE.js.map +0 -1
- package/dist/chunk-VZMQIJMK.mjs +0 -149
- package/dist/chunk-VZMQIJMK.mjs.map +0 -1
- package/dist/chunk-W7IP4LDB.js +0 -118
- package/dist/chunk-W7IP4LDB.js.map +0 -1
- package/dist/chunk-WE4RFGT7.mjs +0 -885
- package/dist/chunk-WE4RFGT7.mjs.map +0 -1
- package/dist/chunk-WGBEAP2F.mjs +0 -207
- package/dist/chunk-WGBEAP2F.mjs.map +0 -1
- package/dist/chunk-WRYFIWNK.js +0 -1
- package/dist/chunk-WRYFIWNK.js.map +0 -1
- package/dist/chunk-XZEVRYUE.js +0 -1
- package/dist/chunk-XZEVRYUE.js.map +0 -1
- package/dist/chunk-YUMIJSUD.mjs +0 -221
- package/dist/chunk-YUMIJSUD.mjs.map +0 -1
- package/dist/chunk-ZBNBZN5H.js +0 -1
- package/dist/chunk-ZBNBZN5H.js.map +0 -1
- package/dist/chunk-ZV3DFBO4.js +0 -1
- package/dist/chunk-ZV3DFBO4.js.map +0 -1
- package/dist/index.js +0 -46
- package/dist/index.js.map +0 -1
- package/dist/shared/to-raw-notification.js +0 -8
- package/dist/shared/to-raw-notification.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/NotificationServicesController/NotificationServicesController.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/index.d.ts +0 -6
- package/dist/types/NotificationServicesController/__fixtures__/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mock-feature-announcements.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mock-notification-trigger.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mock-notification-user-storage.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mock-raw-notifications.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mockResponses.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/mockServices.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/test-utils.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/constants/constants.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/constants/index.d.ts +0 -3
- package/dist/types/NotificationServicesController/constants/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/constants/notification-schema.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/index.d.ts +0 -14
- package/dist/types/NotificationServicesController/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/processors/index.d.ts +0 -4
- package/dist/types/NotificationServicesController/processors/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/processors/process-feature-announcement.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/processors/process-notifications.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/processors/process-onchain-notifications.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/services/feature-announcements.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/services/onchain-notifications.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/feature-announcement/index.d.ts +0 -4
- package/dist/types/NotificationServicesController/types/feature-announcement/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/feature-announcement/type-links.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/index.d.ts +0 -5
- package/dist/types/NotificationServicesController/types/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/notification/index.d.ts +0 -2
- package/dist/types/NotificationServicesController/types/notification/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/notification/notification.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/on-chain-notification/index.d.ts +0 -2
- package/dist/types/NotificationServicesController/types/on-chain-notification/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/on-chain-notification/schema.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/type-utils.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/user-storage/index.d.ts +0 -2
- package/dist/types/NotificationServicesController/types/user-storage/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/types/user-storage/user-storage.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/ui/constants.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/ui/index.d.ts +0 -2
- package/dist/types/NotificationServicesController/ui/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesController/utils/utils.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts +0 -2
- package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/mockResponse.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/mockServices.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/constants.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/index.d.ts +0 -11
- package/dist/types/NotificationServicesPushController/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/services/endpoints.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/services/push/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/services/push/push-web.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/services/services.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/types/firebase.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/types/index.d.ts +0 -2
- package/dist/types/NotificationServicesPushController/types/index.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/utils/get-notification-data.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/utils/get-notification-message.d.ts.map +0 -1
- package/dist/types/NotificationServicesPushController/utils/index.d.ts +0 -3
- package/dist/types/NotificationServicesPushController/utils/index.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/shared/to-raw-notification.d.ts.map +0 -1
package/dist/chunk-WE4RFGT7.mjs
DELETED
|
@@ -1,885 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
safeProcessNotification
|
|
3
|
-
} from "./chunk-MG5QDUDI.mjs";
|
|
4
|
-
import {
|
|
5
|
-
getFeatureAnnouncementNotifications
|
|
6
|
-
} from "./chunk-C62SK2KY.mjs";
|
|
7
|
-
import {
|
|
8
|
-
createOnChainTriggers,
|
|
9
|
-
deleteOnChainTriggers,
|
|
10
|
-
getOnChainNotifications,
|
|
11
|
-
markNotificationsAsRead
|
|
12
|
-
} from "./chunk-OHFX4S6R.mjs";
|
|
13
|
-
import {
|
|
14
|
-
checkAccountsPresence,
|
|
15
|
-
getAllUUIDs,
|
|
16
|
-
getUUIDsForAccount,
|
|
17
|
-
initializeUserStorage,
|
|
18
|
-
traverseUserStorageTriggers,
|
|
19
|
-
upsertAddressTriggers
|
|
20
|
-
} from "./chunk-YUMIJSUD.mjs";
|
|
21
|
-
import {
|
|
22
|
-
USER_STORAGE_VERSION_KEY
|
|
23
|
-
} from "./chunk-6ZDVTRRT.mjs";
|
|
24
|
-
import {
|
|
25
|
-
__privateAdd,
|
|
26
|
-
__privateGet,
|
|
27
|
-
__privateMethod,
|
|
28
|
-
__privateSet
|
|
29
|
-
} from "./chunk-U5UIDVOO.mjs";
|
|
30
|
-
|
|
31
|
-
// src/NotificationServicesController/NotificationServicesController.ts
|
|
32
|
-
import { BaseController } from "@metamask/base-controller";
|
|
33
|
-
import { toChecksumHexAddress } from "@metamask/controller-utils";
|
|
34
|
-
import log from "loglevel";
|
|
35
|
-
var controllerName = "NotificationServicesController";
|
|
36
|
-
var metadata = {
|
|
37
|
-
subscriptionAccountsSeen: {
|
|
38
|
-
persist: true,
|
|
39
|
-
anonymous: true
|
|
40
|
-
},
|
|
41
|
-
isMetamaskNotificationsFeatureSeen: {
|
|
42
|
-
persist: true,
|
|
43
|
-
anonymous: false
|
|
44
|
-
},
|
|
45
|
-
isNotificationServicesEnabled: {
|
|
46
|
-
persist: true,
|
|
47
|
-
anonymous: false
|
|
48
|
-
},
|
|
49
|
-
isFeatureAnnouncementsEnabled: {
|
|
50
|
-
persist: true,
|
|
51
|
-
anonymous: false
|
|
52
|
-
},
|
|
53
|
-
metamaskNotificationsList: {
|
|
54
|
-
persist: true,
|
|
55
|
-
anonymous: true
|
|
56
|
-
},
|
|
57
|
-
metamaskNotificationsReadList: {
|
|
58
|
-
persist: true,
|
|
59
|
-
anonymous: true
|
|
60
|
-
},
|
|
61
|
-
isUpdatingMetamaskNotifications: {
|
|
62
|
-
persist: false,
|
|
63
|
-
anonymous: false
|
|
64
|
-
},
|
|
65
|
-
isFetchingMetamaskNotifications: {
|
|
66
|
-
persist: false,
|
|
67
|
-
anonymous: false
|
|
68
|
-
},
|
|
69
|
-
isUpdatingMetamaskNotificationsAccount: {
|
|
70
|
-
persist: false,
|
|
71
|
-
anonymous: false
|
|
72
|
-
},
|
|
73
|
-
isCheckingAccountsPresence: {
|
|
74
|
-
persist: false,
|
|
75
|
-
anonymous: false
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
var defaultState = {
|
|
79
|
-
subscriptionAccountsSeen: [],
|
|
80
|
-
isMetamaskNotificationsFeatureSeen: false,
|
|
81
|
-
isNotificationServicesEnabled: false,
|
|
82
|
-
isFeatureAnnouncementsEnabled: false,
|
|
83
|
-
metamaskNotificationsList: [],
|
|
84
|
-
metamaskNotificationsReadList: [],
|
|
85
|
-
isUpdatingMetamaskNotifications: false,
|
|
86
|
-
isFetchingMetamaskNotifications: false,
|
|
87
|
-
isUpdatingMetamaskNotificationsAccount: [],
|
|
88
|
-
isCheckingAccountsPresence: false
|
|
89
|
-
};
|
|
90
|
-
var _isPushIntegrated, _isPushNotificationsSetup, _isUnlocked, _keyringController, _auth, _storage, _pushNotifications, _accounts, _featureAnnouncementEnv, _registerMessageHandlers, registerMessageHandlers_fn, _clearLoadingStates, clearLoadingStates_fn, _assertAuthEnabled, assertAuthEnabled_fn, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn, _performEnableProfileSyncing, _assertUserStorage, assertUserStorage_fn, _getUserStorage, getUserStorage_fn, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn;
|
|
91
|
-
var NotificationServicesController = class extends BaseController {
|
|
92
|
-
/**
|
|
93
|
-
* Creates a NotificationServicesController instance.
|
|
94
|
-
*
|
|
95
|
-
* @param args - The arguments to this function.
|
|
96
|
-
* @param args.messenger - Messenger used to communicate with BaseV2 controller.
|
|
97
|
-
* @param args.state - Initial state to set on this controller.
|
|
98
|
-
* @param args.env - environment variables for a given controller.
|
|
99
|
-
* @param args.env.featureAnnouncements - env variables for feature announcements.
|
|
100
|
-
* @param args.env.isPushIntegrated - toggle push notifications on/off if client has integrated them.
|
|
101
|
-
*/
|
|
102
|
-
constructor({
|
|
103
|
-
messenger,
|
|
104
|
-
state,
|
|
105
|
-
env
|
|
106
|
-
}) {
|
|
107
|
-
super({
|
|
108
|
-
messenger,
|
|
109
|
-
metadata,
|
|
110
|
-
name: controllerName,
|
|
111
|
-
state: { ...defaultState, ...state }
|
|
112
|
-
});
|
|
113
|
-
__privateAdd(this, _registerMessageHandlers);
|
|
114
|
-
__privateAdd(this, _clearLoadingStates);
|
|
115
|
-
__privateAdd(this, _assertAuthEnabled);
|
|
116
|
-
__privateAdd(this, _getValidStorageKeyAndBearerToken);
|
|
117
|
-
__privateAdd(this, _assertUserStorage);
|
|
118
|
-
/**
|
|
119
|
-
* Retrieves and parses the user storage from the storage key.
|
|
120
|
-
*
|
|
121
|
-
* This method attempts to retrieve the user storage using the specified storage key,
|
|
122
|
-
* then parses the JSON string to an object. If the storage is not found or cannot be parsed,
|
|
123
|
-
* it throws an error.
|
|
124
|
-
*
|
|
125
|
-
* @returns The parsed user storage object or null
|
|
126
|
-
*/
|
|
127
|
-
__privateAdd(this, _getUserStorage);
|
|
128
|
-
/**
|
|
129
|
-
* Sets the state of notification creation process.
|
|
130
|
-
*
|
|
131
|
-
* This method updates the `isUpdatingMetamaskNotifications` state, which can be used to indicate
|
|
132
|
-
* whether the notification creation process is currently active or not. This is useful
|
|
133
|
-
* for UI elements that need to reflect the state of ongoing operations, such as loading
|
|
134
|
-
* indicators or disabled buttons during processing.
|
|
135
|
-
*
|
|
136
|
-
* @param isUpdatingMetamaskNotifications - A boolean value representing the new state of the notification creation process.
|
|
137
|
-
*/
|
|
138
|
-
__privateAdd(this, _setIsUpdatingMetamaskNotifications);
|
|
139
|
-
/**
|
|
140
|
-
* Updates the state to indicate whether fetching of MetaMask notifications is in progress.
|
|
141
|
-
*
|
|
142
|
-
* This method is used to set the `isFetchingMetamaskNotifications` state, which can be utilized
|
|
143
|
-
* to show or hide loading indicators in the UI when notifications are being fetched.
|
|
144
|
-
*
|
|
145
|
-
* @param isFetchingMetamaskNotifications - A boolean value representing the fetching state.
|
|
146
|
-
*/
|
|
147
|
-
__privateAdd(this, _setIsFetchingMetamaskNotifications);
|
|
148
|
-
/**
|
|
149
|
-
* Updates the state to indicate that the checking of accounts presence is in progress.
|
|
150
|
-
*
|
|
151
|
-
* This method modifies the `isCheckingAccountsPresence` state, which can be used to manage UI elements
|
|
152
|
-
* that depend on the status of account presence checks, such as displaying loading indicators or disabling
|
|
153
|
-
* buttons while the check is ongoing.
|
|
154
|
-
*
|
|
155
|
-
* @param isCheckingAccountsPresence - A boolean value indicating whether the account presence check is currently active.
|
|
156
|
-
*/
|
|
157
|
-
__privateAdd(this, _setIsCheckingAccountsPresence);
|
|
158
|
-
/**
|
|
159
|
-
* Updates the state to indicate that account updates are in progress.
|
|
160
|
-
* Removes duplicate accounts before updating the state.
|
|
161
|
-
*
|
|
162
|
-
* @param accounts - The accounts being updated.
|
|
163
|
-
*/
|
|
164
|
-
__privateAdd(this, _updateUpdatingAccountsState);
|
|
165
|
-
/**
|
|
166
|
-
* Clears the state indicating that account updates are complete.
|
|
167
|
-
*
|
|
168
|
-
* @param accounts - The accounts that have finished updating.
|
|
169
|
-
*/
|
|
170
|
-
__privateAdd(this, _clearUpdatingAccountsState);
|
|
171
|
-
// Temporary boolean as push notifications are not yet enabled on mobile
|
|
172
|
-
__privateAdd(this, _isPushIntegrated, true);
|
|
173
|
-
// Flag to check is notifications have been setup when the browser/extension is initialized.
|
|
174
|
-
// We want to re-initialize push notifications when the browser/extension is refreshed
|
|
175
|
-
// To ensure we subscribe to the most up-to-date notifications
|
|
176
|
-
__privateAdd(this, _isPushNotificationsSetup, false);
|
|
177
|
-
__privateAdd(this, _isUnlocked, false);
|
|
178
|
-
__privateAdd(this, _keyringController, {
|
|
179
|
-
setupLockedStateSubscriptions: (onUnlock) => {
|
|
180
|
-
const { isUnlocked } = this.messagingSystem.call(
|
|
181
|
-
"KeyringController:getState"
|
|
182
|
-
);
|
|
183
|
-
__privateSet(this, _isUnlocked, isUnlocked);
|
|
184
|
-
this.messagingSystem.subscribe("KeyringController:unlock", () => {
|
|
185
|
-
__privateSet(this, _isUnlocked, true);
|
|
186
|
-
onUnlock();
|
|
187
|
-
});
|
|
188
|
-
this.messagingSystem.subscribe("KeyringController:lock", () => {
|
|
189
|
-
__privateSet(this, _isUnlocked, false);
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
});
|
|
193
|
-
__privateAdd(this, _auth, {
|
|
194
|
-
getBearerToken: async () => {
|
|
195
|
-
return await this.messagingSystem.call(
|
|
196
|
-
"AuthenticationController:getBearerToken"
|
|
197
|
-
);
|
|
198
|
-
},
|
|
199
|
-
isSignedIn: () => {
|
|
200
|
-
return this.messagingSystem.call("AuthenticationController:isSignedIn");
|
|
201
|
-
}
|
|
202
|
-
});
|
|
203
|
-
__privateAdd(this, _storage, {
|
|
204
|
-
enableProfileSyncing: async () => {
|
|
205
|
-
return await this.messagingSystem.call(
|
|
206
|
-
"UserStorageController:enableProfileSyncing"
|
|
207
|
-
);
|
|
208
|
-
},
|
|
209
|
-
getStorageKey: () => {
|
|
210
|
-
return this.messagingSystem.call("UserStorageController:getStorageKey");
|
|
211
|
-
},
|
|
212
|
-
getNotificationStorage: async () => {
|
|
213
|
-
return await this.messagingSystem.call(
|
|
214
|
-
"UserStorageController:performGetStorage",
|
|
215
|
-
"notifications.notificationSettings"
|
|
216
|
-
);
|
|
217
|
-
},
|
|
218
|
-
setNotificationStorage: async (state) => {
|
|
219
|
-
return await this.messagingSystem.call(
|
|
220
|
-
"UserStorageController:performSetStorage",
|
|
221
|
-
"notifications.notificationSettings",
|
|
222
|
-
state
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
__privateAdd(this, _pushNotifications, {
|
|
227
|
-
subscribeToPushNotifications: async () => {
|
|
228
|
-
await this.messagingSystem.call(
|
|
229
|
-
"NotificationServicesPushController:subscribeToPushNotifications"
|
|
230
|
-
);
|
|
231
|
-
},
|
|
232
|
-
enablePushNotifications: async (UUIDs) => {
|
|
233
|
-
if (!__privateGet(this, _isPushIntegrated)) {
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
try {
|
|
237
|
-
await this.messagingSystem.call(
|
|
238
|
-
"NotificationServicesPushController:enablePushNotifications",
|
|
239
|
-
UUIDs
|
|
240
|
-
);
|
|
241
|
-
} catch (e) {
|
|
242
|
-
log.error("Silently failed to enable push notifications", e);
|
|
243
|
-
}
|
|
244
|
-
},
|
|
245
|
-
disablePushNotifications: async (UUIDs) => {
|
|
246
|
-
if (!__privateGet(this, _isPushIntegrated)) {
|
|
247
|
-
return;
|
|
248
|
-
}
|
|
249
|
-
try {
|
|
250
|
-
await this.messagingSystem.call(
|
|
251
|
-
"NotificationServicesPushController:disablePushNotifications",
|
|
252
|
-
UUIDs
|
|
253
|
-
);
|
|
254
|
-
} catch (e) {
|
|
255
|
-
log.error("Silently failed to disable push notifications", e);
|
|
256
|
-
}
|
|
257
|
-
},
|
|
258
|
-
updatePushNotifications: async (UUIDs) => {
|
|
259
|
-
if (!__privateGet(this, _isPushIntegrated)) {
|
|
260
|
-
return;
|
|
261
|
-
}
|
|
262
|
-
try {
|
|
263
|
-
await this.messagingSystem.call(
|
|
264
|
-
"NotificationServicesPushController:updateTriggerPushNotifications",
|
|
265
|
-
UUIDs
|
|
266
|
-
);
|
|
267
|
-
} catch (e) {
|
|
268
|
-
log.error("Silently failed to update push notifications", e);
|
|
269
|
-
}
|
|
270
|
-
},
|
|
271
|
-
subscribe: () => {
|
|
272
|
-
if (!__privateGet(this, _isPushIntegrated)) {
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
this.messagingSystem.subscribe(
|
|
276
|
-
"NotificationServicesPushController:onNewNotifications",
|
|
277
|
-
(notification) => {
|
|
278
|
-
this.updateMetamaskNotificationsList(notification);
|
|
279
|
-
}
|
|
280
|
-
);
|
|
281
|
-
},
|
|
282
|
-
initializePushNotifications: async () => {
|
|
283
|
-
if (!__privateGet(this, _isPushIntegrated)) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
if (!this.state.isNotificationServicesEnabled) {
|
|
287
|
-
return;
|
|
288
|
-
}
|
|
289
|
-
if (__privateGet(this, _isPushNotificationsSetup)) {
|
|
290
|
-
return;
|
|
291
|
-
}
|
|
292
|
-
if (__privateGet(this, _isUnlocked)) {
|
|
293
|
-
const storage = await __privateMethod(this, _getUserStorage, getUserStorage_fn).call(this);
|
|
294
|
-
if (!storage) {
|
|
295
|
-
return;
|
|
296
|
-
}
|
|
297
|
-
const uuids = getAllUUIDs(storage);
|
|
298
|
-
await __privateGet(this, _pushNotifications).enablePushNotifications(uuids);
|
|
299
|
-
__privateSet(this, _isPushNotificationsSetup, true);
|
|
300
|
-
} else {
|
|
301
|
-
await __privateGet(this, _pushNotifications).subscribeToPushNotifications();
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
__privateAdd(this, _accounts, {
|
|
306
|
-
/**
|
|
307
|
-
* Used to get list of addresses from keyring (wallet addresses)
|
|
308
|
-
*
|
|
309
|
-
* @returns addresses removed, added, and latest list of addresses
|
|
310
|
-
*/
|
|
311
|
-
listAccounts: async () => {
|
|
312
|
-
const nonChecksumAccounts = await this.messagingSystem.call(
|
|
313
|
-
"KeyringController:getAccounts"
|
|
314
|
-
);
|
|
315
|
-
const accounts = nonChecksumAccounts.map((a) => toChecksumHexAddress(a));
|
|
316
|
-
const currentAccountsSet = new Set(accounts);
|
|
317
|
-
const prevAccountsSet = new Set(this.state.subscriptionAccountsSeen);
|
|
318
|
-
if (accounts.length === 0) {
|
|
319
|
-
return {
|
|
320
|
-
accountsAdded: [],
|
|
321
|
-
accountsRemoved: [],
|
|
322
|
-
accounts: []
|
|
323
|
-
};
|
|
324
|
-
}
|
|
325
|
-
const accountsAdded = accounts.filter((a) => !prevAccountsSet.has(a));
|
|
326
|
-
const accountsRemoved = [...prevAccountsSet.values()].filter(
|
|
327
|
-
(a) => !currentAccountsSet.has(a)
|
|
328
|
-
);
|
|
329
|
-
this.update((state) => {
|
|
330
|
-
state.subscriptionAccountsSeen = [...prevAccountsSet, ...accountsAdded];
|
|
331
|
-
});
|
|
332
|
-
return {
|
|
333
|
-
accountsAdded,
|
|
334
|
-
accountsRemoved,
|
|
335
|
-
accounts
|
|
336
|
-
};
|
|
337
|
-
},
|
|
338
|
-
/**
|
|
339
|
-
* Initializes the cache/previous list. This is handy so we have an accurate in-mem state of the previous list of accounts.
|
|
340
|
-
*
|
|
341
|
-
* @returns result from list accounts
|
|
342
|
-
*/
|
|
343
|
-
initialize: () => {
|
|
344
|
-
return __privateGet(this, _accounts).listAccounts();
|
|
345
|
-
},
|
|
346
|
-
/**
|
|
347
|
-
* Subscription to any state change in the keyring controller (aka wallet accounts).
|
|
348
|
-
* We can call the `listAccounts` defined above to find out about any accounts added, removed
|
|
349
|
-
* And call effects to subscribe/unsubscribe to notifications.
|
|
350
|
-
*/
|
|
351
|
-
subscribe: () => {
|
|
352
|
-
this.messagingSystem.subscribe(
|
|
353
|
-
"KeyringController:stateChange",
|
|
354
|
-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
355
|
-
async () => {
|
|
356
|
-
if (!this.state.isNotificationServicesEnabled) {
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
const { accountsAdded, accountsRemoved } = await __privateGet(this, _accounts).listAccounts();
|
|
360
|
-
const promises = [];
|
|
361
|
-
if (accountsAdded.length > 0) {
|
|
362
|
-
promises.push(this.updateOnChainTriggersByAccount(accountsAdded));
|
|
363
|
-
}
|
|
364
|
-
if (accountsRemoved.length > 0) {
|
|
365
|
-
promises.push(this.deleteOnChainTriggersByAccount(accountsRemoved));
|
|
366
|
-
}
|
|
367
|
-
await Promise.all(promises);
|
|
368
|
-
}
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
__privateAdd(this, _featureAnnouncementEnv, void 0);
|
|
373
|
-
__privateAdd(this, _performEnableProfileSyncing, async () => {
|
|
374
|
-
try {
|
|
375
|
-
await __privateGet(this, _storage).enableProfileSyncing();
|
|
376
|
-
} catch (e) {
|
|
377
|
-
log.error("Failed to enable profile syncing", e);
|
|
378
|
-
throw new Error("Failed to enable profile syncing");
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
__privateSet(this, _isPushIntegrated, env.isPushIntegrated ?? true);
|
|
382
|
-
__privateSet(this, _featureAnnouncementEnv, env.featureAnnouncements);
|
|
383
|
-
__privateMethod(this, _registerMessageHandlers, registerMessageHandlers_fn).call(this);
|
|
384
|
-
__privateMethod(this, _clearLoadingStates, clearLoadingStates_fn).call(this);
|
|
385
|
-
__privateGet(this, _keyringController).setupLockedStateSubscriptions(
|
|
386
|
-
__privateGet(this, _pushNotifications).initializePushNotifications
|
|
387
|
-
);
|
|
388
|
-
__privateGet(this, _accounts).initialize();
|
|
389
|
-
__privateGet(this, _pushNotifications).initializePushNotifications();
|
|
390
|
-
__privateGet(this, _accounts).subscribe();
|
|
391
|
-
__privateGet(this, _pushNotifications).subscribe();
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Retrieves the current enabled state of MetaMask notifications.
|
|
395
|
-
*
|
|
396
|
-
* This method directly returns the boolean value of `isMetamaskNotificationsEnabled`
|
|
397
|
-
* from the controller's state, indicating whether MetaMask notifications are currently enabled.
|
|
398
|
-
*
|
|
399
|
-
* @returns The enabled state of MetaMask notifications.
|
|
400
|
-
*/
|
|
401
|
-
selectIsNotificationServicesEnabled() {
|
|
402
|
-
return this.state.isNotificationServicesEnabled;
|
|
403
|
-
}
|
|
404
|
-
async checkAccountsPresence(accounts) {
|
|
405
|
-
try {
|
|
406
|
-
__privateMethod(this, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn).call(this, true);
|
|
407
|
-
const userStorage = await __privateMethod(this, _getUserStorage, getUserStorage_fn).call(this);
|
|
408
|
-
__privateMethod(this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
|
|
409
|
-
const presence = checkAccountsPresence(userStorage, accounts);
|
|
410
|
-
return presence;
|
|
411
|
-
} catch (error) {
|
|
412
|
-
log.error("Failed to check accounts presence", error);
|
|
413
|
-
throw error;
|
|
414
|
-
} finally {
|
|
415
|
-
__privateMethod(this, _setIsCheckingAccountsPresence, setIsCheckingAccountsPresence_fn).call(this, false);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
/**
|
|
419
|
-
* Sets the enabled state of feature announcements.
|
|
420
|
-
*
|
|
421
|
-
* **Action** - used in the notification settings to enable/disable feature announcements.
|
|
422
|
-
*
|
|
423
|
-
* @param featureAnnouncementsEnabled - A boolean value indicating the desired enabled state of the feature announcements.
|
|
424
|
-
* @async
|
|
425
|
-
* @throws {Error} If fails to update
|
|
426
|
-
*/
|
|
427
|
-
async setFeatureAnnouncementsEnabled(featureAnnouncementsEnabled) {
|
|
428
|
-
try {
|
|
429
|
-
this.update((s) => {
|
|
430
|
-
s.isFeatureAnnouncementsEnabled = featureAnnouncementsEnabled;
|
|
431
|
-
});
|
|
432
|
-
} catch (e) {
|
|
433
|
-
log.error("Unable to toggle feature announcements", e);
|
|
434
|
-
throw new Error("Unable to toggle feature announcements");
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* This creates/re-creates on-chain triggers defined in User Storage.
|
|
439
|
-
*
|
|
440
|
-
* **Action** - Used during Sign In / Enabling of notifications.
|
|
441
|
-
*
|
|
442
|
-
* @returns The updated or newly created user storage.
|
|
443
|
-
* @throws {Error} Throws an error if unauthenticated or from other operations.
|
|
444
|
-
*/
|
|
445
|
-
async createOnChainTriggers() {
|
|
446
|
-
try {
|
|
447
|
-
__privateMethod(this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
|
|
448
|
-
await __privateGet(this, _performEnableProfileSyncing).call(this);
|
|
449
|
-
const { bearerToken, storageKey } = await __privateMethod(this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
|
|
450
|
-
const { accounts } = await __privateGet(this, _accounts).listAccounts();
|
|
451
|
-
let userStorage = await __privateMethod(this, _getUserStorage, getUserStorage_fn).call(this);
|
|
452
|
-
if (userStorage?.[USER_STORAGE_VERSION_KEY] === void 0) {
|
|
453
|
-
userStorage = initializeUserStorage(
|
|
454
|
-
accounts.map((account) => ({ address: account })),
|
|
455
|
-
false
|
|
456
|
-
);
|
|
457
|
-
await __privateGet(this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
458
|
-
}
|
|
459
|
-
const triggers = traverseUserStorageTriggers(userStorage);
|
|
460
|
-
await createOnChainTriggers(
|
|
461
|
-
userStorage,
|
|
462
|
-
storageKey,
|
|
463
|
-
bearerToken,
|
|
464
|
-
triggers
|
|
465
|
-
);
|
|
466
|
-
const allUUIDS = getAllUUIDs(userStorage);
|
|
467
|
-
await __privateGet(this, _pushNotifications).enablePushNotifications(allUUIDS);
|
|
468
|
-
await __privateGet(this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
469
|
-
this.update((state) => {
|
|
470
|
-
state.isNotificationServicesEnabled = true;
|
|
471
|
-
state.isFeatureAnnouncementsEnabled = true;
|
|
472
|
-
state.isMetamaskNotificationsFeatureSeen = true;
|
|
473
|
-
});
|
|
474
|
-
return userStorage;
|
|
475
|
-
} catch (err) {
|
|
476
|
-
log.error("Failed to create On Chain triggers", err);
|
|
477
|
-
throw new Error("Failed to create On Chain triggers");
|
|
478
|
-
} finally {
|
|
479
|
-
__privateMethod(this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
/**
|
|
483
|
-
* Enables all MetaMask notifications for the user.
|
|
484
|
-
* This is identical flow when initializing notifications for the first time.
|
|
485
|
-
* 1. Enable Profile Syncing
|
|
486
|
-
* 2. Get or Create Notification User Storage
|
|
487
|
-
* 3. Upsert Triggers
|
|
488
|
-
* 4. Update Push notifications
|
|
489
|
-
*
|
|
490
|
-
* @throws {Error} If there is an error during the process of enabling notifications.
|
|
491
|
-
*/
|
|
492
|
-
async enableMetamaskNotifications() {
|
|
493
|
-
try {
|
|
494
|
-
__privateMethod(this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
|
|
495
|
-
await this.createOnChainTriggers();
|
|
496
|
-
} catch (e) {
|
|
497
|
-
log.error("Unable to enable notifications", e);
|
|
498
|
-
throw new Error("Unable to enable notifications");
|
|
499
|
-
} finally {
|
|
500
|
-
__privateMethod(this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
/**
|
|
504
|
-
* Disables all MetaMask notifications for the user.
|
|
505
|
-
* This method ensures that the user is authenticated, retrieves all linked accounts,
|
|
506
|
-
* and disables on-chain triggers for each account. It also sets the global notification
|
|
507
|
-
* settings for MetaMask, feature announcements to false.
|
|
508
|
-
*
|
|
509
|
-
* @throws {Error} If the user is not authenticated or if there is an error during the process.
|
|
510
|
-
*/
|
|
511
|
-
async disableNotificationServices() {
|
|
512
|
-
try {
|
|
513
|
-
__privateMethod(this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, true);
|
|
514
|
-
const userStorage = await __privateMethod(this, _getUserStorage, getUserStorage_fn).call(this);
|
|
515
|
-
__privateMethod(this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
|
|
516
|
-
const UUIDs = getAllUUIDs(userStorage);
|
|
517
|
-
await __privateGet(this, _pushNotifications).disablePushNotifications(UUIDs);
|
|
518
|
-
this.update((state) => {
|
|
519
|
-
state.isNotificationServicesEnabled = false;
|
|
520
|
-
state.isFeatureAnnouncementsEnabled = false;
|
|
521
|
-
state.metamaskNotificationsList = [];
|
|
522
|
-
});
|
|
523
|
-
} catch (e) {
|
|
524
|
-
log.error("Unable to disable notifications", e);
|
|
525
|
-
throw new Error("Unable to disable notifications");
|
|
526
|
-
} finally {
|
|
527
|
-
__privateMethod(this, _setIsUpdatingMetamaskNotifications, setIsUpdatingMetamaskNotifications_fn).call(this, false);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
/**
|
|
531
|
-
* Deletes on-chain triggers associated with a specific account.
|
|
532
|
-
* This method performs several key operations:
|
|
533
|
-
* 1. Validates Auth & Storage
|
|
534
|
-
* 2. Finds and deletes all triggers associated with the account
|
|
535
|
-
* 3. Disables any related push notifications
|
|
536
|
-
* 4. Updates Storage to reflect new state.
|
|
537
|
-
*
|
|
538
|
-
* **Action** - When a user disables notifications for a given account in settings.
|
|
539
|
-
*
|
|
540
|
-
* @param accounts - The account for which on-chain triggers are to be deleted.
|
|
541
|
-
* @returns A promise that resolves to void or an object containing a success message.
|
|
542
|
-
* @throws {Error} Throws an error if unauthenticated or from other operations.
|
|
543
|
-
*/
|
|
544
|
-
async deleteOnChainTriggersByAccount(accounts) {
|
|
545
|
-
try {
|
|
546
|
-
__privateMethod(this, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn).call(this, accounts);
|
|
547
|
-
const { bearerToken, storageKey } = await __privateMethod(this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
|
|
548
|
-
const userStorage = await __privateMethod(this, _getUserStorage, getUserStorage_fn).call(this);
|
|
549
|
-
__privateMethod(this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
|
|
550
|
-
const UUIDs = accounts.map((a) => getUUIDsForAccount(userStorage, a.toLowerCase())).flat();
|
|
551
|
-
if (UUIDs.length === 0) {
|
|
552
|
-
return userStorage;
|
|
553
|
-
}
|
|
554
|
-
await deleteOnChainTriggers(
|
|
555
|
-
userStorage,
|
|
556
|
-
storageKey,
|
|
557
|
-
bearerToken,
|
|
558
|
-
UUIDs
|
|
559
|
-
);
|
|
560
|
-
await __privateGet(this, _pushNotifications).disablePushNotifications(UUIDs);
|
|
561
|
-
await __privateGet(this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
562
|
-
return userStorage;
|
|
563
|
-
} catch (err) {
|
|
564
|
-
log.error("Failed to delete OnChain triggers", err);
|
|
565
|
-
throw new Error("Failed to delete OnChain triggers");
|
|
566
|
-
} finally {
|
|
567
|
-
__privateMethod(this, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn).call(this, accounts);
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
/**
|
|
571
|
-
* Updates/Creates on-chain triggers for a specific account.
|
|
572
|
-
*
|
|
573
|
-
* This method performs several key operations:
|
|
574
|
-
* 1. Validates Auth & Storage
|
|
575
|
-
* 2. Finds and creates any missing triggers associated with the account
|
|
576
|
-
* 3. Enables any related push notifications
|
|
577
|
-
* 4. Updates Storage to reflect new state.
|
|
578
|
-
*
|
|
579
|
-
* **Action** - When a user enables notifications for an account
|
|
580
|
-
*
|
|
581
|
-
* @param accounts - List of accounts you want to update.
|
|
582
|
-
* @returns A promise that resolves to the updated user storage.
|
|
583
|
-
* @throws {Error} Throws an error if unauthenticated or from other operations.
|
|
584
|
-
*/
|
|
585
|
-
async updateOnChainTriggersByAccount(accounts) {
|
|
586
|
-
try {
|
|
587
|
-
__privateMethod(this, _updateUpdatingAccountsState, updateUpdatingAccountsState_fn).call(this, accounts);
|
|
588
|
-
const { bearerToken, storageKey } = await __privateMethod(this, _getValidStorageKeyAndBearerToken, getValidStorageKeyAndBearerToken_fn).call(this);
|
|
589
|
-
const userStorage = await __privateMethod(this, _getUserStorage, getUserStorage_fn).call(this);
|
|
590
|
-
__privateMethod(this, _assertUserStorage, assertUserStorage_fn).call(this, userStorage);
|
|
591
|
-
accounts.forEach((a) => upsertAddressTriggers(a, userStorage));
|
|
592
|
-
const newTriggers = traverseUserStorageTriggers(userStorage, {
|
|
593
|
-
mapTrigger: (t) => {
|
|
594
|
-
if (!t.enabled) {
|
|
595
|
-
return t;
|
|
596
|
-
}
|
|
597
|
-
return void 0;
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
if (newTriggers.length > 0) {
|
|
601
|
-
await __privateGet(this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
602
|
-
const triggers = traverseUserStorageTriggers(userStorage, {
|
|
603
|
-
mapTrigger: (t) => {
|
|
604
|
-
if (accounts.some((a) => a.toLowerCase() === t.address.toLowerCase())) {
|
|
605
|
-
return t;
|
|
606
|
-
}
|
|
607
|
-
return void 0;
|
|
608
|
-
}
|
|
609
|
-
});
|
|
610
|
-
await createOnChainTriggers(
|
|
611
|
-
userStorage,
|
|
612
|
-
storageKey,
|
|
613
|
-
bearerToken,
|
|
614
|
-
triggers
|
|
615
|
-
);
|
|
616
|
-
}
|
|
617
|
-
const UUIDs = getAllUUIDs(userStorage);
|
|
618
|
-
await __privateGet(this, _pushNotifications).updatePushNotifications(UUIDs);
|
|
619
|
-
await __privateGet(this, _storage).setNotificationStorage(JSON.stringify(userStorage));
|
|
620
|
-
return userStorage;
|
|
621
|
-
} catch (err) {
|
|
622
|
-
log.error("Failed to update OnChain triggers", err);
|
|
623
|
-
throw new Error("Failed to update OnChain triggers");
|
|
624
|
-
} finally {
|
|
625
|
-
__privateMethod(this, _clearUpdatingAccountsState, clearUpdatingAccountsState_fn).call(this, accounts);
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
/**
|
|
629
|
-
* Fetches the list of metamask notifications.
|
|
630
|
-
* This includes OnChain notifications and Feature Announcements.
|
|
631
|
-
*
|
|
632
|
-
* **Action** - When a user views the notification list page/dropdown
|
|
633
|
-
*
|
|
634
|
-
* @throws {Error} Throws an error if unauthenticated or from other operations.
|
|
635
|
-
*/
|
|
636
|
-
async fetchAndUpdateMetamaskNotifications() {
|
|
637
|
-
try {
|
|
638
|
-
__privateMethod(this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, true);
|
|
639
|
-
const rawFeatureAnnouncementNotifications = this.state.isFeatureAnnouncementsEnabled ? await getFeatureAnnouncementNotifications(
|
|
640
|
-
__privateGet(this, _featureAnnouncementEnv)
|
|
641
|
-
).catch(() => []) : [];
|
|
642
|
-
const rawOnChainNotifications = [];
|
|
643
|
-
const userStorage = await __privateGet(this, _storage).getNotificationStorage().then((s) => s && JSON.parse(s)).catch(() => null);
|
|
644
|
-
const bearerToken = await __privateGet(this, _auth).getBearerToken().catch(() => null);
|
|
645
|
-
if (userStorage && bearerToken) {
|
|
646
|
-
const notifications = await getOnChainNotifications(
|
|
647
|
-
userStorage,
|
|
648
|
-
bearerToken
|
|
649
|
-
).catch(() => []);
|
|
650
|
-
rawOnChainNotifications.push(...notifications);
|
|
651
|
-
}
|
|
652
|
-
const readIds = this.state.metamaskNotificationsReadList;
|
|
653
|
-
const isNotUndefined = (t) => Boolean(t);
|
|
654
|
-
const processAndFilter = (ns) => ns.map((n) => safeProcessNotification(n, readIds)).filter(isNotUndefined);
|
|
655
|
-
const featureAnnouncementNotifications = processAndFilter(
|
|
656
|
-
rawFeatureAnnouncementNotifications
|
|
657
|
-
);
|
|
658
|
-
const onChainNotifications = processAndFilter(rawOnChainNotifications);
|
|
659
|
-
const metamaskNotifications = [
|
|
660
|
-
...featureAnnouncementNotifications,
|
|
661
|
-
...onChainNotifications
|
|
662
|
-
];
|
|
663
|
-
metamaskNotifications.sort(
|
|
664
|
-
(a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime()
|
|
665
|
-
);
|
|
666
|
-
this.update((state) => {
|
|
667
|
-
state.metamaskNotificationsList = metamaskNotifications;
|
|
668
|
-
});
|
|
669
|
-
this.messagingSystem.publish(
|
|
670
|
-
`${controllerName}:notificationsListUpdated`,
|
|
671
|
-
this.state.metamaskNotificationsList
|
|
672
|
-
);
|
|
673
|
-
__privateMethod(this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, false);
|
|
674
|
-
return metamaskNotifications;
|
|
675
|
-
} catch (err) {
|
|
676
|
-
__privateMethod(this, _setIsFetchingMetamaskNotifications, setIsFetchingMetamaskNotifications_fn).call(this, false);
|
|
677
|
-
log.error("Failed to fetch notifications", err);
|
|
678
|
-
throw new Error("Failed to fetch notifications");
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* Marks specified metamask notifications as read.
|
|
683
|
-
*
|
|
684
|
-
* @param notifications - An array of notifications to be marked as read. Each notification should include its type and read status.
|
|
685
|
-
* @returns A promise that resolves when the operation is complete.
|
|
686
|
-
*/
|
|
687
|
-
async markMetamaskNotificationsAsRead(notifications) {
|
|
688
|
-
let onchainNotificationIds = [];
|
|
689
|
-
let featureAnnouncementNotificationIds = [];
|
|
690
|
-
try {
|
|
691
|
-
const onChainNotifications = notifications.filter(
|
|
692
|
-
(notification) => notification.type !== "features_announcement" /* FEATURES_ANNOUNCEMENT */ && !notification.isRead
|
|
693
|
-
);
|
|
694
|
-
const featureAnnouncementNotifications = notifications.filter(
|
|
695
|
-
(notification) => notification.type === "features_announcement" /* FEATURES_ANNOUNCEMENT */ && !notification.isRead
|
|
696
|
-
);
|
|
697
|
-
if (onChainNotifications.length > 0) {
|
|
698
|
-
const bearerToken = await __privateGet(this, _auth).getBearerToken();
|
|
699
|
-
if (bearerToken) {
|
|
700
|
-
onchainNotificationIds = onChainNotifications.map(
|
|
701
|
-
(notification) => notification.id
|
|
702
|
-
);
|
|
703
|
-
await markNotificationsAsRead(
|
|
704
|
-
bearerToken,
|
|
705
|
-
onchainNotificationIds
|
|
706
|
-
).catch(() => {
|
|
707
|
-
onchainNotificationIds = [];
|
|
708
|
-
log.warn("Unable to mark onchain notifications as read");
|
|
709
|
-
});
|
|
710
|
-
}
|
|
711
|
-
}
|
|
712
|
-
if (featureAnnouncementNotifications.length > 0) {
|
|
713
|
-
featureAnnouncementNotificationIds = featureAnnouncementNotifications.map(
|
|
714
|
-
(notification) => notification.id
|
|
715
|
-
);
|
|
716
|
-
}
|
|
717
|
-
} catch (err) {
|
|
718
|
-
log.warn("Something failed when marking notifications as read", err);
|
|
719
|
-
}
|
|
720
|
-
this.update((state) => {
|
|
721
|
-
const currentReadList = state.metamaskNotificationsReadList;
|
|
722
|
-
const newReadIds = [...featureAnnouncementNotificationIds];
|
|
723
|
-
state.metamaskNotificationsReadList = [
|
|
724
|
-
.../* @__PURE__ */ new Set([...currentReadList, ...newReadIds])
|
|
725
|
-
];
|
|
726
|
-
state.metamaskNotificationsList = state.metamaskNotificationsList.map(
|
|
727
|
-
(notification) => {
|
|
728
|
-
if (newReadIds.includes(notification.id) || onchainNotificationIds.includes(notification.id)) {
|
|
729
|
-
return { ...notification, isRead: true };
|
|
730
|
-
}
|
|
731
|
-
return notification;
|
|
732
|
-
}
|
|
733
|
-
);
|
|
734
|
-
});
|
|
735
|
-
this.messagingSystem.publish(
|
|
736
|
-
`${controllerName}:markNotificationsAsRead`,
|
|
737
|
-
this.state.metamaskNotificationsList
|
|
738
|
-
);
|
|
739
|
-
}
|
|
740
|
-
/**
|
|
741
|
-
* Updates the list of MetaMask notifications by adding a new notification at the beginning of the list.
|
|
742
|
-
* This method ensures that the most recent notification is displayed first in the UI.
|
|
743
|
-
*
|
|
744
|
-
* @param notification - The new notification object to be added to the list.
|
|
745
|
-
* @returns A promise that resolves when the notification list has been successfully updated.
|
|
746
|
-
*/
|
|
747
|
-
async updateMetamaskNotificationsList(notification) {
|
|
748
|
-
if (this.state.metamaskNotificationsList.some((n) => n.id === notification.id)) {
|
|
749
|
-
return;
|
|
750
|
-
}
|
|
751
|
-
const processedNotification = safeProcessNotification(notification);
|
|
752
|
-
if (processedNotification) {
|
|
753
|
-
this.update((state) => {
|
|
754
|
-
const existingNotificationIds = new Set(
|
|
755
|
-
state.metamaskNotificationsList.map((n) => n.id)
|
|
756
|
-
);
|
|
757
|
-
if (!existingNotificationIds.has(notification.id)) {
|
|
758
|
-
state.metamaskNotificationsList = [
|
|
759
|
-
notification,
|
|
760
|
-
...state.metamaskNotificationsList
|
|
761
|
-
];
|
|
762
|
-
this.messagingSystem.publish(
|
|
763
|
-
`${controllerName}:notificationsListUpdated`,
|
|
764
|
-
state.metamaskNotificationsList
|
|
765
|
-
);
|
|
766
|
-
}
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
};
|
|
771
|
-
_isPushIntegrated = new WeakMap();
|
|
772
|
-
_isPushNotificationsSetup = new WeakMap();
|
|
773
|
-
_isUnlocked = new WeakMap();
|
|
774
|
-
_keyringController = new WeakMap();
|
|
775
|
-
_auth = new WeakMap();
|
|
776
|
-
_storage = new WeakMap();
|
|
777
|
-
_pushNotifications = new WeakMap();
|
|
778
|
-
_accounts = new WeakMap();
|
|
779
|
-
_featureAnnouncementEnv = new WeakMap();
|
|
780
|
-
_registerMessageHandlers = new WeakSet();
|
|
781
|
-
registerMessageHandlers_fn = function() {
|
|
782
|
-
this.messagingSystem.registerActionHandler(
|
|
783
|
-
`${controllerName}:updateMetamaskNotificationsList`,
|
|
784
|
-
this.updateMetamaskNotificationsList.bind(this)
|
|
785
|
-
);
|
|
786
|
-
this.messagingSystem.registerActionHandler(
|
|
787
|
-
`${controllerName}:disableNotificationServices`,
|
|
788
|
-
this.disableNotificationServices.bind(this)
|
|
789
|
-
);
|
|
790
|
-
this.messagingSystem.registerActionHandler(
|
|
791
|
-
`${controllerName}:selectIsNotificationServicesEnabled`,
|
|
792
|
-
this.selectIsNotificationServicesEnabled.bind(this)
|
|
793
|
-
);
|
|
794
|
-
};
|
|
795
|
-
_clearLoadingStates = new WeakSet();
|
|
796
|
-
clearLoadingStates_fn = function() {
|
|
797
|
-
this.update((state) => {
|
|
798
|
-
state.isUpdatingMetamaskNotifications = false;
|
|
799
|
-
state.isCheckingAccountsPresence = false;
|
|
800
|
-
state.isFetchingMetamaskNotifications = false;
|
|
801
|
-
state.isUpdatingMetamaskNotificationsAccount = [];
|
|
802
|
-
});
|
|
803
|
-
};
|
|
804
|
-
_assertAuthEnabled = new WeakSet();
|
|
805
|
-
assertAuthEnabled_fn = function() {
|
|
806
|
-
if (!__privateGet(this, _auth).isSignedIn()) {
|
|
807
|
-
this.update((state) => {
|
|
808
|
-
state.isNotificationServicesEnabled = false;
|
|
809
|
-
});
|
|
810
|
-
throw new Error("User is not signed in.");
|
|
811
|
-
}
|
|
812
|
-
};
|
|
813
|
-
_getValidStorageKeyAndBearerToken = new WeakSet();
|
|
814
|
-
getValidStorageKeyAndBearerToken_fn = async function() {
|
|
815
|
-
__privateMethod(this, _assertAuthEnabled, assertAuthEnabled_fn).call(this);
|
|
816
|
-
const bearerToken = await __privateGet(this, _auth).getBearerToken();
|
|
817
|
-
const storageKey = await __privateGet(this, _storage).getStorageKey();
|
|
818
|
-
if (!bearerToken || !storageKey) {
|
|
819
|
-
throw new Error("Missing BearerToken or storage key");
|
|
820
|
-
}
|
|
821
|
-
return { bearerToken, storageKey };
|
|
822
|
-
};
|
|
823
|
-
_performEnableProfileSyncing = new WeakMap();
|
|
824
|
-
_assertUserStorage = new WeakSet();
|
|
825
|
-
assertUserStorage_fn = function(storage) {
|
|
826
|
-
if (!storage) {
|
|
827
|
-
throw new Error("User Storage does not exist");
|
|
828
|
-
}
|
|
829
|
-
};
|
|
830
|
-
_getUserStorage = new WeakSet();
|
|
831
|
-
getUserStorage_fn = async function() {
|
|
832
|
-
const userStorageString = await __privateGet(this, _storage).getNotificationStorage();
|
|
833
|
-
if (!userStorageString) {
|
|
834
|
-
return null;
|
|
835
|
-
}
|
|
836
|
-
try {
|
|
837
|
-
const userStorage = JSON.parse(userStorageString);
|
|
838
|
-
return userStorage;
|
|
839
|
-
} catch (error) {
|
|
840
|
-
log.error("Unable to parse User Storage");
|
|
841
|
-
return null;
|
|
842
|
-
}
|
|
843
|
-
};
|
|
844
|
-
_setIsUpdatingMetamaskNotifications = new WeakSet();
|
|
845
|
-
setIsUpdatingMetamaskNotifications_fn = function(isUpdatingMetamaskNotifications) {
|
|
846
|
-
this.update((state) => {
|
|
847
|
-
state.isUpdatingMetamaskNotifications = isUpdatingMetamaskNotifications;
|
|
848
|
-
});
|
|
849
|
-
};
|
|
850
|
-
_setIsFetchingMetamaskNotifications = new WeakSet();
|
|
851
|
-
setIsFetchingMetamaskNotifications_fn = function(isFetchingMetamaskNotifications) {
|
|
852
|
-
this.update((state) => {
|
|
853
|
-
state.isFetchingMetamaskNotifications = isFetchingMetamaskNotifications;
|
|
854
|
-
});
|
|
855
|
-
};
|
|
856
|
-
_setIsCheckingAccountsPresence = new WeakSet();
|
|
857
|
-
setIsCheckingAccountsPresence_fn = function(isCheckingAccountsPresence) {
|
|
858
|
-
this.update((state) => {
|
|
859
|
-
state.isCheckingAccountsPresence = isCheckingAccountsPresence;
|
|
860
|
-
});
|
|
861
|
-
};
|
|
862
|
-
_updateUpdatingAccountsState = new WeakSet();
|
|
863
|
-
updateUpdatingAccountsState_fn = function(accounts) {
|
|
864
|
-
this.update((state) => {
|
|
865
|
-
const uniqueAccounts = /* @__PURE__ */ new Set([
|
|
866
|
-
...state.isUpdatingMetamaskNotificationsAccount,
|
|
867
|
-
...accounts
|
|
868
|
-
]);
|
|
869
|
-
state.isUpdatingMetamaskNotificationsAccount = Array.from(uniqueAccounts);
|
|
870
|
-
});
|
|
871
|
-
};
|
|
872
|
-
_clearUpdatingAccountsState = new WeakSet();
|
|
873
|
-
clearUpdatingAccountsState_fn = function(accounts) {
|
|
874
|
-
this.update((state) => {
|
|
875
|
-
state.isUpdatingMetamaskNotificationsAccount = state.isUpdatingMetamaskNotificationsAccount.filter(
|
|
876
|
-
(existingAccount) => !accounts.includes(existingAccount)
|
|
877
|
-
);
|
|
878
|
-
});
|
|
879
|
-
};
|
|
880
|
-
|
|
881
|
-
export {
|
|
882
|
-
defaultState,
|
|
883
|
-
NotificationServicesController
|
|
884
|
-
};
|
|
885
|
-
//# sourceMappingURL=chunk-WE4RFGT7.mjs.map
|