@metamask-previews/notification-services-controller 26.0.1-preview-4f4c98e → 26.0.1-preview-eb263b0ee
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/CHANGELOG.md +0 -1
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs +7 -0
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.cjs.map +1 -0
- package/dist/NotificationServicesController/{NotificationServicesController-method-action-types.d.ts → NotificationServicesController-method-action-types.d.cts} +2 -2
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.cts.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.mts +206 -0
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.mts.map +1 -0
- package/dist/NotificationServicesController/{NotificationServicesController-method-action-types.js → NotificationServicesController-method-action-types.mjs} +1 -1
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.mjs.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController.cjs +1055 -0
- package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -0
- package/dist/NotificationServicesController/{NotificationServicesController.d.ts → NotificationServicesController.d.cts} +15 -15
- package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -0
- package/dist/NotificationServicesController/NotificationServicesController.d.mts +292 -0
- package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -0
- package/dist/NotificationServicesController/{NotificationServicesController.js → NotificationServicesController.mjs} +26 -18
- package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -0
- package/dist/NotificationServicesController/constants/index.cjs +18 -0
- package/dist/NotificationServicesController/constants/index.cjs.map +1 -0
- package/dist/NotificationServicesController/constants/index.d.cts +2 -0
- package/dist/NotificationServicesController/constants/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/index.d.mts +2 -0
- package/dist/NotificationServicesController/constants/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/index.mjs +2 -0
- package/dist/NotificationServicesController/constants/index.mjs.map +1 -0
- package/dist/NotificationServicesController/constants/notification-schema.cjs +46 -0
- package/dist/NotificationServicesController/constants/notification-schema.cjs.map +1 -0
- package/dist/NotificationServicesController/constants/{notification-schema.d.ts → notification-schema.d.cts} +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/constants/notification-schema.d.mts +22 -0
- package/dist/NotificationServicesController/constants/notification-schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/constants/{notification-schema.js → notification-schema.mjs} +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.mjs.map +1 -0
- package/dist/NotificationServicesController/index.cjs +44 -0
- package/dist/NotificationServicesController/index.cjs.map +1 -0
- package/dist/NotificationServicesController/{index.d.ts → index.d.cts} +14 -14
- package/dist/NotificationServicesController/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/index.d.mts +16 -0
- package/dist/NotificationServicesController/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/index.mjs +13 -0
- package/dist/NotificationServicesController/index.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/index.cjs +21 -0
- package/dist/NotificationServicesController/mocks/index.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/index.d.cts +5 -0
- package/dist/NotificationServicesController/mocks/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/index.d.mts +5 -0
- package/dist/NotificationServicesController/mocks/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/index.mjs +5 -0
- package/dist/NotificationServicesController/mocks/index.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs +210 -0
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-feature-announcements.d.ts → mock-feature-announcements.d.cts} +3 -3
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts +15 -0
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-feature-announcements.js → mock-feature-announcements.mjs} +2 -2
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs +830 -0
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-raw-notifications.d.ts → mock-raw-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts +104 -0
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-raw-notifications.js → mock-raw-notifications.mjs} +2 -2
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs +29 -0
- package/dist/NotificationServicesController/mocks/mock-snap-notification.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-snap-notification.d.ts → mock-snap-notification.d.cts} +2 -2
- package/dist/NotificationServicesController/mocks/mock-snap-notification.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts +8 -0
- package/dist/NotificationServicesController/mocks/mock-snap-notification.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/{mock-snap-notification.js → mock-snap-notification.mjs} +2 -2
- package/dist/NotificationServicesController/mocks/mock-snap-notification.mjs.map +1 -0
- package/dist/NotificationServicesController/mocks/mockResponses.cjs +53 -0
- package/dist/NotificationServicesController/mocks/mockResponses.cjs.map +1 -0
- package/dist/NotificationServicesController/mocks/{mockResponses.d.ts → mockResponses.d.cts} +3 -3
- package/dist/NotificationServicesController/mocks/mockResponses.d.cts.map +1 -0
- package/dist/NotificationServicesController/mocks/mockResponses.d.mts +14 -0
- package/dist/NotificationServicesController/mocks/mockResponses.d.mts.map +1 -0
- package/dist/NotificationServicesController/mocks/{mockResponses.js → mockResponses.mjs} +6 -6
- package/dist/NotificationServicesController/mocks/mockResponses.mjs.map +1 -0
- 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 +4 -0
- package/dist/NotificationServicesController/processors/index.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.cjs +24 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/{process-api-notifications.d.ts → process-api-notifications.d.cts} +3 -3
- package/dist/NotificationServicesController/processors/process-api-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.d.mts +10 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/{process-api-notifications.js → process-api-notifications.mjs} +3 -3
- package/dist/NotificationServicesController/processors/process-api-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +38 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/{process-feature-announcement.d.ts → 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.js → process-feature-announcement.mjs} +3 -3
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-notifications.cjs +60 -0
- package/dist/NotificationServicesController/processors/process-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/{process-notifications.d.ts → 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 +20 -0
- package/dist/NotificationServicesController/processors/process-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/{process-notifications.js → process-notifications.mjs} +5 -5
- package/dist/NotificationServicesController/processors/process-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-snap-notifications.cjs +25 -0
- package/dist/NotificationServicesController/processors/process-snap-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/{process-snap-notifications.d.ts → process-snap-notifications.d.cts} +3 -3
- package/dist/NotificationServicesController/processors/process-snap-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts +10 -0
- package/dist/NotificationServicesController/processors/process-snap-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/processors/{process-snap-notifications.js → process-snap-notifications.mjs} +3 -3
- package/dist/NotificationServicesController/processors/process-snap-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/services/api-notifications.cjs +128 -0
- package/dist/NotificationServicesController/services/api-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{api-notifications.d.ts → api-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/services/api-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/api-notifications.d.mts +44 -0
- package/dist/NotificationServicesController/services/api-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{api-notifications.js → api-notifications.mjs} +12 -5
- package/dist/NotificationServicesController/services/api-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/services/feature-announcements.cjs +140 -0
- package/dist/NotificationServicesController/services/feature-announcements.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{feature-announcements.d.ts → 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 +32 -0
- package/dist/NotificationServicesController/services/feature-announcements.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{feature-announcements.js → feature-announcements.mjs} +5 -5
- package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -0
- package/dist/NotificationServicesController/services/notification-config-cache.cjs +61 -0
- package/dist/NotificationServicesController/services/notification-config-cache.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{notification-config-cache.d.ts → notification-config-cache.d.cts} +1 -1
- package/dist/NotificationServicesController/services/notification-config-cache.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/notification-config-cache.d.mts +15 -0
- package/dist/NotificationServicesController/services/notification-config-cache.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{notification-config-cache.js → notification-config-cache.mjs} +1 -1
- package/dist/NotificationServicesController/services/notification-config-cache.mjs.map +1 -0
- package/dist/NotificationServicesController/services/perp-notifications.cjs +31 -0
- package/dist/NotificationServicesController/services/perp-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{perp-notifications.d.ts → perp-notifications.d.cts} +2 -2
- package/dist/NotificationServicesController/services/perp-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/perp-notifications.d.mts +11 -0
- package/dist/NotificationServicesController/services/perp-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{perp-notifications.js → perp-notifications.mjs} +2 -2
- package/dist/NotificationServicesController/services/perp-notifications.mjs.map +1 -0
- 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/NotificationServicesController/types/feature-announcement/{feature-announcement.d.ts → 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 +2 -0
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.mjs.map +1 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.cjs +3 -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 +2 -0
- package/dist/NotificationServicesController/types/feature-announcement/index.mjs.map +1 -0
- 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/NotificationServicesController/types/feature-announcement/{type-feature-announcement.d.ts → 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 +43 -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 +2 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.mjs.map +1 -0
- 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/NotificationServicesController/types/feature-announcement/{type-links.d.ts → 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 +2 -0
- package/dist/NotificationServicesController/types/feature-announcement/type-links.mjs.map +1 -0
- package/dist/NotificationServicesController/types/index.cjs +3 -0
- package/dist/NotificationServicesController/types/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/index.d.cts +6 -0
- package/dist/NotificationServicesController/types/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/index.d.mts +6 -0
- package/dist/NotificationServicesController/types/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/index.mjs +2 -0
- package/dist/NotificationServicesController/types/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification/index.cjs +3 -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 +2 -0
- package/dist/NotificationServicesController/types/notification/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.cjs +3 -0
- package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification/{notification.d.ts → notification.d.cts} +5 -5
- package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.d.mts +22 -0
- package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification/notification.mjs +2 -0
- package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/index.cjs +3 -0
- package/dist/NotificationServicesController/types/notification-api/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/index.d.cts +3 -0
- package/dist/NotificationServicesController/types/notification-api/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/index.d.mts +3 -0
- package/dist/NotificationServicesController/types/notification-api/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/index.mjs +2 -0
- package/dist/NotificationServicesController/types/notification-api/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.cjs +4 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/{notification-api.d.ts → notification-api.d.cts} +4 -4
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts +59 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.mjs +2 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.mjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/schema.cjs +6 -0
- package/dist/NotificationServicesController/types/notification-api/schema.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/{schema.d.ts → schema.d.cts} +1 -1
- package/dist/NotificationServicesController/types/notification-api/schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/schema.d.mts +752 -0
- package/dist/NotificationServicesController/types/notification-api/schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/{schema.js → schema.mjs} +1 -1
- package/dist/NotificationServicesController/types/notification-api/schema.mjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/index.cjs +3 -0
- package/dist/NotificationServicesController/types/perps/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/perps/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/perps/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/perps/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/perps/index.mjs +2 -0
- package/dist/NotificationServicesController/types/perps/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/perp-types.cjs +3 -0
- package/dist/NotificationServicesController/types/perps/perp-types.cjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/perp-types.d.cts +3 -0
- package/dist/NotificationServicesController/types/perps/perp-types.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/perps/perp-types.d.mts +3 -0
- package/dist/NotificationServicesController/types/perps/perp-types.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/perps/perp-types.mjs +2 -0
- package/dist/NotificationServicesController/types/perps/perp-types.mjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/schema.cjs +6 -0
- package/dist/NotificationServicesController/types/perps/schema.cjs.map +1 -0
- package/dist/NotificationServicesController/types/perps/{schema.d.ts → schema.d.cts} +1 -1
- package/dist/NotificationServicesController/types/perps/schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/perps/schema.d.mts +133 -0
- package/dist/NotificationServicesController/types/perps/schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/perps/{schema.js → schema.mjs} +1 -1
- package/dist/NotificationServicesController/types/perps/schema.mjs.map +1 -0
- package/dist/NotificationServicesController/types/snaps/index.cjs +3 -0
- package/dist/NotificationServicesController/types/snaps/index.cjs.map +1 -0
- package/dist/NotificationServicesController/types/snaps/index.d.cts +2 -0
- package/dist/NotificationServicesController/types/snaps/index.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/snaps/index.d.mts +2 -0
- package/dist/NotificationServicesController/types/snaps/index.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/snaps/index.mjs +2 -0
- package/dist/NotificationServicesController/types/snaps/index.mjs.map +1 -0
- package/dist/NotificationServicesController/types/snaps/snaps.cjs +3 -0
- package/dist/NotificationServicesController/types/snaps/snaps.cjs.map +1 -0
- package/dist/NotificationServicesController/types/snaps/{snaps.d.ts → snaps.d.cts} +2 -2
- package/dist/NotificationServicesController/types/snaps/snaps.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/snaps/snaps.d.mts +23 -0
- package/dist/NotificationServicesController/types/snaps/snaps.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/snaps/snaps.mjs +2 -0
- package/dist/NotificationServicesController/types/snaps/snaps.mjs.map +1 -0
- package/dist/NotificationServicesController/types/type-utils.cjs +3 -0
- package/dist/NotificationServicesController/types/type-utils.cjs.map +1 -0
- package/dist/NotificationServicesController/types/{type-utils.d.ts → 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 +2 -0
- package/dist/NotificationServicesController/types/type-utils.mjs.map +1 -0
- package/dist/NotificationServicesController/utils/get-notification-subtype.cjs +33 -0
- package/dist/NotificationServicesController/utils/get-notification-subtype.cjs.map +1 -0
- package/dist/NotificationServicesController/utils/{get-notification-subtype.d.ts → get-notification-subtype.d.cts} +2 -2
- package/dist/NotificationServicesController/utils/get-notification-subtype.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts +17 -0
- package/dist/NotificationServicesController/utils/get-notification-subtype.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/{get-notification-subtype.js → get-notification-subtype.mjs} +3 -3
- package/dist/NotificationServicesController/utils/get-notification-subtype.mjs.map +1 -0
- package/dist/NotificationServicesController/utils/isVersionInBounds.cjs +37 -0
- package/dist/NotificationServicesController/utils/isVersionInBounds.cjs.map +1 -0
- package/dist/NotificationServicesController/utils/{isVersionInBounds.d.ts → isVersionInBounds.d.cts} +1 -1
- package/dist/NotificationServicesController/utils/isVersionInBounds.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/isVersionInBounds.d.mts +18 -0
- package/dist/NotificationServicesController/utils/isVersionInBounds.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/{isVersionInBounds.js → isVersionInBounds.mjs} +2 -2
- package/dist/NotificationServicesController/utils/isVersionInBounds.mjs.map +1 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.cjs +12 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.cjs.map +1 -0
- package/dist/NotificationServicesController/utils/{should-auto-expire.d.ts → should-auto-expire.d.cts} +1 -1
- package/dist/NotificationServicesController/utils/should-auto-expire.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.d.mts +2 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/{should-auto-expire.js → should-auto-expire.mjs} +1 -1
- package/dist/NotificationServicesController/utils/should-auto-expire.mjs.map +1 -0
- package/dist/NotificationServicesController/utils/utils.cjs +25 -0
- package/dist/NotificationServicesController/utils/utils.cjs.map +1 -0
- package/dist/NotificationServicesController/utils/{utils.d.ts → utils.d.cts} +1 -1
- package/dist/NotificationServicesController/utils/utils.d.cts.map +1 -0
- package/dist/NotificationServicesController/utils/utils.d.mts +11 -0
- package/dist/NotificationServicesController/utils/utils.d.mts.map +1 -0
- package/dist/NotificationServicesController/utils/{utils.js → utils.mjs} +1 -1
- package/dist/NotificationServicesController/utils/utils.mjs.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs +7 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.cjs.map +1 -0
- package/dist/NotificationServicesPushController/{NotificationServicesPushController-method-action-types.d.ts → NotificationServicesPushController-method-action-types.d.cts} +2 -2
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts +72 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/{NotificationServicesPushController-method-action-types.js → NotificationServicesPushController-method-action-types.mjs} +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.mjs.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs +342 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -0
- package/dist/NotificationServicesPushController/{NotificationServicesPushController.d.ts → NotificationServicesPushController.d.cts} +9 -9
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +123 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/{NotificationServicesPushController.js → NotificationServicesPushController.mjs} +11 -4
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -0
- package/dist/NotificationServicesPushController/index.cjs +37 -0
- package/dist/NotificationServicesPushController/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/{index.d.ts → index.d.cts} +9 -9
- 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 +8 -0
- package/dist/NotificationServicesPushController/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/mocks/index.cjs +18 -0
- package/dist/NotificationServicesPushController/mocks/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/mocks/index.d.cts +2 -0
- package/dist/NotificationServicesPushController/mocks/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/mocks/index.d.mts +2 -0
- package/dist/NotificationServicesPushController/mocks/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/mocks/index.mjs +2 -0
- package/dist/NotificationServicesPushController/mocks/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/mocks/mockResponse.cjs +48 -0
- package/dist/NotificationServicesPushController/mocks/mockResponse.cjs.map +1 -0
- package/dist/NotificationServicesPushController/mocks/{mockResponse.d.ts → mockResponse.d.cts} +1 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/mocks/mockResponse.d.mts +22 -0
- package/dist/NotificationServicesPushController/mocks/mockResponse.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/mocks/{mockResponse.js → mockResponse.mjs} +2 -2
- package/dist/NotificationServicesPushController/mocks/mockResponse.mjs.map +1 -0
- package/dist/NotificationServicesPushController/services/endpoints.cjs +13 -0
- package/dist/NotificationServicesPushController/services/endpoints.cjs.map +1 -0
- package/dist/NotificationServicesPushController/services/{endpoints.d.ts → endpoints.d.cts} +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/endpoints.d.mts +4 -0
- package/dist/NotificationServicesPushController/services/endpoints.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/{endpoints.js → endpoints.mjs} +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.mjs.map +1 -0
- package/dist/NotificationServicesPushController/services/services.cjs +133 -0
- package/dist/NotificationServicesPushController/services/services.cjs.map +1 -0
- package/dist/NotificationServicesPushController/services/{services.d.ts → services.d.cts} +4 -4
- package/dist/NotificationServicesPushController/services/services.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/services/services.d.mts +90 -0
- package/dist/NotificationServicesPushController/services/services.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/services/{services.js → services.mjs} +2 -2
- package/dist/NotificationServicesPushController/services/services.mjs.map +1 -0
- package/dist/NotificationServicesPushController/types/firebase.cjs +3 -0
- package/dist/NotificationServicesPushController/types/firebase.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/{firebase.d.ts → 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 +2 -0
- package/dist/NotificationServicesPushController/types/firebase.mjs.map +1 -0
- package/dist/NotificationServicesPushController/types/index.cjs +3 -0
- package/dist/NotificationServicesPushController/types/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/index.d.cts +4 -0
- package/dist/NotificationServicesPushController/types/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/index.d.mts +4 -0
- package/dist/NotificationServicesPushController/types/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/index.mjs +2 -0
- package/dist/NotificationServicesPushController/types/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/types/push-analytics.cjs +5 -0
- package/dist/NotificationServicesPushController/types/push-analytics.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/{push-analytics.d.ts → push-analytics.d.cts} +1 -1
- package/dist/NotificationServicesPushController/types/push-analytics.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/push-analytics.d.mts +18 -0
- package/dist/NotificationServicesPushController/types/push-analytics.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/{push-analytics.js → push-analytics.mjs} +1 -1
- package/dist/NotificationServicesPushController/types/push-analytics.mjs.map +1 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.cjs +3 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.cjs.map +1 -0
- package/dist/NotificationServicesPushController/types/{push-service-interface.d.ts → push-service-interface.d.cts} +2 -2
- package/dist/NotificationServicesPushController/types/push-service-interface.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.d.mts +30 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.mjs +2 -0
- package/dist/NotificationServicesPushController/types/push-service-interface.mjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs +84 -0
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/{get-notification-data.d.ts → 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.js → get-notification-data.mjs} +2 -2
- package/dist/NotificationServicesPushController/utils/get-notification-data.mjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +171 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/{get-notification-message.d.ts → 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 +62 -0
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/{get-notification-message.js → get-notification-message.mjs} +2 -2
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.cjs +20 -0
- package/dist/NotificationServicesPushController/utils/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.d.cts +4 -0
- package/dist/NotificationServicesPushController/utils/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.d.mts +4 -0
- package/dist/NotificationServicesPushController/utils/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/index.mjs +4 -0
- package/dist/NotificationServicesPushController/utils/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs +26 -0
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.cjs.map +1 -0
- package/dist/NotificationServicesPushController/utils/{to-push-analytics-payload.d.ts → to-push-analytics-payload.d.cts} +2 -2
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts +12 -0
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/utils/{to-push-analytics-payload.js → to-push-analytics-payload.mjs} +1 -1
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.mjs.map +1 -0
- package/dist/NotificationServicesPushController/web/index.cjs +8 -0
- package/dist/NotificationServicesPushController/web/index.cjs.map +1 -0
- package/dist/NotificationServicesPushController/web/index.d.cts +2 -0
- package/dist/NotificationServicesPushController/web/index.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/web/index.d.mts +2 -0
- package/dist/NotificationServicesPushController/web/index.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/web/index.mjs +2 -0
- package/dist/NotificationServicesPushController/web/index.mjs.map +1 -0
- package/dist/NotificationServicesPushController/web/push-utils.cjs +169 -0
- package/dist/NotificationServicesPushController/web/push-utils.cjs.map +1 -0
- package/dist/NotificationServicesPushController/web/{push-utils.d.ts → push-utils.d.cts} +5 -4
- package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +1 -0
- package/dist/NotificationServicesPushController/web/push-utils.d.mts +37 -0
- package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +1 -0
- package/dist/NotificationServicesPushController/web/{push-utils.js → push-utils.mjs} +13 -6
- package/dist/NotificationServicesPushController/web/push-utils.mjs.map +1 -0
- package/dist/index.cjs +34 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +4 -0
- package/dist/index.mjs.map +1 -0
- package/dist/shared/index.cjs +20 -0
- package/dist/shared/index.cjs.map +1 -0
- package/dist/shared/index.d.cts +4 -0
- package/dist/shared/index.d.cts.map +1 -0
- package/dist/shared/index.d.mts +4 -0
- package/dist/shared/index.d.mts.map +1 -0
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -0
- package/dist/shared/is-onchain-notification.cjs +15 -0
- package/dist/shared/is-onchain-notification.cjs.map +1 -0
- package/dist/shared/{is-onchain-notification.d.ts → is-onchain-notification.d.cts} +2 -2
- package/dist/shared/is-onchain-notification.d.cts.map +1 -0
- package/dist/shared/is-onchain-notification.d.mts +9 -0
- package/dist/shared/is-onchain-notification.d.mts.map +1 -0
- package/dist/shared/{is-onchain-notification.js → is-onchain-notification.mjs} +2 -2
- package/dist/shared/is-onchain-notification.mjs.map +1 -0
- package/dist/shared/notification-api-type-guards.cjs +24 -0
- package/dist/shared/notification-api-type-guards.cjs.map +1 -0
- package/dist/shared/{notification-api-type-guards.d.ts → notification-api-type-guards.d.cts} +2 -2
- package/dist/shared/notification-api-type-guards.d.cts.map +1 -0
- package/dist/shared/notification-api-type-guards.d.mts +16 -0
- package/dist/shared/notification-api-type-guards.d.mts.map +1 -0
- package/dist/shared/{notification-api-type-guards.js → notification-api-type-guards.mjs} +1 -1
- package/dist/shared/notification-api-type-guards.mjs.map +1 -0
- package/dist/shared/to-raw-notification.cjs +30 -0
- package/dist/shared/to-raw-notification.cjs.map +1 -0
- package/dist/shared/{to-raw-notification.d.ts → 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.js → to-raw-notification.mjs} +3 -3
- package/dist/shared/to-raw-notification.mjs.map +1 -0
- package/package.json +58 -24
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.d.ts.map +0 -1
- package/dist/NotificationServicesController/NotificationServicesController-method-action-types.js.map +0 -1
- package/dist/NotificationServicesController/NotificationServicesController.d.ts.map +0 -1
- package/dist/NotificationServicesController/NotificationServicesController.js.map +0 -1
- package/dist/NotificationServicesController/constants/index.d.ts +0 -2
- package/dist/NotificationServicesController/constants/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/constants/index.js +0 -2
- package/dist/NotificationServicesController/constants/index.js.map +0 -1
- package/dist/NotificationServicesController/constants/notification-schema.d.ts.map +0 -1
- package/dist/NotificationServicesController/constants/notification-schema.js.map +0 -1
- package/dist/NotificationServicesController/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/index.js +0 -13
- package/dist/NotificationServicesController/index.js.map +0 -1
- package/dist/NotificationServicesController/mocks/index.d.ts +0 -5
- package/dist/NotificationServicesController/mocks/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/index.js +0 -5
- package/dist/NotificationServicesController/mocks/index.js.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-feature-announcements.js.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.js.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-snap-notification.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/mock-snap-notification.js.map +0 -1
- package/dist/NotificationServicesController/mocks/mockResponses.d.ts.map +0 -1
- package/dist/NotificationServicesController/mocks/mockResponses.js.map +0 -1
- package/dist/NotificationServicesController/processors/index.d.ts +0 -4
- package/dist/NotificationServicesController/processors/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/index.js +0 -4
- package/dist/NotificationServicesController/processors/index.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-api-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/process-api-notifications.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/process-notifications.js.map +0 -1
- package/dist/NotificationServicesController/processors/process-snap-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/processors/process-snap-notifications.js.map +0 -1
- package/dist/NotificationServicesController/services/api-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/services/api-notifications.js.map +0 -1
- package/dist/NotificationServicesController/services/feature-announcements.d.ts.map +0 -1
- package/dist/NotificationServicesController/services/feature-announcements.js.map +0 -1
- package/dist/NotificationServicesController/services/notification-config-cache.d.ts.map +0 -1
- package/dist/NotificationServicesController/services/notification-config-cache.js.map +0 -1
- package/dist/NotificationServicesController/services/perp-notifications.d.ts.map +0 -1
- package/dist/NotificationServicesController/services/perp-notifications.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/feature-announcement.d.ts.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.d.ts +0 -4
- package/dist/NotificationServicesController/types/feature-announcement/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/index.js +0 -2
- package/dist/NotificationServicesController/types/feature-announcement/index.js.map +0 -1
- package/dist/NotificationServicesController/types/feature-announcement/type-feature-announcement.d.ts.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.d.ts.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.d.ts +0 -6
- package/dist/NotificationServicesController/types/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/index.js +0 -2
- package/dist/NotificationServicesController/types/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification/index.d.ts +0 -2
- package/dist/NotificationServicesController/types/notification/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/notification/index.js +0 -2
- package/dist/NotificationServicesController/types/notification/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification/notification.d.ts.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/notification-api/index.d.ts +0 -3
- package/dist/NotificationServicesController/types/notification-api/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/index.js +0 -2
- package/dist/NotificationServicesController/types/notification-api/index.js.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/notification-api.js +0 -2
- package/dist/NotificationServicesController/types/notification-api/notification-api.js.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/schema.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/notification-api/schema.js.map +0 -1
- package/dist/NotificationServicesController/types/perps/index.d.ts +0 -2
- package/dist/NotificationServicesController/types/perps/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/perps/index.js +0 -2
- package/dist/NotificationServicesController/types/perps/index.js.map +0 -1
- package/dist/NotificationServicesController/types/perps/perp-types.d.ts +0 -3
- package/dist/NotificationServicesController/types/perps/perp-types.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/perps/perp-types.js +0 -2
- package/dist/NotificationServicesController/types/perps/perp-types.js.map +0 -1
- package/dist/NotificationServicesController/types/perps/schema.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/perps/schema.js.map +0 -1
- package/dist/NotificationServicesController/types/snaps/index.d.ts +0 -2
- package/dist/NotificationServicesController/types/snaps/index.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/snaps/index.js +0 -2
- package/dist/NotificationServicesController/types/snaps/index.js.map +0 -1
- package/dist/NotificationServicesController/types/snaps/snaps.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/snaps/snaps.js +0 -2
- package/dist/NotificationServicesController/types/snaps/snaps.js.map +0 -1
- package/dist/NotificationServicesController/types/type-utils.d.ts.map +0 -1
- package/dist/NotificationServicesController/types/type-utils.js +0 -2
- package/dist/NotificationServicesController/types/type-utils.js.map +0 -1
- package/dist/NotificationServicesController/utils/get-notification-subtype.d.ts.map +0 -1
- package/dist/NotificationServicesController/utils/get-notification-subtype.js.map +0 -1
- package/dist/NotificationServicesController/utils/isVersionInBounds.d.ts.map +0 -1
- package/dist/NotificationServicesController/utils/isVersionInBounds.js.map +0 -1
- package/dist/NotificationServicesController/utils/should-auto-expire.d.ts.map +0 -1
- package/dist/NotificationServicesController/utils/should-auto-expire.js.map +0 -1
- package/dist/NotificationServicesController/utils/utils.d.ts.map +0 -1
- package/dist/NotificationServicesController/utils/utils.js.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController-method-action-types.js.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js.map +0 -1
- package/dist/NotificationServicesPushController/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/index.js +0 -8
- package/dist/NotificationServicesPushController/index.js.map +0 -1
- package/dist/NotificationServicesPushController/mocks/index.d.ts +0 -2
- package/dist/NotificationServicesPushController/mocks/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/mocks/index.js +0 -2
- package/dist/NotificationServicesPushController/mocks/index.js.map +0 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.js.map +0 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/services/endpoints.js.map +0 -1
- package/dist/NotificationServicesPushController/services/services.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/services/services.js.map +0 -1
- package/dist/NotificationServicesPushController/types/firebase.d.ts.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.d.ts +0 -4
- package/dist/NotificationServicesPushController/types/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/types/index.js +0 -2
- package/dist/NotificationServicesPushController/types/index.js.map +0 -1
- package/dist/NotificationServicesPushController/types/push-analytics.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/types/push-analytics.js.map +0 -1
- package/dist/NotificationServicesPushController/types/push-service-interface.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/types/push-service-interface.js +0 -2
- package/dist/NotificationServicesPushController/types/push-service-interface.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/index.d.ts +0 -4
- package/dist/NotificationServicesPushController/utils/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/utils/index.js +0 -4
- package/dist/NotificationServicesPushController/utils/index.js.map +0 -1
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/utils/to-push-analytics-payload.js.map +0 -1
- package/dist/NotificationServicesPushController/web/index.d.ts +0 -2
- package/dist/NotificationServicesPushController/web/index.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/web/index.js +0 -2
- package/dist/NotificationServicesPushController/web/index.js.map +0 -1
- package/dist/NotificationServicesPushController/web/push-utils.d.ts.map +0 -1
- package/dist/NotificationServicesPushController/web/push-utils.js.map +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +0 -1
- package/dist/shared/index.d.ts +0 -4
- package/dist/shared/index.d.ts.map +0 -1
- package/dist/shared/index.js +0 -4
- package/dist/shared/index.js.map +0 -1
- package/dist/shared/is-onchain-notification.d.ts.map +0 -1
- package/dist/shared/is-onchain-notification.js.map +0 -1
- package/dist/shared/notification-api-type-guards.d.ts.map +0 -1
- package/dist/shared/notification-api-type-guards.js.map +0 -1
- package/dist/shared/to-raw-notification.d.ts.map +0 -1
- package/dist/shared/to-raw-notification.js.map +0 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createOnChainPushNotificationMessage = exports.createOnChainPushNotificationMessages = void 0;
|
|
4
|
+
const get_notification_data_js_1 = require("./get-notification-data.cjs");
|
|
5
|
+
/**
|
|
6
|
+
* On Chain Push Notification Messages.
|
|
7
|
+
* This is a list of all the push notifications we support. Update this for synced notifications on mobile and extension
|
|
8
|
+
*
|
|
9
|
+
* @param translationKeys - all translations supported
|
|
10
|
+
* @returns A translation push message object.
|
|
11
|
+
*/
|
|
12
|
+
const createOnChainPushNotificationMessages = (translationKeys) => {
|
|
13
|
+
const translate = (...args) => {
|
|
14
|
+
const [key, ...otherArgs] = args;
|
|
15
|
+
// Coerce types for the translation function
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
+
const fn = translationKeys[key];
|
|
18
|
+
return fn(...otherArgs);
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
erc20_sent: {
|
|
22
|
+
title: () => translate('pushPlatformNotificationsFundsSentTitle'),
|
|
23
|
+
defaultDescription: () => translate('pushPlatformNotificationsFundsSentDescriptionDefault'),
|
|
24
|
+
getDescription: (notification) => {
|
|
25
|
+
const symbol = notification?.payload?.data?.token?.symbol;
|
|
26
|
+
const tokenAmount = notification?.payload?.data?.token?.amount;
|
|
27
|
+
const tokenDecimals = notification?.payload?.data?.token?.decimals;
|
|
28
|
+
if (!symbol || !tokenAmount || !tokenDecimals) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
const amount = (0, get_notification_data_js_1.getAmount)(tokenAmount, tokenDecimals, {
|
|
32
|
+
shouldEllipse: true,
|
|
33
|
+
});
|
|
34
|
+
return translate('pushPlatformNotificationsFundsSentDescription', amount, symbol);
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
eth_sent: {
|
|
38
|
+
title: () => translate('pushPlatformNotificationsFundsSentTitle'),
|
|
39
|
+
defaultDescription: () => translate('pushPlatformNotificationsFundsSentDescriptionDefault'),
|
|
40
|
+
getDescription: (notification) => {
|
|
41
|
+
const symbol = notification?.payload?.network?.native_symbol;
|
|
42
|
+
const tokenAmount = notification?.payload?.data?.amount?.eth;
|
|
43
|
+
if (!symbol || !tokenAmount) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
const amount = (0, get_notification_data_js_1.formatAmount)(parseFloat(tokenAmount), {
|
|
47
|
+
shouldEllipse: true,
|
|
48
|
+
});
|
|
49
|
+
return translate('pushPlatformNotificationsFundsSentDescription', amount, symbol);
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
erc20_received: {
|
|
53
|
+
title: () => translate('pushPlatformNotificationsFundsReceivedTitle'),
|
|
54
|
+
defaultDescription: () => translate('pushPlatformNotificationsFundsReceivedDescriptionDefault'),
|
|
55
|
+
getDescription: (notification) => {
|
|
56
|
+
const symbol = notification?.payload?.data?.token?.symbol;
|
|
57
|
+
const tokenAmount = notification?.payload?.data?.token?.amount;
|
|
58
|
+
const tokenDecimals = notification?.payload?.data?.token?.decimals;
|
|
59
|
+
if (!symbol || !tokenAmount || !tokenDecimals) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
const amount = (0, get_notification_data_js_1.getAmount)(tokenAmount, tokenDecimals, {
|
|
63
|
+
shouldEllipse: true,
|
|
64
|
+
});
|
|
65
|
+
return translate('pushPlatformNotificationsFundsReceivedDescription', amount, symbol);
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
eth_received: {
|
|
69
|
+
title: () => translate('pushPlatformNotificationsFundsReceivedTitle'),
|
|
70
|
+
defaultDescription: () => translate('pushPlatformNotificationsFundsReceivedDescriptionDefault'),
|
|
71
|
+
getDescription: (notification) => {
|
|
72
|
+
const symbol = notification?.payload?.network?.native_symbol;
|
|
73
|
+
const tokenAmount = notification?.payload?.data?.amount?.eth;
|
|
74
|
+
if (!symbol || !tokenAmount) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
const amount = (0, get_notification_data_js_1.formatAmount)(parseFloat(tokenAmount), {
|
|
78
|
+
shouldEllipse: true,
|
|
79
|
+
});
|
|
80
|
+
return translate('pushPlatformNotificationsFundsReceivedDescription', amount, symbol);
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
metamask_swap_completed: {
|
|
84
|
+
title: () => translate('pushPlatformNotificationsSwapCompletedTitle'),
|
|
85
|
+
defaultDescription: () => translate('pushPlatformNotificationsSwapCompletedDescription'),
|
|
86
|
+
},
|
|
87
|
+
erc721_sent: {
|
|
88
|
+
title: () => translate('pushPlatformNotificationsNftSentTitle'),
|
|
89
|
+
defaultDescription: () => translate('pushPlatformNotificationsNftSentDescription'),
|
|
90
|
+
},
|
|
91
|
+
erc1155_sent: {
|
|
92
|
+
title: () => translate('pushPlatformNotificationsNftSentTitle'),
|
|
93
|
+
defaultDescription: () => translate('pushPlatformNotificationsNftSentDescription'),
|
|
94
|
+
},
|
|
95
|
+
erc721_received: {
|
|
96
|
+
title: () => translate('pushPlatformNotificationsNftReceivedTitle'),
|
|
97
|
+
defaultDescription: () => translate('pushPlatformNotificationsNftReceivedDescription'),
|
|
98
|
+
},
|
|
99
|
+
erc1155_received: {
|
|
100
|
+
title: () => translate('pushPlatformNotificationsNftReceivedTitle'),
|
|
101
|
+
defaultDescription: () => translate('pushPlatformNotificationsNftReceivedDescription'),
|
|
102
|
+
},
|
|
103
|
+
rocketpool_stake_completed: {
|
|
104
|
+
title: () => translate('pushPlatformNotificationsStakingRocketpoolStakeCompletedTitle'),
|
|
105
|
+
defaultDescription: () => translate('pushPlatformNotificationsStakingRocketpoolStakeCompletedDescription'),
|
|
106
|
+
},
|
|
107
|
+
rocketpool_unstake_completed: {
|
|
108
|
+
title: () => translate('pushPlatformNotificationsStakingRocketpoolUnstakeCompletedTitle'),
|
|
109
|
+
defaultDescription: () => translate('pushPlatformNotificationsStakingRocketpoolUnstakeCompletedDescription'),
|
|
110
|
+
},
|
|
111
|
+
lido_stake_completed: {
|
|
112
|
+
title: () => translate('pushPlatformNotificationsStakingLidoStakeCompletedTitle'),
|
|
113
|
+
defaultDescription: () => translate('pushPlatformNotificationsStakingLidoStakeCompletedDescription'),
|
|
114
|
+
},
|
|
115
|
+
lido_stake_ready_to_be_withdrawn: {
|
|
116
|
+
title: () => translate('pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnTitle'),
|
|
117
|
+
defaultDescription: () => translate('pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnDescription'),
|
|
118
|
+
},
|
|
119
|
+
lido_withdrawal_requested: {
|
|
120
|
+
title: () => translate('pushPlatformNotificationsStakingLidoWithdrawalRequestedTitle'),
|
|
121
|
+
defaultDescription: () => translate('pushPlatformNotificationsStakingLidoWithdrawalRequestedDescription'),
|
|
122
|
+
},
|
|
123
|
+
lido_withdrawal_completed: {
|
|
124
|
+
title: () => translate('pushPlatformNotificationsStakingLidoWithdrawalCompletedTitle'),
|
|
125
|
+
defaultDescription: () => translate('pushPlatformNotificationsStakingLidoWithdrawalCompletedDescription'),
|
|
126
|
+
},
|
|
127
|
+
platform: {
|
|
128
|
+
title: (notification) => notification.template.title,
|
|
129
|
+
defaultDescription: (notification) => notification.template.body,
|
|
130
|
+
getDescription: (notification) => notification.template.body,
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
exports.createOnChainPushNotificationMessages = createOnChainPushNotificationMessages;
|
|
135
|
+
/**
|
|
136
|
+
* Creates a push notification message based on the given on-chain raw notification.
|
|
137
|
+
*
|
|
138
|
+
* @param notification - processed notification.
|
|
139
|
+
* @param translations - translates keys into text
|
|
140
|
+
* @returns The push notification message object, or null if the notification is invalid.
|
|
141
|
+
*/
|
|
142
|
+
function createOnChainPushNotificationMessage(notification, translations) {
|
|
143
|
+
if (!notification?.type) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
const notificationMessage = (0, exports.createOnChainPushNotificationMessages)(translations)[notification.type];
|
|
147
|
+
if (!notificationMessage) {
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
let description = null;
|
|
151
|
+
try {
|
|
152
|
+
description =
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
154
|
+
notificationMessage?.getDescription?.(notification) ??
|
|
155
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
156
|
+
notificationMessage.defaultDescription?.(notification) ??
|
|
157
|
+
null;
|
|
158
|
+
}
|
|
159
|
+
catch {
|
|
160
|
+
description =
|
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
162
|
+
notificationMessage.defaultDescription?.(notification) ?? null;
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
166
|
+
title: notificationMessage?.title?.(notification) ?? '', // Ensure title is always a string
|
|
167
|
+
description: description ?? '', // Fallback to empty string if null
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
exports.createOnChainPushNotificationMessage = createOnChainPushNotificationMessage;
|
|
171
|
+
//# sourceMappingURL=get-notification-message.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-notification-message.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/get-notification-message.ts"],"names":[],"mappings":";;;AAEA,0EAAqE;AAoDrE;;;;;;GAMG;AACI,MAAM,qCAAqC,GAAG,CACnD,eAAgC,EACP,EAAE;IAI3B,MAAM,SAAS,GAAkB,CAAC,GAAG,IAAI,EAAE,EAAE;QAC3C,MAAM,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;QAEjC,4CAA4C;QAC5C,8DAA8D;QAC9D,MAAM,EAAE,GAAQ,eAAe,CAAC,GAAG,CAAC,CAAC;QACrC,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO;QACL,UAAU,EAAE;YACV,KAAK,EAAE,GAAkB,EAAE,CACzB,SAAS,C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mBAAmB,GACvB,IAAA,6CAAqC,EAAC,YAAY,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAEzE,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,WAAW,GAAkB,IAAI,CAAC;IACtC,IAAI,CAAC;QACH,WAAW;YACT,8DAA8D;YAC9D,mBAAmB,EAAE,cAAc,EAAE,CAAC,YAAmB,CAAC;gBAC1D,8DAA8D;gBAC9D,mBAAmB,CAAC,kBAAkB,EAAE,CAAC,YAAmB,CAAC;gBAC7D,IAAI,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;YACT,8DAA8D;YAC9D,mBAAmB,CAAC,kBAAkB,EAAE,CAAC,YAAmB,CAAC,IAAI,IAAI,CAAC;IAC1E,CAAC;IAED,OAAO;QACL,8DAA8D;QAC9D,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,YAAmB,CAAC,IAAI,EAAE,EAAE,kCAAkC;QAClG,WAAW,EAAE,WAAW,IAAI,EAAE,EAAE,mCAAmC;KACpE,CAAC;AACJ,CAAC;AAjCD,oFAiCC","sourcesContent":["import type { Types } from '../../NotificationServicesController/index.js';\nimport type { Constants } from '../../NotificationServicesController/index.js';\nimport { getAmount, formatAmount } from './get-notification-data.js';\n\nexport type TranslationKeys = {\n pushPlatformNotificationsFundsSentTitle: () => string;\n pushPlatformNotificationsFundsSentDescriptionDefault: () => string;\n pushPlatformNotificationsFundsSentDescription: (\n ...args: [string, string]\n ) => string;\n pushPlatformNotificationsFundsReceivedTitle: () => string;\n pushPlatformNotificationsFundsReceivedDescriptionDefault: () => string;\n pushPlatformNotificationsFundsReceivedDescription: (\n ...args: [string, string]\n ) => string;\n pushPlatformNotificationsSwapCompletedTitle: () => string;\n pushPlatformNotificationsSwapCompletedDescription: () => string;\n pushPlatformNotificationsNftSentTitle: () => string;\n pushPlatformNotificationsNftSentDescription: () => string;\n pushPlatformNotificationsNftReceivedTitle: () => string;\n pushPlatformNotificationsNftReceivedDescription: () => string;\n pushPlatformNotificationsStakingRocketpoolStakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingRocketpoolStakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingRocketpoolUnstakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingRocketpoolUnstakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingLidoStakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingLidoStakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnTitle: () => string;\n pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnDescription: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalRequestedTitle: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalRequestedDescription: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalCompletedTitle: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalCompletedDescription: () => string;\n};\n\ntype PushNotificationMessage = {\n title: string;\n description: string;\n ctaLink?: string;\n};\n\ntype NotificationMessage<TNotification extends Types.INotification> = {\n title: (notification: TNotification) => string | null;\n defaultDescription: (notification: TNotification) => string | null;\n getDescription?: (notification: TNotification) => string | null;\n link?: (notification: TNotification) => string | null;\n};\n\ntype NotificationMessageDict = {\n [TriggerType in Constants.TRIGGER_TYPES]?: NotificationMessage<\n Extract<Types.INotification, { type: TriggerType }>\n >;\n};\n\n/**\n * On Chain Push Notification Messages.\n * This is a list of all the push notifications we support. Update this for synced notifications on mobile and extension\n *\n * @param translationKeys - all translations supported\n * @returns A translation push message object.\n */\nexport const createOnChainPushNotificationMessages = (\n translationKeys: TranslationKeys,\n): NotificationMessageDict => {\n type TranslationFn = <TKey extends keyof TranslationKeys>(\n ...args: [TKey, ...Parameters<TranslationKeys[TKey]>]\n ) => string;\n const translate: TranslationFn = (...args) => {\n const [key, ...otherArgs] = args;\n\n // Coerce types for the translation function\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const fn: any = translationKeys[key];\n return fn(...otherArgs);\n };\n\n return {\n erc20_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsSentDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.data?.token?.symbol;\n const tokenAmount = notification?.payload?.data?.token?.amount;\n const tokenDecimals = notification?.payload?.data?.token?.decimals;\n if (!symbol || !tokenAmount || !tokenDecimals) {\n return null;\n }\n\n const amount = getAmount(tokenAmount, tokenDecimals, {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsSentDescription',\n amount,\n symbol,\n );\n },\n },\n eth_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsSentDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.network?.native_symbol;\n const tokenAmount = notification?.payload?.data?.amount?.eth;\n if (!symbol || !tokenAmount) {\n return null;\n }\n\n const amount = formatAmount(parseFloat(tokenAmount), {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsSentDescription',\n amount,\n symbol,\n );\n },\n },\n erc20_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.data?.token?.symbol;\n const tokenAmount = notification?.payload?.data?.token?.amount;\n const tokenDecimals = notification?.payload?.data?.token?.decimals;\n if (!symbol || !tokenAmount || !tokenDecimals) {\n return null;\n }\n\n const amount = getAmount(tokenAmount, tokenDecimals, {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsReceivedDescription',\n amount,\n symbol,\n );\n },\n },\n eth_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.network?.native_symbol;\n const tokenAmount = notification?.payload?.data?.amount?.eth;\n if (!symbol || !tokenAmount) {\n return null;\n }\n\n const amount = formatAmount(parseFloat(tokenAmount), {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsReceivedDescription',\n amount,\n symbol,\n );\n },\n },\n metamask_swap_completed: {\n title: (): string | null =>\n translate('pushPlatformNotificationsSwapCompletedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsSwapCompletedDescription'),\n },\n erc721_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftSentDescription'),\n },\n erc1155_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftSentDescription'),\n },\n erc721_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedDescription'),\n },\n erc1155_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedDescription'),\n },\n rocketpool_stake_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolStakeCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolStakeCompletedDescription',\n ),\n },\n rocketpool_unstake_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolUnstakeCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolUnstakeCompletedDescription',\n ),\n },\n lido_stake_completed: {\n title: (): string | null =>\n translate('pushPlatformNotificationsStakingLidoStakeCompletedTitle'),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeCompletedDescription',\n ),\n },\n lido_stake_ready_to_be_withdrawn: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnDescription',\n ),\n },\n lido_withdrawal_requested: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalRequestedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalRequestedDescription',\n ),\n },\n lido_withdrawal_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalCompletedDescription',\n ),\n },\n platform: {\n title: (notification): string | null => notification.template.title,\n defaultDescription: (notification): string | null =>\n notification.template.body,\n getDescription: (notification): string | null =>\n notification.template.body,\n },\n };\n};\n\n/**\n * Creates a push notification message based on the given on-chain raw notification.\n *\n * @param notification - processed notification.\n * @param translations - translates keys into text\n * @returns The push notification message object, or null if the notification is invalid.\n */\nexport function createOnChainPushNotificationMessage(\n notification: Types.INotification,\n translations: TranslationKeys,\n): PushNotificationMessage | null {\n if (!notification?.type) {\n return null;\n }\n const notificationMessage =\n createOnChainPushNotificationMessages(translations)[notification.type];\n\n if (!notificationMessage) {\n return null;\n }\n\n let description: string | null = null;\n try {\n description =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage?.getDescription?.(notification as any) ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage.defaultDescription?.(notification as any) ??\n null;\n } catch {\n description =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage.defaultDescription?.(notification as any) ?? null;\n }\n\n return {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n title: notificationMessage?.title?.(notification as any) ?? '', // Ensure title is always a string\n description: description ?? '', // Fallback to empty string if null\n };\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Types } from
|
|
2
|
-
import type { Constants } from
|
|
1
|
+
import type { Types } from "../../NotificationServicesController/index.cjs";
|
|
2
|
+
import type { Constants } from "../../NotificationServicesController/index.cjs";
|
|
3
3
|
export type TranslationKeys = {
|
|
4
4
|
pushPlatformNotificationsFundsSentTitle: () => string;
|
|
5
5
|
pushPlatformNotificationsFundsSentDescriptionDefault: () => string;
|
|
@@ -59,4 +59,4 @@ export declare const createOnChainPushNotificationMessages: (translationKeys: Tr
|
|
|
59
59
|
*/
|
|
60
60
|
export declare function createOnChainPushNotificationMessage(notification: Types.INotification, translations: TranslationKeys): PushNotificationMessage | null;
|
|
61
61
|
export {};
|
|
62
|
-
//# sourceMappingURL=get-notification-message.d.
|
|
62
|
+
//# sourceMappingURL=get-notification-message.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-notification-message.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/get-notification-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,uDAAsD;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,uDAAsD;AAG/E,MAAM,MAAM,eAAe,GAAG;IAC5B,uCAAuC,EAAE,MAAM,MAAM,CAAC;IACtD,oDAAoD,EAAE,MAAM,MAAM,CAAC;IACnE,6CAA6C,EAAE,CAC7C,GAAG,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KACtB,MAAM,CAAC;IACZ,2CAA2C,EAAE,MAAM,MAAM,CAAC;IAC1D,wDAAwD,EAAE,MAAM,MAAM,CAAC;IACvE,iDAAiD,EAAE,CACjD,GAAG,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KACtB,MAAM,CAAC;IACZ,2CAA2C,EAAE,MAAM,MAAM,C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W,IAAI,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,mBAAmB,CAC5D,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE;QAAE,IAAI,EAAE,WAAW,CAAA;KAAE,CAAC,CACpD;CACF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC,oBAC/B,eAAe,KAC/B,uBAwMF,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAClD,YAAY,EAAE,KAAK,CAAC,aAAa,EACjC,YAAY,EAAE,eAAe,GAC5B,uBAAuB,GAAG,IAAI,CA8BhC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Types } from "../../NotificationServicesController/index.mjs";
|
|
2
|
+
import type { Constants } from "../../NotificationServicesController/index.mjs";
|
|
3
|
+
export type TranslationKeys = {
|
|
4
|
+
pushPlatformNotificationsFundsSentTitle: () => string;
|
|
5
|
+
pushPlatformNotificationsFundsSentDescriptionDefault: () => string;
|
|
6
|
+
pushPlatformNotificationsFundsSentDescription: (...args: [string, string]) => string;
|
|
7
|
+
pushPlatformNotificationsFundsReceivedTitle: () => string;
|
|
8
|
+
pushPlatformNotificationsFundsReceivedDescriptionDefault: () => string;
|
|
9
|
+
pushPlatformNotificationsFundsReceivedDescription: (...args: [string, string]) => string;
|
|
10
|
+
pushPlatformNotificationsSwapCompletedTitle: () => string;
|
|
11
|
+
pushPlatformNotificationsSwapCompletedDescription: () => string;
|
|
12
|
+
pushPlatformNotificationsNftSentTitle: () => string;
|
|
13
|
+
pushPlatformNotificationsNftSentDescription: () => string;
|
|
14
|
+
pushPlatformNotificationsNftReceivedTitle: () => string;
|
|
15
|
+
pushPlatformNotificationsNftReceivedDescription: () => string;
|
|
16
|
+
pushPlatformNotificationsStakingRocketpoolStakeCompletedTitle: () => string;
|
|
17
|
+
pushPlatformNotificationsStakingRocketpoolStakeCompletedDescription: () => string;
|
|
18
|
+
pushPlatformNotificationsStakingRocketpoolUnstakeCompletedTitle: () => string;
|
|
19
|
+
pushPlatformNotificationsStakingRocketpoolUnstakeCompletedDescription: () => string;
|
|
20
|
+
pushPlatformNotificationsStakingLidoStakeCompletedTitle: () => string;
|
|
21
|
+
pushPlatformNotificationsStakingLidoStakeCompletedDescription: () => string;
|
|
22
|
+
pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnTitle: () => string;
|
|
23
|
+
pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnDescription: () => string;
|
|
24
|
+
pushPlatformNotificationsStakingLidoWithdrawalRequestedTitle: () => string;
|
|
25
|
+
pushPlatformNotificationsStakingLidoWithdrawalRequestedDescription: () => string;
|
|
26
|
+
pushPlatformNotificationsStakingLidoWithdrawalCompletedTitle: () => string;
|
|
27
|
+
pushPlatformNotificationsStakingLidoWithdrawalCompletedDescription: () => string;
|
|
28
|
+
};
|
|
29
|
+
type PushNotificationMessage = {
|
|
30
|
+
title: string;
|
|
31
|
+
description: string;
|
|
32
|
+
ctaLink?: string;
|
|
33
|
+
};
|
|
34
|
+
type NotificationMessage<TNotification extends Types.INotification> = {
|
|
35
|
+
title: (notification: TNotification) => string | null;
|
|
36
|
+
defaultDescription: (notification: TNotification) => string | null;
|
|
37
|
+
getDescription?: (notification: TNotification) => string | null;
|
|
38
|
+
link?: (notification: TNotification) => string | null;
|
|
39
|
+
};
|
|
40
|
+
type NotificationMessageDict = {
|
|
41
|
+
[TriggerType in Constants.TRIGGER_TYPES]?: NotificationMessage<Extract<Types.INotification, {
|
|
42
|
+
type: TriggerType;
|
|
43
|
+
}>>;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* On Chain Push Notification Messages.
|
|
47
|
+
* This is a list of all the push notifications we support. Update this for synced notifications on mobile and extension
|
|
48
|
+
*
|
|
49
|
+
* @param translationKeys - all translations supported
|
|
50
|
+
* @returns A translation push message object.
|
|
51
|
+
*/
|
|
52
|
+
export declare const createOnChainPushNotificationMessages: (translationKeys: TranslationKeys) => NotificationMessageDict;
|
|
53
|
+
/**
|
|
54
|
+
* Creates a push notification message based on the given on-chain raw notification.
|
|
55
|
+
*
|
|
56
|
+
* @param notification - processed notification.
|
|
57
|
+
* @param translations - translates keys into text
|
|
58
|
+
* @returns The push notification message object, or null if the notification is invalid.
|
|
59
|
+
*/
|
|
60
|
+
export declare function createOnChainPushNotificationMessage(notification: Types.INotification, translations: TranslationKeys): PushNotificationMessage | null;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=get-notification-message.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-notification-message.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/get-notification-message.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,uDAAsD;AAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,uDAAsD;AAG/E,MAAM,MAAM,eAAe,GAAG;IAC5B,uCAAuC,EAAE,MAAM,MAAM,CAAC;IACtD,oDAAoD,EAAE,MAAM,MAAM,CAAC;IACnE,6CAA6C,EAAE,CAC7C,GAAG,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KACtB,MAAM,CAAC;IACZ,2CAA2C,EAAE,MAAM,MAAM,CAAC;IAC1D,wDAAwD,EAAE,MAAM,MAAM,CAAC;IACvE,iDAAiD,EAAE,CACjD,GAAG,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KACtB,MAAM,CAAC;IACZ,2CAA2C,EAAE,MAAM,MAAM,CAAC;IAC1D,iDAAiD,EAAE,MAAM,MAAM,CAAC;IAChE,qCAAqC,EAAE,MAAM,MAAM,CAAC;IACpD,2CAA2C,EAAE,MAAM,MAAM,CAAC;IAC1D,yCAAyC,EAAE,MAAM,MAAM,CAAC;IACxD,+CAA+C,EAAE,MAAM,MAAM,CAAC;IAC9D,6DAA6D,EAAE,MAAM,MAAM,CAAC;IAC5E,mEAAmE,EAAE,MAAM,MAAM,CAAC;IAClF,+DAA+D,EAAE,MA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C,aAAa,EACjC,YAAY,EAAE,eAAe,GAC5B,uBAAuB,GAAG,IAAI,CA8BhC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getAmount, formatAmount } from
|
|
1
|
+
import { getAmount, formatAmount } from "./get-notification-data.mjs";
|
|
2
2
|
/**
|
|
3
3
|
* On Chain Push Notification Messages.
|
|
4
4
|
* This is a list of all the push notifications we support. Update this for synced notifications on mobile and extension
|
|
@@ -163,4 +163,4 @@ export function createOnChainPushNotificationMessage(notification, translations)
|
|
|
163
163
|
description: description ?? '', // Fallback to empty string if null
|
|
164
164
|
};
|
|
165
165
|
}
|
|
166
|
-
//# sourceMappingURL=get-notification-message.
|
|
166
|
+
//# sourceMappingURL=get-notification-message.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-notification-message.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/get-notification-message.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,oCAAmC;AAoDrE;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CACnD,eAAgC,EACP,EAAE;IAI3B,MAAM,SAAS,GAAkB,CAAC,GAAG,IAAI,EAAE,EAAE;QAC3C,MAAM,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;QAEjC,4CAA4C;QAC5C,8DAA8D;QAC9D,MAAM,EAAE,GAAQ,eAAe,CAAC,GAAG,CAAC,CAAC;QACrC,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO;QACL,UAAU,EAAE;YACV,KAAK,EAAE,GAAkB,EAAE,CACzB,SAAS,CAAC,yCAAyC,CAAC;YACtD,kBAAkB,EAAE,GAAkB,EAAE,CACtC,SAAS,CAAC,sDAAsD,CAAC;YACnE,cAAc,EAAE,CAAC,YAAY,EAAiB,EAAE;gBAC9C,MAAM,MAAM,GAAG,Y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AAW;YACT,8DAA8D;YAC9D,mBAAmB,EAAE,cAAc,EAAE,CAAC,YAAmB,CAAC;gBAC1D,8DAA8D;gBAC9D,mBAAmB,CAAC,kBAAkB,EAAE,CAAC,YAAmB,CAAC;gBAC7D,IAAI,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,WAAW;YACT,8DAA8D;YAC9D,mBAAmB,CAAC,kBAAkB,EAAE,CAAC,YAAmB,CAAC,IAAI,IAAI,CAAC;IAC1E,CAAC;IAED,OAAO;QACL,8DAA8D;QAC9D,KAAK,EAAE,mBAAmB,EAAE,KAAK,EAAE,CAAC,YAAmB,CAAC,IAAI,EAAE,EAAE,kCAAkC;QAClG,WAAW,EAAE,WAAW,IAAI,EAAE,EAAE,mCAAmC;KACpE,CAAC;AACJ,CAAC","sourcesContent":["import type { Types } from '../../NotificationServicesController/index.js';\nimport type { Constants } from '../../NotificationServicesController/index.js';\nimport { getAmount, formatAmount } from './get-notification-data.js';\n\nexport type TranslationKeys = {\n pushPlatformNotificationsFundsSentTitle: () => string;\n pushPlatformNotificationsFundsSentDescriptionDefault: () => string;\n pushPlatformNotificationsFundsSentDescription: (\n ...args: [string, string]\n ) => string;\n pushPlatformNotificationsFundsReceivedTitle: () => string;\n pushPlatformNotificationsFundsReceivedDescriptionDefault: () => string;\n pushPlatformNotificationsFundsReceivedDescription: (\n ...args: [string, string]\n ) => string;\n pushPlatformNotificationsSwapCompletedTitle: () => string;\n pushPlatformNotificationsSwapCompletedDescription: () => string;\n pushPlatformNotificationsNftSentTitle: () => string;\n pushPlatformNotificationsNftSentDescription: () => string;\n pushPlatformNotificationsNftReceivedTitle: () => string;\n pushPlatformNotificationsNftReceivedDescription: () => string;\n pushPlatformNotificationsStakingRocketpoolStakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingRocketpoolStakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingRocketpoolUnstakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingRocketpoolUnstakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingLidoStakeCompletedTitle: () => string;\n pushPlatformNotificationsStakingLidoStakeCompletedDescription: () => string;\n pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnTitle: () => string;\n pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnDescription: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalRequestedTitle: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalRequestedDescription: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalCompletedTitle: () => string;\n pushPlatformNotificationsStakingLidoWithdrawalCompletedDescription: () => string;\n};\n\ntype PushNotificationMessage = {\n title: string;\n description: string;\n ctaLink?: string;\n};\n\ntype NotificationMessage<TNotification extends Types.INotification> = {\n title: (notification: TNotification) => string | null;\n defaultDescription: (notification: TNotification) => string | null;\n getDescription?: (notification: TNotification) => string | null;\n link?: (notification: TNotification) => string | null;\n};\n\ntype NotificationMessageDict = {\n [TriggerType in Constants.TRIGGER_TYPES]?: NotificationMessage<\n Extract<Types.INotification, { type: TriggerType }>\n >;\n};\n\n/**\n * On Chain Push Notification Messages.\n * This is a list of all the push notifications we support. Update this for synced notifications on mobile and extension\n *\n * @param translationKeys - all translations supported\n * @returns A translation push message object.\n */\nexport const createOnChainPushNotificationMessages = (\n translationKeys: TranslationKeys,\n): NotificationMessageDict => {\n type TranslationFn = <TKey extends keyof TranslationKeys>(\n ...args: [TKey, ...Parameters<TranslationKeys[TKey]>]\n ) => string;\n const translate: TranslationFn = (...args) => {\n const [key, ...otherArgs] = args;\n\n // Coerce types for the translation function\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const fn: any = translationKeys[key];\n return fn(...otherArgs);\n };\n\n return {\n erc20_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsSentDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.data?.token?.symbol;\n const tokenAmount = notification?.payload?.data?.token?.amount;\n const tokenDecimals = notification?.payload?.data?.token?.decimals;\n if (!symbol || !tokenAmount || !tokenDecimals) {\n return null;\n }\n\n const amount = getAmount(tokenAmount, tokenDecimals, {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsSentDescription',\n amount,\n symbol,\n );\n },\n },\n eth_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsSentDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.network?.native_symbol;\n const tokenAmount = notification?.payload?.data?.amount?.eth;\n if (!symbol || !tokenAmount) {\n return null;\n }\n\n const amount = formatAmount(parseFloat(tokenAmount), {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsSentDescription',\n amount,\n symbol,\n );\n },\n },\n erc20_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.data?.token?.symbol;\n const tokenAmount = notification?.payload?.data?.token?.amount;\n const tokenDecimals = notification?.payload?.data?.token?.decimals;\n if (!symbol || !tokenAmount || !tokenDecimals) {\n return null;\n }\n\n const amount = getAmount(tokenAmount, tokenDecimals, {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsReceivedDescription',\n amount,\n symbol,\n );\n },\n },\n eth_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsFundsReceivedDescriptionDefault'),\n getDescription: (notification): string | null => {\n const symbol = notification?.payload?.network?.native_symbol;\n const tokenAmount = notification?.payload?.data?.amount?.eth;\n if (!symbol || !tokenAmount) {\n return null;\n }\n\n const amount = formatAmount(parseFloat(tokenAmount), {\n shouldEllipse: true,\n });\n return translate(\n 'pushPlatformNotificationsFundsReceivedDescription',\n amount,\n symbol,\n );\n },\n },\n metamask_swap_completed: {\n title: (): string | null =>\n translate('pushPlatformNotificationsSwapCompletedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsSwapCompletedDescription'),\n },\n erc721_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftSentDescription'),\n },\n erc1155_sent: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftSentTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftSentDescription'),\n },\n erc721_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedDescription'),\n },\n erc1155_received: {\n title: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedTitle'),\n defaultDescription: (): string | null =>\n translate('pushPlatformNotificationsNftReceivedDescription'),\n },\n rocketpool_stake_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolStakeCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolStakeCompletedDescription',\n ),\n },\n rocketpool_unstake_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolUnstakeCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingRocketpoolUnstakeCompletedDescription',\n ),\n },\n lido_stake_completed: {\n title: (): string | null =>\n translate('pushPlatformNotificationsStakingLidoStakeCompletedTitle'),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeCompletedDescription',\n ),\n },\n lido_stake_ready_to_be_withdrawn: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoStakeReadyToBeWithdrawnDescription',\n ),\n },\n lido_withdrawal_requested: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalRequestedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalRequestedDescription',\n ),\n },\n lido_withdrawal_completed: {\n title: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalCompletedTitle',\n ),\n defaultDescription: (): string | null =>\n translate(\n 'pushPlatformNotificationsStakingLidoWithdrawalCompletedDescription',\n ),\n },\n platform: {\n title: (notification): string | null => notification.template.title,\n defaultDescription: (notification): string | null =>\n notification.template.body,\n getDescription: (notification): string | null =>\n notification.template.body,\n },\n };\n};\n\n/**\n * Creates a push notification message based on the given on-chain raw notification.\n *\n * @param notification - processed notification.\n * @param translations - translates keys into text\n * @returns The push notification message object, or null if the notification is invalid.\n */\nexport function createOnChainPushNotificationMessage(\n notification: Types.INotification,\n translations: TranslationKeys,\n): PushNotificationMessage | null {\n if (!notification?.type) {\n return null;\n }\n const notificationMessage =\n createOnChainPushNotificationMessages(translations)[notification.type];\n\n if (!notificationMessage) {\n return null;\n }\n\n let description: string | null = null;\n try {\n description =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage?.getDescription?.(notification as any) ??\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage.defaultDescription?.(notification as any) ??\n null;\n } catch {\n description =\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n notificationMessage.defaultDescription?.(notification as any) ?? null;\n }\n\n return {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n title: notificationMessage?.title?.(notification as any) ?? '', // Ensure title is always a string\n description: description ?? '', // Fallback to empty string if null\n };\n}\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./get-notification-data.cjs"), exports);
|
|
18
|
+
__exportStar(require("./get-notification-message.cjs"), exports);
|
|
19
|
+
__exportStar(require("./to-push-analytics-payload.cjs"), exports);
|
|
20
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA2C;AAC3C,iEAA8C;AAC9C,kEAA+C","sourcesContent":["export * from './get-notification-data.js';\nexport * from './get-notification-message.js';\nexport * from './to-push-analytics-payload.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/index.ts"],"names":[],"mappings":"AAAA,4CAA2C;AAC3C,+CAA8C;AAC9C,gDAA+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/index.ts"],"names":[],"mappings":"AAAA,4CAA2C;AAC3C,+CAA8C;AAC9C,gDAA+C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/index.ts"],"names":[],"mappings":"AAAA,4CAA2C;AAC3C,+CAA8C;AAC9C,gDAA+C","sourcesContent":["export * from './get-notification-data.js';\nexport * from './get-notification-message.js';\nexport * from './to-push-analytics-payload.js';\n"]}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toPushAnalyticsPayload = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Builds the first-class push analytics payload from the top-level FCM `data`
|
|
6
|
+
* keys written by push-services. Returns `null` when the required identity
|
|
7
|
+
* fields are missing (e.g. a malformed or legacy payload), so callers can
|
|
8
|
+
* safely bail out.
|
|
9
|
+
*
|
|
10
|
+
* @param data - the top-level FCM `data` map (all values are strings).
|
|
11
|
+
* @returns the analytics payload, or `null` if required fields are absent.
|
|
12
|
+
*/
|
|
13
|
+
function toPushAnalyticsPayload(data) {
|
|
14
|
+
if (!data?.notification_id || !data?.notification_type) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
notification_id: data.notification_id,
|
|
19
|
+
notification_type: data.notification_type,
|
|
20
|
+
notification_subtype: data.notification_subtype ?? '',
|
|
21
|
+
chain_id: data.chain_id ? Number(data.chain_id) : undefined,
|
|
22
|
+
deeplink: data.deeplink || undefined,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
exports.toPushAnalyticsPayload = toPushAnalyticsPayload;
|
|
26
|
+
//# sourceMappingURL=to-push-analytics-payload.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-push-analytics-payload.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CACpC,IAAwC;IAExC,IAAI,CAAC,IAAI,EAAE,eAAe,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,IAAI,EAAE;QACrD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;KACrC,CAAC;AACJ,CAAC;AAdD,wDAcC","sourcesContent":["import type { PushAnalyticsPayload } from '../types/index.js';\n\n/**\n * Builds the first-class push analytics payload from the top-level FCM `data`\n * keys written by push-services. Returns `null` when the required identity\n * fields are missing (e.g. a malformed or legacy payload), so callers can\n * safely bail out.\n *\n * @param data - the top-level FCM `data` map (all values are strings).\n * @returns the analytics payload, or `null` if required fields are absent.\n */\nexport function toPushAnalyticsPayload(\n data: Record<string, string> | undefined,\n): PushAnalyticsPayload | null {\n if (!data?.notification_id || !data?.notification_type) {\n return null;\n }\n\n return {\n notification_id: data.notification_id,\n notification_type: data.notification_type,\n notification_subtype: data.notification_subtype ?? '',\n chain_id: data.chain_id ? Number(data.chain_id) : undefined,\n deeplink: data.deeplink || undefined,\n };\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PushAnalyticsPayload } from
|
|
1
|
+
import type { PushAnalyticsPayload } from "../types/index.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* Builds the first-class push analytics payload from the top-level FCM `data`
|
|
4
4
|
* keys written by push-services. Returns `null` when the required identity
|
|
@@ -9,4 +9,4 @@ import type { PushAnalyticsPayload } from '../types/index.js';
|
|
|
9
9
|
* @returns the analytics payload, or `null` if required fields are absent.
|
|
10
10
|
*/
|
|
11
11
|
export declare function toPushAnalyticsPayload(data: Record<string, string> | undefined): PushAnalyticsPayload | null;
|
|
12
|
-
//# sourceMappingURL=to-push-analytics-payload.d.
|
|
12
|
+
//# sourceMappingURL=to-push-analytics-payload.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-push-analytics-payload.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,2BAA0B;AAE9D;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACvC,oBAAoB,GAAG,IAAI,CAY7B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PushAnalyticsPayload } from "../types/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Builds the first-class push analytics payload from the top-level FCM `data`
|
|
4
|
+
* keys written by push-services. Returns `null` when the required identity
|
|
5
|
+
* fields are missing (e.g. a malformed or legacy payload), so callers can
|
|
6
|
+
* safely bail out.
|
|
7
|
+
*
|
|
8
|
+
* @param data - the top-level FCM `data` map (all values are strings).
|
|
9
|
+
* @returns the analytics payload, or `null` if required fields are absent.
|
|
10
|
+
*/
|
|
11
|
+
export declare function toPushAnalyticsPayload(data: Record<string, string> | undefined): PushAnalyticsPayload | null;
|
|
12
|
+
//# sourceMappingURL=to-push-analytics-payload.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-push-analytics-payload.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,2BAA0B;AAE9D;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,GACvC,oBAAoB,GAAG,IAAI,CAY7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"to-push-analytics-payload.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/utils/to-push-analytics-payload.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CACpC,IAAwC;IAExC,IAAI,CAAC,IAAI,EAAE,eAAe,IAAI,CAAC,IAAI,EAAE,iBAAiB,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,IAAI,EAAE;QACrD,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;QAC3D,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;KACrC,CAAC;AACJ,CAAC","sourcesContent":["import type { PushAnalyticsPayload } from '../types/index.js';\n\n/**\n * Builds the first-class push analytics payload from the top-level FCM `data`\n * keys written by push-services. Returns `null` when the required identity\n * fields are missing (e.g. a malformed or legacy payload), so callers can\n * safely bail out.\n *\n * @param data - the top-level FCM `data` map (all values are strings).\n * @returns the analytics payload, or `null` if required fields are absent.\n */\nexport function toPushAnalyticsPayload(\n data: Record<string, string> | undefined,\n): PushAnalyticsPayload | null {\n if (!data?.notification_id || !data?.notification_type) {\n return null;\n }\n\n return {\n notification_id: data.notification_id,\n notification_type: data.notification_type,\n notification_subtype: data.notification_subtype ?? '',\n chain_id: data.chain_id ? Number(data.chain_id) : undefined,\n deeplink: data.deeplink || undefined,\n };\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSubscribeToPushNotifications = exports.deleteRegToken = exports.createRegToken = void 0;
|
|
4
|
+
var push_utils_js_1 = require("./push-utils.cjs");
|
|
5
|
+
Object.defineProperty(exports, "createRegToken", { enumerable: true, get: function () { return push_utils_js_1.createRegToken; } });
|
|
6
|
+
Object.defineProperty(exports, "deleteRegToken", { enumerable: true, get: function () { return push_utils_js_1.deleteRegToken; } });
|
|
7
|
+
Object.defineProperty(exports, "createSubscribeToPushNotifications", { enumerable: true, get: function () { return push_utils_js_1.createSubscribeToPushNotifications; } });
|
|
8
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/web/index.ts"],"names":[],"mappings":";;;AAAA,kDAIyB;AAHvB,+GAAA,cAAc,OAAA;AACd,+GAAA,cAAc,OAAA;AACd,mIAAA,kCAAkC,OAAA","sourcesContent":["export {\n createRegToken,\n deleteRegToken,\n createSubscribeToPushNotifications,\n} from './push-utils.js';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,kCAAkC,GACnC,yBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,kCAAkC,GACnC,yBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesPushController/web/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,kCAAkC,EACnC,yBAAwB","sourcesContent":["export {\n createRegToken,\n deleteRegToken,\n createSubscribeToPushNotifications,\n} from './push-utils.js';\n"]}
|