@metamask-previews/notification-services-controller 19.0.0-preview-7b698bb → 19.0.0-preview-ba016213
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 +21 -0
- package/dist/NotificationServicesController/NotificationServicesController.cjs +17 -38
- package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -1
- package/dist/NotificationServicesController/NotificationServicesController.d.cts +2 -2
- package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -1
- package/dist/NotificationServicesController/NotificationServicesController.d.mts +2 -2
- package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -1
- package/dist/NotificationServicesController/NotificationServicesController.mjs +17 -15
- package/dist/NotificationServicesController/NotificationServicesController.mjs.map +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.cjs +4 -14
- package/dist/NotificationServicesController/constants/notification-schema.cjs.map +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.d.cts +3 -13
- package/dist/NotificationServicesController/constants/notification-schema.d.cts.map +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.d.mts +3 -13
- package/dist/NotificationServicesController/constants/notification-schema.d.mts.map +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.mjs +3 -13
- package/dist/NotificationServicesController/constants/notification-schema.mjs.map +1 -1
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs +428 -530
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.cjs.map +1 -1
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts +20 -50
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.cts.map +1 -1
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts +20 -50
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.d.mts.map +1 -1
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs +425 -522
- package/dist/NotificationServicesController/mocks/mock-raw-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/mocks/mockResponses.cjs +5 -5
- package/dist/NotificationServicesController/mocks/mockResponses.cjs.map +1 -1
- package/dist/NotificationServicesController/mocks/mockResponses.d.cts +2 -2
- package/dist/NotificationServicesController/mocks/mockResponses.d.cts.map +1 -1
- package/dist/NotificationServicesController/mocks/mockResponses.d.mts +2 -2
- package/dist/NotificationServicesController/mocks/mockResponses.d.mts.map +1 -1
- package/dist/NotificationServicesController/mocks/mockResponses.mjs +1 -1
- package/dist/NotificationServicesController/mocks/mockResponses.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/index.cjs +1 -1
- package/dist/NotificationServicesController/processors/index.cjs.map +1 -1
- package/dist/NotificationServicesController/processors/index.d.cts +1 -1
- package/dist/NotificationServicesController/processors/index.d.cts.map +1 -1
- package/dist/NotificationServicesController/processors/index.d.mts +1 -1
- package/dist/NotificationServicesController/processors/index.d.mts.map +1 -1
- package/dist/NotificationServicesController/processors/index.mjs +1 -1
- package/dist/NotificationServicesController/processors/index.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-api-notifications.cjs +22 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.d.cts +10 -0
- 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.mjs +18 -0
- package/dist/NotificationServicesController/processors/process-api-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/processors/process-feature-announcement.cjs +2 -7
- package/dist/NotificationServicesController/processors/process-feature-announcement.cjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map +1 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map +1 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +1 -6
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.cjs +3 -3
- package/dist/NotificationServicesController/processors/process-notifications.cjs.map +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.d.cts +398 -458
- package/dist/NotificationServicesController/processors/process-notifications.d.cts.map +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.d.mts +398 -458
- package/dist/NotificationServicesController/processors/process-notifications.d.mts.map +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.mjs +4 -4
- package/dist/NotificationServicesController/processors/process-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/services/{onchain-notifications.cjs → api-notifications.cjs} +28 -15
- package/dist/NotificationServicesController/services/api-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{onchain-notifications.d.cts → api-notifications.d.cts} +9 -7
- package/dist/NotificationServicesController/services/api-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/{onchain-notifications.d.mts → api-notifications.d.mts} +9 -7
- package/dist/NotificationServicesController/services/api-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{onchain-notifications.mjs → api-notifications.mjs} +26 -13
- package/dist/NotificationServicesController/services/api-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/services/perp-notifications.cjs +0 -1
- package/dist/NotificationServicesController/services/perp-notifications.cjs.map +1 -1
- package/dist/NotificationServicesController/services/perp-notifications.d.cts.map +1 -1
- package/dist/NotificationServicesController/services/perp-notifications.d.mts.map +1 -1
- package/dist/NotificationServicesController/services/perp-notifications.mjs +0 -1
- package/dist/NotificationServicesController/services/perp-notifications.mjs.map +1 -1
- package/dist/NotificationServicesController/types/index.cjs.map +1 -1
- package/dist/NotificationServicesController/types/index.d.cts +1 -1
- package/dist/NotificationServicesController/types/index.d.cts.map +1 -1
- package/dist/NotificationServicesController/types/index.d.mts +1 -1
- package/dist/NotificationServicesController/types/index.d.mts.map +1 -1
- package/dist/NotificationServicesController/types/index.mjs.map +1 -1
- package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -1
- package/dist/NotificationServicesController/types/notification/notification.d.cts +3 -11
- package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -1
- package/dist/NotificationServicesController/types/notification/notification.d.mts +3 -11
- package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -1
- package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -1
- 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.map +1 -0
- package/dist/NotificationServicesController/types/{on-chain-notification/on-chain-notification.cjs → notification-api/notification-api.cjs} +1 -1
- package/dist/NotificationServicesController/types/notification-api/notification-api.cjs.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts +64 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts +64 -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.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/schema.d.cts +365 -0
- package/dist/NotificationServicesController/types/notification-api/schema.d.cts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/schema.d.mts +365 -0
- package/dist/NotificationServicesController/types/notification-api/schema.d.mts.map +1 -0
- package/dist/NotificationServicesController/types/notification-api/schema.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.cts +2 -0
- 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.mjs +8 -0
- package/dist/NotificationServicesController/utils/should-auto-expire.mjs.map +1 -0
- package/dist/NotificationServicesPushController/services/push/push-web.cjs +5 -2
- package/dist/NotificationServicesPushController/services/push/push-web.cjs.map +1 -1
- package/dist/NotificationServicesPushController/services/push/push-web.d.cts.map +1 -1
- package/dist/NotificationServicesPushController/services/push/push-web.d.mts.map +1 -1
- package/dist/NotificationServicesPushController/services/push/push-web.mjs +6 -3
- package/dist/NotificationServicesPushController/services/push/push-web.mjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +51 -43
- package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts +4 -2
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts +4 -2
- package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +51 -43
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -1
- package/dist/NotificationServicesPushController/web/push-utils.cjs +5 -2
- package/dist/NotificationServicesPushController/web/push-utils.cjs.map +1 -1
- package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +1 -1
- package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +1 -1
- package/dist/NotificationServicesPushController/web/push-utils.mjs +6 -3
- package/dist/NotificationServicesPushController/web/push-utils.mjs.map +1 -1
- package/dist/shared/is-onchain-notification.cjs +1 -2
- package/dist/shared/is-onchain-notification.cjs.map +1 -1
- package/dist/shared/is-onchain-notification.d.cts.map +1 -1
- package/dist/shared/is-onchain-notification.d.mts.map +1 -1
- package/dist/shared/is-onchain-notification.mjs +1 -2
- package/dist/shared/is-onchain-notification.mjs.map +1 -1
- package/dist/shared/to-raw-notification.cjs +19 -6
- package/dist/shared/to-raw-notification.cjs.map +1 -1
- package/dist/shared/to-raw-notification.d.cts +2 -2
- package/dist/shared/to-raw-notification.d.cts.map +1 -1
- package/dist/shared/to-raw-notification.d.mts +2 -2
- package/dist/shared/to-raw-notification.d.mts.map +1 -1
- package/dist/shared/to-raw-notification.mjs +17 -4
- package/dist/shared/to-raw-notification.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.cjs +0 -19
- package/dist/NotificationServicesController/processors/process-onchain-notifications.cjs.map +0 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.cts +0 -10
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.cts.map +0 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts +0 -10
- package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts.map +0 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +0 -15
- package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs.map +0 -1
- package/dist/NotificationServicesController/services/onchain-notifications.cjs.map +0 -1
- package/dist/NotificationServicesController/services/onchain-notifications.d.cts.map +0 -1
- package/dist/NotificationServicesController/services/onchain-notifications.d.mts.map +0 -1
- package/dist/NotificationServicesController/services/onchain-notifications.mjs.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/index.cjs.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.cts +0 -2
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.cts.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.mts +0 -2
- package/dist/NotificationServicesController/types/on-chain-notification/index.d.mts.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/index.mjs.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.cjs.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.cts +0 -49
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.cts.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.mts +0 -49
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.mts.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs +0 -2
- package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.cjs.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.cts +0 -681
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.cts.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.mts +0 -681
- package/dist/NotificationServicesController/types/on-chain-notification/schema.d.mts.map +0 -1
- package/dist/NotificationServicesController/types/on-chain-notification/schema.mjs.map +0 -1
- /package/dist/NotificationServicesController/types/{on-chain-notification → notification-api}/index.cjs +0 -0
- /package/dist/NotificationServicesController/types/{on-chain-notification → notification-api}/index.mjs +0 -0
- /package/dist/NotificationServicesController/types/{on-chain-notification → notification-api}/schema.cjs +0 -0
- /package/dist/NotificationServicesController/types/{on-chain-notification → notification-api}/schema.mjs +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-raw-notifications.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mock-raw-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,6CAAyC;AAGjE;;;;GAIG;AACH,MAAM,UAAU,6BAA6B;IAC3C,MAAM,gBAAgB,GAA2B;QAC/C,IAAI,EAAE,aAAa,CAAC,QAAQ;QAC5B,EAAE,EAAE,sCAAsC;QAC1C,UAAU,EAAE,sCAAsC;QAClD,QAAQ,EAAE,CAAC;QACX,YAAY,EAAE,QAAQ;QACtB,eAAe,EAAE,sBAAsB;QACvC,OAAO,EACL,oEAAoE;QAC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QAClD,MAAM,EAAE,IAAI;KACb,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC;IAC/C,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QAC1B,MAAM,YAAY,GAAG,6BAA6B,EAAE,CAAC;QACrD,YAAY,CAAC,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;QAC5B,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { OnChainRawNotification } from '../types/on-chain-notification/on-chain-notification';\n\n/**\n * Mocking Utility - create a mock Eth sent notification\n *\n * @returns Mock raw Eth sent notification\n */\nexport function createMockNotificationEthSent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ETH_SENT,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa7',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa7',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash:\n '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'eth_sent',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n from: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n to: '0x881D40237659C251811CEC9c364ef91dC08D300D',\n amount: {\n usd: '670.64',\n eth: '0.005',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Eth Received notification\n *\n * @returns Mock raw Eth Received notification\n */\nexport function createMockNotificationEthReceived(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ETH_RECEIVED,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa8',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa8',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash:\n '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'eth_received',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n from: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n to: '0x881D40237659C251811CEC9c364ef91dC08D300D',\n amount: {\n usd: '670.64',\n eth: '808.000000000000000000',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC20 sent notification\n *\n * @returns Mock raw ERC20 sent notification\n */\nexport function createMockNotificationERC20Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC20_SENT,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa9',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa9',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash:\n '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'erc20_sent',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n to: '0xecc19e177d24551aa7ed6bc6fe566eca726cc8a9',\n from: '0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae',\n token: {\n usd: '1.00',\n name: 'USDC',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdc.svg',\n amount: '4956250000',\n symbol: 'USDC',\n address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n decimals: '6',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC20 received notification\n *\n * @returns Mock raw ERC20 received notification\n */\nexport function createMockNotificationERC20Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC20_RECEIVED,\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash:\n '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'erc20_received',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n to: '0xeae7380dd4cef6fbd1144f49e4d1e6964258a4f4',\n from: '0x51c72848c68a965f66fa7a88855f9f7784502a7f',\n token: {\n usd: '0.00',\n name: 'SHIBA INU',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/shib.svg',\n amount: '8382798736999999457296646144',\n symbol: 'SHIB',\n address: '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',\n decimals: '18',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC721 sent notification\n *\n * @returns Mock raw ERC721 sent notification\n */\nexport function createMockNotificationERC721Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC721_SENT,\n block_number: 18576643,\n block_timestamp: '1700043467',\n chain_id: 1,\n created_at: '2023-11-15T11:08:17.895407Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0xf47f628fe3bd2595e9ab384bfffc3859b448e451',\n nft: {\n name: 'Captainz #8680',\n image:\n 'https://i.seadn.io/s/raw/files/ae0fc06714ff7fb40217340d8a242c0e.gif?w=500&auto=format',\n token_id: '8680',\n collection: {\n name: 'The Captainz',\n image:\n 'https://i.seadn.io/gcs/files/6df4d75778066bce740050615bc84e21.png?w=500&auto=format',\n symbol: 'Captainz',\n address: '0x769272677fab02575e84945f03eca517acc544cc',\n },\n },\n from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',\n kind: 'erc721_sent',\n network_fee: {\n gas_price: '24550653274',\n native_token_price_in_usd: '1986.61',\n },\n },\n id: 'a4193058-9814-537e-9df4-79dcac727fb6',\n trigger_id: '028485be-b994-422b-a93b-03fcc01ab715',\n tx_hash:\n '0x0833c69fb41cf972a0f031fceca242939bc3fcf82b964b74606649abcad371bd',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC721 received notification\n *\n * @returns Mock raw ERC721 received notification\n */\nexport function createMockNotificationERC721Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC721_RECEIVED,\n block_number: 18571446,\n block_timestamp: '1699980623',\n chain_id: 1,\n created_at: '2023-11-14T17:40:52.319281Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0xba7f3daa8adfdad686574406ab9bd5d2f0a49d2e',\n nft: {\n name: 'The Plague #2722',\n image:\n 'https://i.seadn.io/s/raw/files/a96f90ec8ebf55a2300c66a0c46d6a16.png?w=500&auto=format',\n token_id: '2722',\n collection: {\n name: 'The Plague NFT',\n image:\n 'https://i.seadn.io/gcs/files/4577987a5ca45ca5118b2e31559ee4d1.jpg?w=500&auto=format',\n symbol: 'FROG',\n address: '0xc379e535caff250a01caa6c3724ed1359fe5c29b',\n },\n },\n from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',\n kind: 'erc721_received',\n network_fee: {\n gas_price: '53701898538',\n native_token_price_in_usd: '2047.01',\n },\n },\n id: '00a79d24-befa-57ed-a55a-9eb8696e1654',\n trigger_id: 'd24ac26a-8579-49ec-9947-d04d63592ebd',\n tx_hash:\n '0xe554c9e29e6eeca8ba94da4d047334ba08b8eb9ca3b801dd69cec08dfdd4ae43',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC1155 sent notification\n *\n * @returns Mock raw ERC1155 sent notification\n */\nexport function createMockNotificationERC1155Sent(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC1155_SENT,\n block_number: 18615206,\n block_timestamp: '1700510003',\n chain_id: 1,\n created_at: '2023-11-20T20:44:10.110706Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',\n nft: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',\n token_id: '1',\n collection: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',\n symbol: 'TRUTH',\n address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',\n },\n },\n from: '0x0000000000000000000000000000000000000000',\n kind: 'erc1155_sent',\n network_fee: {\n gas_price: '33571446596',\n native_token_price_in_usd: '2038.88',\n },\n },\n id: 'a09ff9d1-623a-52ab-a3d4-c7c8c9a58362',\n trigger_id: 'e2130f7d-78b8-4c34-999a-3f3d3bb5b03c',\n tx_hash:\n '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC1155 received notification\n *\n * @returns Mock raw ERC1155 received notification\n */\nexport function createMockNotificationERC1155Received(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ERC1155_RECEIVED,\n block_number: 18615206,\n block_timestamp: '1700510003',\n chain_id: 1,\n created_at: '2023-11-20T20:44:10.110706Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',\n nft: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',\n token_id: '1',\n collection: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',\n symbol: 'TRUTH',\n address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',\n },\n },\n from: '0x0000000000000000000000000000000000000000',\n kind: 'erc1155_received',\n network_fee: {\n gas_price: '33571446596',\n native_token_price_in_usd: '2038.88',\n },\n },\n id: 'b6b93c84-e8dc-54ed-9396-7ea50474843a',\n trigger_id: '710c8abb-43a9-42a5-9d86-9dd258726c82',\n tx_hash:\n '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock MetaMask Swaps notification\n *\n * @returns Mock raw MetaMask Swaps notification\n */\nexport function createMockNotificationMetaMaskSwapsCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.METAMASK_SWAP_COMPLETED,\n block_number: 18377666,\n block_timestamp: '1697637275',\n chain_id: 1,\n created_at: '2023-10-18T13:58:49.854596Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'metamask_swap_completed',\n rate: '1558.27',\n token_in: {\n usd: '1576.73',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '9000000000000000',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n token_out: {\n usd: '1.00',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdt.svg',\n amount: '14024419',\n symbol: 'USDT',\n address: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n decimals: '6',\n name: 'USDT',\n },\n network_fee: {\n gas_price: '15406129273',\n native_token_price_in_usd: '1576.73',\n },\n },\n id: '7ddfe6a1-ac52-5ffe-aa40-f04242db4b8b',\n trigger_id: 'd2eaa2eb-2e6e-4fd5-8763-b70ea571b46c',\n tx_hash:\n '0xf69074290f3aa11bce567aabc9ca0df7a12559dfae1b80ba1a124e9dfe19ecc5',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock RocketPool Stake Completed notification\n *\n * @returns Mock raw RocketPool Stake Completed notification\n */\nexport function createMockNotificationRocketPoolStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_STAKE_COMPLETED,\n block_number: 18585057,\n block_timestamp: '1700145059',\n chain_id: 1,\n created_at: '2023-11-20T12:02:48.796824Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_stake_completed',\n stake_in: {\n usd: '2031.86',\n name: 'Ethereum',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '190690478063438272',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n },\n stake_out: {\n usd: '2226.49',\n name: 'Rocket Pool ETH',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',\n amount: '175024360778165879',\n symbol: 'RETH',\n address: '0xae78736Cd615f374D3085123A210448E74Fc6393',\n decimals: '18',\n },\n network_fee: {\n gas_price: '36000000000',\n native_token_price_in_usd: '2031.86',\n },\n },\n id: 'c2a2f225-b2fb-5d6c-ba56-e27a5c71ffb9',\n trigger_id: '5110ff97-acff-40c0-83b4-11d487b8c7b0',\n tx_hash:\n '0xcfc0693bf47995907b0f46ef0644cf16dd9a0de797099b2e00fd481e1b2117d3',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock RocketPool Un-staked notification\n *\n * @returns Mock raw RocketPool Un-staked notification\n */\nexport function createMockNotificationRocketPoolUnStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_UNSTAKE_COMPLETED,\n block_number: 18384336,\n block_timestamp: '1697718011',\n chain_id: 1,\n created_at: '2023-10-19T13:11:10.623042Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_unstake_completed',\n stake_in: {\n usd: '1686.34',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',\n amount: '66608041413696770',\n symbol: 'RETH',\n address: '0xae78736Cd615f374D3085123A210448E74Fc6393',\n decimals: '18',\n name: 'Rocketpool Eth',\n },\n stake_out: {\n usd: '1553.75',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '72387843427700824',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '5656322987',\n native_token_price_in_usd: '1553.75',\n },\n },\n id: '291ec897-f569-4837-b6c0-21001b198dff',\n trigger_id: '291ec897-f569-4837-b6c0-21001b198dff',\n tx_hash:\n '0xc7972a7e409abfc62590ec90e633acd70b9b74e76ad02305be8bf133a0e22d5f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Stake Completed notification\n *\n * @returns Mock raw Lido Stake Completed notification\n */\nexport function createMockNotificationLidoStakeCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_STAKE_COMPLETED,\n block_number: 18487118,\n block_timestamp: '1698961091',\n chain_id: 1,\n created_at: '2023-11-02T22:28:49.970865Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_stake_completed',\n stake_in: {\n usd: '1806.33',\n name: 'Ethereum',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '330303634023928032',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n },\n stake_out: {\n usd: '1801.30',\n name: 'Liquid staked Ether 2.0',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '330303634023928032',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n },\n network_fee: {\n gas_price: '26536359866',\n native_token_price_in_usd: '1806.33',\n },\n },\n id: 'ec10d66a-f78f-461f-83c9-609aada8cc50',\n trigger_id: 'ec10d66a-f78f-461f-83c9-609aada8cc50',\n tx_hash:\n '0x8cc0fa805f7c3b1743b14f3b91c6b824113b094f26d4ccaf6a71ad8547ce6a0f',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Requested notification\n *\n * @returns Mock raw Lido Withdrawal Requested notification\n */\nexport function createMockNotificationLidoWithdrawalRequested(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_WITHDRAWAL_REQUESTED,\n block_number: 18377760,\n block_timestamp: '1697638415',\n chain_id: 1,\n created_at: '2023-10-18T15:04:02.482526Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_withdrawal_requested',\n stake_in: {\n usd: '1568.54',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '97180668792218669859',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n name: 'Staked Eth',\n },\n stake_out: {\n usd: '1576.73',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '97180668792218669859',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '11658906980',\n native_token_price_in_usd: '1576.73',\n },\n },\n id: 'ef003925-3379-4ba7-9e2d-8218690cadc9',\n trigger_id: 'ef003925-3379-4ba7-9e2d-8218690cadc9',\n tx_hash:\n '0x58b5f82e084cb750ea174e02b20fbdfd2ba8d78053deac787f34fc38e5d427aa',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Completed notification\n *\n * @returns Mock raw Lido Withdrawal Completed notification\n */\nexport function createMockNotificationLidoWithdrawalCompleted(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_WITHDRAWAL_COMPLETED,\n block_number: 18378208,\n block_timestamp: '1697643851',\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_withdrawal_completed',\n stake_in: {\n usd: '1570.23',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '35081997661451346',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n name: 'Staked Eth',\n },\n stake_out: {\n usd: '1571.74',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '35081997661451346',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '12699495150',\n native_token_price_in_usd: '1571.74',\n },\n },\n id: 'd73df14d-ce73-4f38-bad3-ab028154042f',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042f',\n tx_hash:\n '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Ready notification\n *\n * @returns Mock raw Lido Withdrawal Ready notification\n */\nexport function createMockNotificationLidoReadyToBeWithdrawn(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_STAKE_READY_TO_BE_WITHDRAWN,\n block_number: 18378208,\n block_timestamp: '1697643851',\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_stake_ready_to_be_withdrawn',\n request_id: '123456789',\n staked_eth: {\n address: '0x881D40237659C251811CEC9c364ef91dC08D300F',\n symbol: 'ETH',\n name: 'Ethereum',\n amount: '2.5',\n decimals: '18',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n usd: '10000.00',\n },\n },\n id: 'd73df14d-ce73-4f38-bad3-ab028154042e',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042e',\n tx_hash:\n '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Aave V3 Health Factor notification\n *\n * @returns Mock raw Aave V3 Health Factor notification\n */\nexport function createMockNotificationAaveV3HealthFactor(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.AAVE_V3_HEALTH_FACTOR,\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'aave_v3_health_factor',\n chainId: 1,\n healthFactor: '3.4',\n threshold: '5.5',\n },\n id: 'd73df14d-ce73-4f38-bad3-ab028154042b',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042b',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ENS Expiration notification\n *\n * @returns Mock raw ENS Expiration notification\n */\nexport function createMockNotificationEnsExpiration(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ENS_EXPIRATION,\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'ens_expiration',\n chainId: 1,\n reverseEnsName: 'vitalik.eth',\n expirationDateIso: '2024-01-01T00:00:00Z',\n reminderDelayInSeconds: 86400,\n },\n id: 'f4ef0b7f-5612-537f-9144-0b5c63ae5391',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042c',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Staking Rewards notification\n *\n * @returns Mock raw Lido Staking Rewards notification\n */\nexport function createMockNotificationLidoStakingRewards(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.LIDO_STAKING_REWARDS,\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_staking_rewards',\n chainId: 1,\n currentStethBalance: '10',\n currentEthValue: '10.5',\n estimatedTotalRewardInPeriod: '0.5',\n daysSinceLastNotification: 30,\n notificationIntervalDays: 30,\n },\n id: 'd73df14d-ce73-4f38-bad3-ab028154042l',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042l',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Notional Loan Expiration notification\n *\n * @returns Mock raw Notional Loan Expiration notification\n */\nexport function createMockNotificationNotionalLoanExpiration(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.NOTIONAL_LOAN_EXPIRATION,\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'notional_loan_expiration',\n chainId: 1,\n loans: [\n {\n amount: '1.1234',\n symbol: 'ETH',\n maturityDateIso: '2024-01-01T00:00:00Z',\n },\n ],\n reminderDelayInSeconds: 86400,\n },\n id: 'd73df14d-ce73-4f38-bad3-ab028154042n',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042n',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Rocketpool Staking Rewards notification\n *\n * @returns Mock raw Rocketpool Staking Rewards notification\n */\nexport function createMockNotificationRocketpoolStakingRewards(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_STAKING_REWARDS,\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_staking_rewards',\n chainId: 1,\n currentRethBalance: '10',\n currentEthValue: '10.5',\n estimatedTotalRewardInPeriod: '0.5',\n daysSinceLastNotification: 30,\n notificationIntervalDays: 30,\n },\n id: 'd73df14d-ce73-4f38-bad3-ab028154042r',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042r',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock SparkFi Health Factor notification\n *\n * @returns Mock raw SparkFi Health Factor notification\n */\nexport function createMockNotificationSparkFiHealthFactor(): OnChainRawNotification {\n const mockNotification: OnChainRawNotification = {\n type: TRIGGER_TYPES.SPARK_FI_HEALTH_FACTOR,\n chain_id: 1,\n created_at: '2023-10-18T16:35:03.147606Z',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'spark_fi_health_factor',\n chainId: 1,\n healthFactor: '3.4',\n threshold: '5.5',\n },\n id: 'd73df14d-ce73-4f38-bad3-ab028154042s',\n trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042s',\n unread: true,\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - creates an array of raw on-chain notifications\n *\n * @returns Array of raw on-chain notifications\n */\nexport function createMockRawOnChainNotifications(): OnChainRawNotification[] {\n return [1, 2, 3].map((id) => {\n const notification = createMockNotificationEthSent();\n notification.id += `-${id}`;\n return notification;\n });\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mock-raw-notifications.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mock-raw-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,6CAAyC;AAGjE;;;;GAIG;AACH,MAAM,UAAU,6BAA6B;IAC3C,MAAM,gBAAgB,GAA8B;QAClD,IAAI,EAAE,aAAa,CAAC,QAAQ;QAC5B,iBAAiB,EAAE,UAAU;QAC7B,EAAE,EAAE,sCAAsC;QAC1C,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,sBAAsB;QAClC,OAAO,EAAE;YACP,QAAQ,EAAE,CAAC;YACX,YAAY,EAAE,QAAQ;YACtB,eAAe,EAAE,sBAAsB;YACvC,OAAO,EACL,oEAAoE;YACtE,OAAO,EAAE,4CAA4C;YACrD,IAAI,EAAE;gBACJ,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE;oBACX,SAAS,EAAE,cAAc;oBACzB,yBAAyB,EAAE,MAAM;iBAClC;gBACD,IAAI,EAAE,4CAA4C;gBAClD,EAAE,EAAE,4CAA4C;gBAChD,MAAM,EAAE;oBACN,GAAG,EAAE,QAAQ;oBACb,GAAG,EAAE,OAAO;iBACb;aACF;SACF;KACF,CAAC;IAEF,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iCAAiC;IAC/C,MAAM,gBAAgB,GAA8B;QAClD,IAAI,EAAE,aAAa,CAAC,YAAY;QAChC,iBAAiB,EAAE,UAAU;QAC7B,EAAE,EAAE,sCAAsC;QAC1C,MAAM,EAAE,IAAI;QACZ,UAAU,EAAE,sBAAsB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E,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE;QAC1B,MAAM,YAAY,GAAG,6BAA6B,EAAE,CAAC;QACrD,YAAY,CAAC,EAAE,IAAI,IAAI,EAAE,EAAE,CAAC;QAC5B,OAAO,YAAY,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { TRIGGER_TYPES } from '../constants/notification-schema';\nimport type { NormalisedAPINotification } from '../types/notification-api/notification-api';\n\n/**\n * Mocking Utility - create a mock Eth sent notification\n *\n * @returns Mock raw Eth sent notification\n */\nexport function createMockNotificationEthSent(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ETH_SENT,\n notification_type: 'on-chain',\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa7',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n payload: {\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash:\n '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'eth_sent',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n from: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n to: '0x881D40237659C251811CEC9c364ef91dC08D300D',\n amount: {\n usd: '670.64',\n eth: '0.005',\n },\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Eth Received notification\n *\n * @returns Mock raw Eth Received notification\n */\nexport function createMockNotificationEthReceived(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ETH_RECEIVED,\n notification_type: 'on-chain',\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa8',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n payload: {\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash:\n '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'eth_received',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n from: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n to: '0x881D40237659C251811CEC9c364ef91dC08D300D',\n amount: {\n usd: '670.64',\n eth: '808.000000000000000000',\n },\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC20 sent notification\n *\n * @returns Mock raw ERC20 sent notification\n */\nexport function createMockNotificationERC20Sent(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ERC20_SENT,\n notification_type: 'on-chain',\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa9',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n payload: {\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash:\n '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'erc20_sent',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n to: '0xecc19e177d24551aa7ed6bc6fe566eca726cc8a9',\n from: '0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae',\n token: {\n usd: '1.00',\n name: 'USDC',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdc.svg',\n amount: '4956250000',\n symbol: 'USDC',\n address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',\n decimals: '6',\n },\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC20 received notification\n *\n * @returns Mock raw ERC20 received notification\n */\nexport function createMockNotificationERC20Received(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ERC20_RECEIVED,\n notification_type: 'on-chain',\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n unread: true,\n created_at: '2022-03-01T00:00:00Z',\n payload: {\n chain_id: 1,\n block_number: 17485840,\n block_timestamp: '2022-03-01T00:00:00Z',\n tx_hash:\n '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'erc20_received',\n network_fee: {\n gas_price: '207806259583',\n native_token_price_in_usd: '0.83',\n },\n to: '0xeae7380dd4cef6fbd1144f49e4d1e6964258a4f4',\n from: '0x51c72848c68a965f66fa7a88855f9f7784502a7f',\n token: {\n usd: '0.00',\n name: 'SHIBA INU',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/shib.svg',\n amount: '8382798736999999457296646144',\n symbol: 'SHIB',\n address: '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',\n decimals: '18',\n },\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC721 sent notification\n *\n * @returns Mock raw ERC721 sent notification\n */\nexport function createMockNotificationERC721Sent(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ERC721_SENT,\n notification_type: 'on-chain',\n id: 'a4193058-9814-537e-9df4-79dcac727fb6',\n created_at: '2023-11-15T11:08:17.895407Z',\n unread: true,\n payload: {\n block_number: 18576643,\n block_timestamp: '1700043467',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0xf47f628fe3bd2595e9ab384bfffc3859b448e451',\n nft: {\n name: 'Captainz #8680',\n image:\n 'https://i.seadn.io/s/raw/files/ae0fc06714ff7fb40217340d8a242c0e.gif?w=500&auto=format',\n token_id: '8680',\n collection: {\n name: 'The Captainz',\n image:\n 'https://i.seadn.io/gcs/files/6df4d75778066bce740050615bc84e21.png?w=500&auto=format',\n symbol: 'Captainz',\n address: '0x769272677fab02575e84945f03eca517acc544cc',\n },\n },\n from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',\n kind: 'erc721_sent',\n network_fee: {\n gas_price: '24550653274',\n native_token_price_in_usd: '1986.61',\n },\n },\n tx_hash:\n '0x0833c69fb41cf972a0f031fceca242939bc3fcf82b964b74606649abcad371bd',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC721 received notification\n *\n * @returns Mock raw ERC721 received notification\n */\nexport function createMockNotificationERC721Received(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ERC721_RECEIVED,\n notification_type: 'on-chain',\n id: '00a79d24-befa-57ed-a55a-9eb8696e1654',\n created_at: '2023-11-14T17:40:52.319281Z',\n unread: true,\n payload: {\n block_number: 18571446,\n block_timestamp: '1699980623',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0xba7f3daa8adfdad686574406ab9bd5d2f0a49d2e',\n nft: {\n name: 'The Plague #2722',\n image:\n 'https://i.seadn.io/s/raw/files/a96f90ec8ebf55a2300c66a0c46d6a16.png?w=500&auto=format',\n token_id: '2722',\n collection: {\n name: 'The Plague NFT',\n image:\n 'https://i.seadn.io/gcs/files/4577987a5ca45ca5118b2e31559ee4d1.jpg?w=500&auto=format',\n symbol: 'FROG',\n address: '0xc379e535caff250a01caa6c3724ed1359fe5c29b',\n },\n },\n from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',\n kind: 'erc721_received',\n network_fee: {\n gas_price: '53701898538',\n native_token_price_in_usd: '2047.01',\n },\n },\n tx_hash:\n '0xe554c9e29e6eeca8ba94da4d047334ba08b8eb9ca3b801dd69cec08dfdd4ae43',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC1155 sent notification\n *\n * @returns Mock raw ERC1155 sent notification\n */\nexport function createMockNotificationERC1155Sent(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ERC1155_SENT,\n notification_type: 'on-chain',\n id: 'a09ff9d1-623a-52ab-a3d4-c7c8c9a58362',\n created_at: '2023-11-20T20:44:10.110706Z',\n unread: true,\n payload: {\n block_number: 18615206,\n block_timestamp: '1700510003',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',\n nft: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',\n token_id: '1',\n collection: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',\n symbol: 'TRUTH',\n address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',\n },\n },\n from: '0x0000000000000000000000000000000000000000',\n kind: 'erc1155_sent',\n network_fee: {\n gas_price: '33571446596',\n native_token_price_in_usd: '2038.88',\n },\n },\n tx_hash:\n '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock ERC1155 received notification\n *\n * @returns Mock raw ERC1155 received notification\n */\nexport function createMockNotificationERC1155Received(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ERC1155_RECEIVED,\n notification_type: 'on-chain',\n id: 'b6b93c84-e8dc-54ed-9396-7ea50474843a',\n created_at: '2023-11-20T20:44:10.110706Z',\n unread: true,\n payload: {\n block_number: 18615206,\n block_timestamp: '1700510003',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',\n nft: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',\n token_id: '1',\n collection: {\n name: 'IlluminatiNFT DAO',\n image:\n 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',\n symbol: 'TRUTH',\n address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',\n },\n },\n from: '0x0000000000000000000000000000000000000000',\n kind: 'erc1155_received',\n network_fee: {\n gas_price: '33571446596',\n native_token_price_in_usd: '2038.88',\n },\n },\n tx_hash:\n '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock MetaMask Swaps notification\n *\n * @returns Mock raw MetaMask Swaps notification\n */\nexport function createMockNotificationMetaMaskSwapsCompleted(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.METAMASK_SWAP_COMPLETED,\n notification_type: 'on-chain',\n id: '7ddfe6a1-ac52-5ffe-aa40-f04242db4b8b',\n created_at: '2023-10-18T13:58:49.854596Z',\n unread: true,\n payload: {\n block_number: 18377666,\n block_timestamp: '1697637275',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'metamask_swap_completed',\n rate: '1558.27',\n token_in: {\n usd: '1576.73',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '9000000000000000',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n token_out: {\n usd: '1.00',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdt.svg',\n amount: '14024419',\n symbol: 'USDT',\n address: '0xdac17f958d2ee523a2206206994597c13d831ec7',\n decimals: '6',\n name: 'USDT',\n },\n network_fee: {\n gas_price: '15406129273',\n native_token_price_in_usd: '1576.73',\n },\n },\n tx_hash:\n '0xf69074290f3aa11bce567aabc9ca0df7a12559dfae1b80ba1a124e9dfe19ecc5',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock RocketPool Stake Completed notification\n *\n * @returns Mock raw RocketPool Stake Completed notification\n */\nexport function createMockNotificationRocketPoolStakeCompleted(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_STAKE_COMPLETED,\n notification_type: 'on-chain',\n id: 'c2a2f225-b2fb-5d6c-ba56-e27a5c71ffb9',\n created_at: '2023-11-20T12:02:48.796824Z',\n unread: true,\n payload: {\n block_number: 18585057,\n block_timestamp: '1700145059',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_stake_completed',\n stake_in: {\n usd: '2031.86',\n name: 'Ethereum',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '190690478063438272',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n },\n stake_out: {\n usd: '2226.49',\n name: 'Rocket Pool ETH',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',\n amount: '175024360778165879',\n symbol: 'RETH',\n address: '0xae78736Cd615f374D3085123A210448E74Fc6393',\n decimals: '18',\n },\n network_fee: {\n gas_price: '36000000000',\n native_token_price_in_usd: '2031.86',\n },\n },\n tx_hash:\n '0xcfc0693bf47995907b0f46ef0644cf16dd9a0de797099b2e00fd481e1b2117d3',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock RocketPool Un-staked notification\n *\n * @returns Mock raw RocketPool Un-staked notification\n */\nexport function createMockNotificationRocketPoolUnStakeCompleted(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.ROCKETPOOL_UNSTAKE_COMPLETED,\n notification_type: 'on-chain',\n id: '291ec897-f569-4837-b6c0-21001b198dff',\n created_at: '2023-10-19T13:11:10.623042Z',\n unread: true,\n payload: {\n block_number: 18384336,\n block_timestamp: '1697718011',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'rocketpool_unstake_completed',\n stake_in: {\n usd: '1686.34',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',\n amount: '66608041413696770',\n symbol: 'RETH',\n address: '0xae78736Cd615f374D3085123A210448E74Fc6393',\n decimals: '18',\n name: 'Rocketpool Eth',\n },\n stake_out: {\n usd: '1553.75',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '72387843427700824',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '5656322987',\n native_token_price_in_usd: '1553.75',\n },\n },\n tx_hash:\n '0xc7972a7e409abfc62590ec90e633acd70b9b74e76ad02305be8bf133a0e22d5f',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Stake Completed notification\n *\n * @returns Mock raw Lido Stake Completed notification\n */\nexport function createMockNotificationLidoStakeCompleted(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.LIDO_STAKE_COMPLETED,\n notification_type: 'on-chain',\n id: 'ec10d66a-f78f-461f-83c9-609aada8cc50',\n created_at: '2023-11-02T22:28:49.970865Z',\n unread: true,\n payload: {\n block_number: 18487118,\n block_timestamp: '1698961091',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_stake_completed',\n stake_in: {\n usd: '1806.33',\n name: 'Ethereum',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '330303634023928032',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n },\n stake_out: {\n usd: '1801.30',\n name: 'Liquid staked Ether 2.0',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '330303634023928032',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n },\n network_fee: {\n gas_price: '26536359866',\n native_token_price_in_usd: '1806.33',\n },\n },\n tx_hash:\n '0x8cc0fa805f7c3b1743b14f3b91c6b824113b094f26d4ccaf6a71ad8547ce6a0f',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Requested notification\n *\n * @returns Mock raw Lido Withdrawal Requested notification\n */\nexport function createMockNotificationLidoWithdrawalRequested(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.LIDO_WITHDRAWAL_REQUESTED,\n notification_type: 'on-chain',\n id: 'ef003925-3379-4ba7-9e2d-8218690cadc9',\n created_at: '2023-10-18T15:04:02.482526Z',\n unread: true,\n payload: {\n block_number: 18377760,\n block_timestamp: '1697638415',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_withdrawal_requested',\n stake_in: {\n usd: '1568.54',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '97180668792218669859',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n name: 'Staked Eth',\n },\n stake_out: {\n usd: '1576.73',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '97180668792218669859',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '11658906980',\n native_token_price_in_usd: '1576.73',\n },\n },\n tx_hash:\n '0x58b5f82e084cb750ea174e02b20fbdfd2ba8d78053deac787f34fc38e5d427aa',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Completed notification\n *\n * @returns Mock raw Lido Withdrawal Completed notification\n */\nexport function createMockNotificationLidoWithdrawalCompleted(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.LIDO_WITHDRAWAL_COMPLETED,\n notification_type: 'on-chain',\n id: 'd73df14d-ce73-4f38-bad3-ab028154042f',\n created_at: '2023-10-18T16:35:03.147606Z',\n unread: true,\n payload: {\n block_number: 18378208,\n block_timestamp: '1697643851',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_withdrawal_completed',\n stake_in: {\n usd: '1570.23',\n image:\n 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',\n amount: '35081997661451346',\n symbol: 'STETH',\n address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',\n decimals: '18',\n name: 'Staked Eth',\n },\n stake_out: {\n usd: '1571.74',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n amount: '35081997661451346',\n symbol: 'ETH',\n address: '0x0000000000000000000000000000000000000000',\n decimals: '18',\n name: 'Ethereum',\n },\n network_fee: {\n gas_price: '12699495150',\n native_token_price_in_usd: '1571.74',\n },\n },\n tx_hash:\n '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Lido Withdrawal Ready notification\n *\n * @returns Mock raw Lido Withdrawal Ready notification\n */\nexport function createMockNotificationLidoReadyToBeWithdrawn(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.LIDO_STAKE_READY_TO_BE_WITHDRAWN,\n notification_type: 'on-chain',\n id: 'd73df14d-ce73-4f38-bad3-ab028154042e',\n created_at: '2023-10-18T16:35:03.147606Z',\n unread: true,\n payload: {\n block_number: 18378208,\n block_timestamp: '1697643851',\n chain_id: 1,\n address: '0x881D40237659C251811CEC9c364ef91dC08D300C',\n data: {\n kind: 'lido_stake_ready_to_be_withdrawn',\n request_id: '123456789',\n staked_eth: {\n address: '0x881D40237659C251811CEC9c364ef91dC08D300F',\n symbol: 'ETH',\n name: 'Ethereum',\n amount: '2.5',\n decimals: '18',\n image:\n 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',\n usd: '10000.00',\n },\n },\n tx_hash:\n '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - create a mock Generic Platform notification\n *\n * @returns Mock raw Generic Platform notification\n */\nexport function createMockPlatformNotification(): NormalisedAPINotification {\n const mockNotification: NormalisedAPINotification = {\n type: TRIGGER_TYPES.PLATFORM,\n notification_type: 'platform',\n id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n unread: false,\n created_at: '2025-10-09T09:45:34.202Z',\n template: {\n image_url:\n 'https://images.ctfassets.net/clixtyxoaeas/4rnpEzy1ATWRKVBOLxZ1Fm/a74dc1eed36d23d7ea6030383a4d5163/MetaMask-icon-fox.svg',\n title: 'Welcome to MetaMask!',\n body: 'Your account has been successfully set up. Start exploring the world of DeFi.',\n cta: {\n content: 'Get Started',\n link: 'https://metamask.io/get-started',\n },\n },\n };\n\n return mockNotification;\n}\n\n/**\n * Mocking Utility - creates an array of raw on-chain notifications\n *\n * @returns Array of raw on-chain notifications\n */\nexport function createMockRawOnChainNotifications(): NormalisedAPINotification[] {\n return [1, 2, 3].map((id) => {\n const notification = createMockNotificationEthSent();\n notification.id += `-${id}`;\n return notification;\n });\n}\n"]}
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getMockCreatePerpOrderNotification = exports.getMockMarkNotificationsAsReadResponse = exports.getMockListNotificationsResponse = exports.MOCK_RAW_ON_CHAIN_NOTIFICATIONS = exports.getMockOnChainNotificationsConfig = exports.getMockUpdateOnChainNotifications = exports.getMockFeatureAnnouncementResponse = exports.CONTENTFUL_RESPONSE = void 0;
|
|
4
4
|
const mock_feature_announcements_1 = require("./mock-feature-announcements.cjs");
|
|
5
5
|
const mock_raw_notifications_1 = require("./mock-raw-notifications.cjs");
|
|
6
|
+
const api_notifications_1 = require("../services/api-notifications.cjs");
|
|
6
7
|
const feature_announcements_1 = require("../services/feature-announcements.cjs");
|
|
7
|
-
const onchain_notifications_1 = require("../services/onchain-notifications.cjs");
|
|
8
8
|
const perp_notifications_1 = require("../services/perp-notifications.cjs");
|
|
9
9
|
exports.CONTENTFUL_RESPONSE = (0, mock_feature_announcements_1.createMockFeatureAnnouncementAPIResult)();
|
|
10
10
|
const getMockFeatureAnnouncementResponse = () => {
|
|
@@ -17,7 +17,7 @@ const getMockFeatureAnnouncementResponse = () => {
|
|
|
17
17
|
exports.getMockFeatureAnnouncementResponse = getMockFeatureAnnouncementResponse;
|
|
18
18
|
const getMockUpdateOnChainNotifications = () => {
|
|
19
19
|
return {
|
|
20
|
-
url:
|
|
20
|
+
url: api_notifications_1.TRIGGER_API_NOTIFICATIONS_ENDPOINT,
|
|
21
21
|
requestMethod: 'POST',
|
|
22
22
|
response: null,
|
|
23
23
|
};
|
|
@@ -25,7 +25,7 @@ const getMockUpdateOnChainNotifications = () => {
|
|
|
25
25
|
exports.getMockUpdateOnChainNotifications = getMockUpdateOnChainNotifications;
|
|
26
26
|
const getMockOnChainNotificationsConfig = () => {
|
|
27
27
|
return {
|
|
28
|
-
url:
|
|
28
|
+
url: api_notifications_1.TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT,
|
|
29
29
|
requestMethod: 'POST',
|
|
30
30
|
response: [{ address: '0xTestAddress', enabled: true }],
|
|
31
31
|
};
|
|
@@ -34,7 +34,7 @@ exports.getMockOnChainNotificationsConfig = getMockOnChainNotificationsConfig;
|
|
|
34
34
|
exports.MOCK_RAW_ON_CHAIN_NOTIFICATIONS = (0, mock_raw_notifications_1.createMockRawOnChainNotifications)();
|
|
35
35
|
const getMockListNotificationsResponse = () => {
|
|
36
36
|
return {
|
|
37
|
-
url:
|
|
37
|
+
url: api_notifications_1.NOTIFICATION_API_LIST_ENDPOINT,
|
|
38
38
|
requestMethod: 'POST',
|
|
39
39
|
response: exports.MOCK_RAW_ON_CHAIN_NOTIFICATIONS,
|
|
40
40
|
};
|
|
@@ -42,7 +42,7 @@ const getMockListNotificationsResponse = () => {
|
|
|
42
42
|
exports.getMockListNotificationsResponse = getMockListNotificationsResponse;
|
|
43
43
|
const getMockMarkNotificationsAsReadResponse = () => {
|
|
44
44
|
return {
|
|
45
|
-
url:
|
|
45
|
+
url: api_notifications_1.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,
|
|
46
46
|
requestMethod: 'POST',
|
|
47
47
|
response: null,
|
|
48
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResponses.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":";;;AAAA,iFAAsF;AACtF,yEAA6E;AAC7E,iFAA6E;AAC7E,
|
|
1
|
+
{"version":3,"file":"mockResponses.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":";;;AAAA,iFAAsF;AACtF,yEAA6E;AAC7E,yEAKuC;AACvC,iFAA6E;AAC7E,2EAAyE;AAQ5D,QAAA,mBAAmB,GAAG,IAAA,mEAAsC,GAAE,CAAC;AAErE,MAAM,kCAAkC,GAAG,GAAG,EAAE;IACrD,OAAO;QACL,GAAG,EAAE,gDAAwB;QAC7B,aAAa,EAAE,KAAK;QACpB,QAAQ,EAAE,2BAAmB;KACP,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,kCAAkC,sCAM7C;AAEK,MAAM,iCAAiC,GAAG,GAAG,EAAE;IACpD,OAAO;QACL,GAAG,EAAE,sDAAkC;QACvC,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,iCAAiC,qCAM5C;AAEK,MAAM,iCAAiC,GAAG,GAAG,EAAE;IACpD,OAAO;QACL,GAAG,EAAE,4DAAwC;QAC7C,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;KACjC,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,iCAAiC,qCAM5C;AAEW,QAAA,+BAA+B,GAC1C,IAAA,0DAAiC,GAAE,CAAC;AAE/B,MAAM,gCAAgC,GAAG,GAAG,EAAE;IACnD,OAAO;QACL,GAAG,EAAE,kDAA8B;QACnC,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,uCAA+B;KACnB,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,gCAAgC,oCAM3C;AAEK,MAAM,sCAAsC,GAAG,GAAG,EAAE;IACzD,OAAO;QACL,GAAG,EAAE,8DAA0C;QAC/C,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,sCAAsC,0CAMjD;AAEK,MAAM,kCAAkC,GAAG,GAAG,EAAE;IACrD,OAAO;QACL,GAAG,EAAE,4CAAuB;QAC5B,aAAa,EAAE,MAAM;QACrB,QAAQ,EAAE,IAAI;KACQ,CAAC;AAC3B,CAAC,CAAC;AANW,QAAA,kCAAkC,sCAM7C","sourcesContent":["import { createMockFeatureAnnouncementAPIResult } from './mock-feature-announcements';\nimport { createMockRawOnChainNotifications } from './mock-raw-notifications';\nimport {\n NOTIFICATION_API_LIST_ENDPOINT,\n NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n TRIGGER_API_NOTIFICATIONS_ENDPOINT,\n TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT,\n} from '../services/api-notifications';\nimport { FEATURE_ANNOUNCEMENT_API } from '../services/feature-announcements';\nimport { PERPS_API_CREATE_ORDERS } from '../services/perp-notifications';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();\n\nexport const getMockFeatureAnnouncementResponse = () => {\n return {\n url: FEATURE_ANNOUNCEMENT_API,\n requestMethod: 'GET',\n response: CONTENTFUL_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockUpdateOnChainNotifications = () => {\n return {\n url: TRIGGER_API_NOTIFICATIONS_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockOnChainNotificationsConfig = () => {\n return {\n url: TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT,\n requestMethod: 'POST',\n response: [{ address: '0xTestAddress', enabled: true }],\n } satisfies MockResponse;\n};\n\nexport const MOCK_RAW_ON_CHAIN_NOTIFICATIONS =\n createMockRawOnChainNotifications();\n\nexport const getMockListNotificationsResponse = () => {\n return {\n url: NOTIFICATION_API_LIST_ENDPOINT,\n requestMethod: 'POST',\n response: MOCK_RAW_ON_CHAIN_NOTIFICATIONS,\n } satisfies MockResponse;\n};\n\nexport const getMockMarkNotificationsAsReadResponse = () => {\n return {\n url: NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockCreatePerpOrderNotification = () => {\n return {\n url: PERPS_API_CREATE_ORDERS,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n"]}
|
|
@@ -17,11 +17,11 @@ export declare const getMockOnChainNotificationsConfig: () => {
|
|
|
17
17
|
enabled: boolean;
|
|
18
18
|
}[];
|
|
19
19
|
};
|
|
20
|
-
export declare const MOCK_RAW_ON_CHAIN_NOTIFICATIONS: import("../index.cjs").
|
|
20
|
+
export declare const MOCK_RAW_ON_CHAIN_NOTIFICATIONS: import("../index.cjs").NormalisedAPINotification[];
|
|
21
21
|
export declare const getMockListNotificationsResponse: () => {
|
|
22
22
|
url: string;
|
|
23
23
|
requestMethod: "POST";
|
|
24
|
-
response: import("../index.cjs").
|
|
24
|
+
response: import("../index.cjs").NormalisedAPINotification[];
|
|
25
25
|
};
|
|
26
26
|
export declare const getMockMarkNotificationsAsReadResponse: () => {
|
|
27
27
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResponses.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB,8DAA2C,CAAC;AAE5E,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;CAM7C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;CAM7C,CAAC;AAEF,eAAO,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"mockResponses.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB,8DAA2C,CAAC;AAE5E,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;CAM7C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;CAM7C,CAAC;AAEF,eAAO,MAAM,+BAA+B,0CACP,CAAC;AAEtC,eAAO,MAAM,gCAAgC;;;;CAM5C,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;CAMlD,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC"}
|
|
@@ -17,11 +17,11 @@ export declare const getMockOnChainNotificationsConfig: () => {
|
|
|
17
17
|
enabled: boolean;
|
|
18
18
|
}[];
|
|
19
19
|
};
|
|
20
|
-
export declare const MOCK_RAW_ON_CHAIN_NOTIFICATIONS: import("../index.mjs").
|
|
20
|
+
export declare const MOCK_RAW_ON_CHAIN_NOTIFICATIONS: import("../index.mjs").NormalisedAPINotification[];
|
|
21
21
|
export declare const getMockListNotificationsResponse: () => {
|
|
22
22
|
url: string;
|
|
23
23
|
requestMethod: "POST";
|
|
24
|
-
response: import("../index.mjs").
|
|
24
|
+
response: import("../index.mjs").NormalisedAPINotification[];
|
|
25
25
|
};
|
|
26
26
|
export declare const getMockMarkNotificationsAsReadResponse: () => {
|
|
27
27
|
url: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResponses.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB,8DAA2C,CAAC;AAE5E,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;CAM7C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;CAM7C,CAAC;AAEF,eAAO,MAAM,+BAA+B,
|
|
1
|
+
{"version":3,"file":"mockResponses.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,mBAAmB,8DAA2C,CAAC;AAE5E,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;CAM7C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;CAM7C,CAAC;AAEF,eAAO,MAAM,+BAA+B,0CACP,CAAC;AAEtC,eAAO,MAAM,gCAAgC;;;;CAM5C,CAAC;AAEF,eAAO,MAAM,sCAAsC;;;;CAMlD,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;CAM9C,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createMockFeatureAnnouncementAPIResult } from "./mock-feature-announcements.mjs";
|
|
2
2
|
import { createMockRawOnChainNotifications } from "./mock-raw-notifications.mjs";
|
|
3
|
+
import { NOTIFICATION_API_LIST_ENDPOINT, NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT, TRIGGER_API_NOTIFICATIONS_ENDPOINT, TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT } from "../services/api-notifications.mjs";
|
|
3
4
|
import { FEATURE_ANNOUNCEMENT_API } from "../services/feature-announcements.mjs";
|
|
4
|
-
import { NOTIFICATION_API_LIST_ENDPOINT, NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT, TRIGGER_API_NOTIFICATIONS_ENDPOINT, TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT } from "../services/onchain-notifications.mjs";
|
|
5
5
|
import { PERPS_API_CREATE_ORDERS } from "../services/perp-notifications.mjs";
|
|
6
6
|
export const CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();
|
|
7
7
|
export const getMockFeatureAnnouncementResponse = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mockResponses.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,yCAAqC;AACtF,OAAO,EAAE,iCAAiC,EAAE,qCAAiC;AAC7E,OAAO,
|
|
1
|
+
{"version":3,"file":"mockResponses.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/mocks/mockResponses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sCAAsC,EAAE,yCAAqC;AACtF,OAAO,EAAE,iCAAiC,EAAE,qCAAiC;AAC7E,OAAO,EACL,8BAA8B,EAC9B,0CAA0C,EAC1C,kCAAkC,EAClC,wCAAwC,EACzC,0CAAsC;AACvC,OAAO,EAAE,wBAAwB,EAAE,8CAA0C;AAC7E,OAAO,EAAE,uBAAuB,EAAE,2CAAuC;AAQzE,MAAM,CAAC,MAAM,mBAAmB,GAAG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ifications } from './mock-raw-notifications';\nimport {\n NOTIFICATION_API_LIST_ENDPOINT,\n NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n TRIGGER_API_NOTIFICATIONS_ENDPOINT,\n TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT,\n} from '../services/api-notifications';\nimport { FEATURE_ANNOUNCEMENT_API } from '../services/feature-announcements';\nimport { PERPS_API_CREATE_ORDERS } from '../services/perp-notifications';\n\ntype MockResponse = {\n url: string;\n requestMethod: 'GET' | 'POST' | 'PUT' | 'DELETE';\n response: unknown;\n};\n\nexport const CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();\n\nexport const getMockFeatureAnnouncementResponse = () => {\n return {\n url: FEATURE_ANNOUNCEMENT_API,\n requestMethod: 'GET',\n response: CONTENTFUL_RESPONSE,\n } satisfies MockResponse;\n};\n\nexport const getMockUpdateOnChainNotifications = () => {\n return {\n url: TRIGGER_API_NOTIFICATIONS_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockOnChainNotificationsConfig = () => {\n return {\n url: TRIGGER_API_NOTIFICATIONS_QUERY_ENDPOINT,\n requestMethod: 'POST',\n response: [{ address: '0xTestAddress', enabled: true }],\n } satisfies MockResponse;\n};\n\nexport const MOCK_RAW_ON_CHAIN_NOTIFICATIONS =\n createMockRawOnChainNotifications();\n\nexport const getMockListNotificationsResponse = () => {\n return {\n url: NOTIFICATION_API_LIST_ENDPOINT,\n requestMethod: 'POST',\n response: MOCK_RAW_ON_CHAIN_NOTIFICATIONS,\n } satisfies MockResponse;\n};\n\nexport const getMockMarkNotificationsAsReadResponse = () => {\n return {\n url: NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n\nexport const getMockCreatePerpOrderNotification = () => {\n return {\n url: PERPS_API_CREATE_ORDERS,\n requestMethod: 'POST',\n response: null,\n } satisfies MockResponse;\n};\n"]}
|
|
@@ -16,5 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./process-feature-announcement.cjs"), exports);
|
|
18
18
|
__exportStar(require("./process-notifications.cjs"), exports);
|
|
19
|
-
__exportStar(require("./process-
|
|
19
|
+
__exportStar(require("./process-api-notifications.cjs"), exports);
|
|
20
20
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAA+C;AAC/C,8DAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qEAA+C;AAC/C,8DAAwC;AACxC,kEAA4C","sourcesContent":["export * from './process-feature-announcement';\nexport * from './process-notifications';\nexport * from './process-api-notifications';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,gDAA4C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,gDAA4C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/index.ts"],"names":[],"mappings":"AAAA,mDAA+C;AAC/C,4CAAwC;AACxC,gDAA4C","sourcesContent":["export * from './process-feature-announcement';\nexport * from './process-notifications';\nexport * from './process-api-notifications';\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processAPINotifications = void 0;
|
|
4
|
+
const should_auto_expire_1 = require("../utils/should-auto-expire.cjs");
|
|
5
|
+
/**
|
|
6
|
+
* Processes API notifications to a normalized INotification shape
|
|
7
|
+
*
|
|
8
|
+
* @param notification - API Notification (On-Chain or Platform Notification)
|
|
9
|
+
* @returns Normalized Notification
|
|
10
|
+
*/
|
|
11
|
+
function processAPINotifications(notification) {
|
|
12
|
+
const createdAtDate = new Date(notification.created_at);
|
|
13
|
+
const expired = (0, should_auto_expire_1.shouldAutoExpire)(createdAtDate);
|
|
14
|
+
return {
|
|
15
|
+
...notification,
|
|
16
|
+
id: notification.id,
|
|
17
|
+
createdAt: createdAtDate.toISOString(),
|
|
18
|
+
isRead: expired || !notification.unread,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.processAPINotifications = processAPINotifications;
|
|
22
|
+
//# sourceMappingURL=process-api-notifications.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-api-notifications.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":";;;AAEA,wEAA+D;AAE/D;;;;;GAKG;AACH,SAAgB,uBAAuB,CACrC,YAAuC;IAEvC,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,IAAA,qCAAgB,EAAC,aAAa,CAAC,CAAC;IAEhD,OAAO;QACL,GAAG,YAAY;QACf,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,SAAS,EAAE,aAAa,CAAC,WAAW,EAAE;QACtC,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM;KACxC,CAAC;AACJ,CAAC;AAZD,0DAYC","sourcesContent":["import type { INotification } from '../types/notification/notification';\nimport type { NormalisedAPINotification } from '../types/notification-api/notification-api';\nimport { shouldAutoExpire } from '../utils/should-auto-expire';\n\n/**\n * Processes API notifications to a normalized INotification shape\n *\n * @param notification - API Notification (On-Chain or Platform Notification)\n * @returns Normalized Notification\n */\nexport function processAPINotifications(\n notification: NormalisedAPINotification,\n): INotification {\n const createdAtDate = new Date(notification.created_at);\n const expired = shouldAutoExpire(createdAtDate);\n\n return {\n ...notification,\n id: notification.id,\n createdAt: createdAtDate.toISOString(),\n isRead: expired || !notification.unread,\n };\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INotification } from "../types/notification/notification.cjs";
|
|
2
|
+
import type { NormalisedAPINotification } from "../types/notification-api/notification-api.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Processes API notifications to a normalized INotification shape
|
|
5
|
+
*
|
|
6
|
+
* @param notification - API Notification (On-Chain or Platform Notification)
|
|
7
|
+
* @returns Normalized Notification
|
|
8
|
+
*/
|
|
9
|
+
export declare function processAPINotifications(notification: NormalisedAPINotification): INotification;
|
|
10
|
+
//# sourceMappingURL=process-api-notifications.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-api-notifications.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,uDAAmD;AAG5F;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,yBAAyB,GACtC,aAAa,CAUf"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INotification } from "../types/notification/notification.mjs";
|
|
2
|
+
import type { NormalisedAPINotification } from "../types/notification-api/notification-api.mjs";
|
|
3
|
+
/**
|
|
4
|
+
* Processes API notifications to a normalized INotification shape
|
|
5
|
+
*
|
|
6
|
+
* @param notification - API Notification (On-Chain or Platform Notification)
|
|
7
|
+
* @returns Normalized Notification
|
|
8
|
+
*/
|
|
9
|
+
export declare function processAPINotifications(notification: NormalisedAPINotification): INotification;
|
|
10
|
+
//# sourceMappingURL=process-api-notifications.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-api-notifications.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;AACxE,OAAO,KAAK,EAAE,yBAAyB,EAAE,uDAAmD;AAG5F;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,YAAY,EAAE,yBAAyB,GACtC,aAAa,CAUf"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { shouldAutoExpire } from "../utils/should-auto-expire.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Processes API notifications to a normalized INotification shape
|
|
4
|
+
*
|
|
5
|
+
* @param notification - API Notification (On-Chain or Platform Notification)
|
|
6
|
+
* @returns Normalized Notification
|
|
7
|
+
*/
|
|
8
|
+
export function processAPINotifications(notification) {
|
|
9
|
+
const createdAtDate = new Date(notification.created_at);
|
|
10
|
+
const expired = shouldAutoExpire(createdAtDate);
|
|
11
|
+
return {
|
|
12
|
+
...notification,
|
|
13
|
+
id: notification.id,
|
|
14
|
+
createdAt: createdAtDate.toISOString(),
|
|
15
|
+
isRead: expired || !notification.unread,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=process-api-notifications.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-api-notifications.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-api-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,wCAAoC;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CACrC,YAAuC;IAEvC,MAAM,aAAa,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACxD,MAAM,OAAO,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAEhD,OAAO;QACL,GAAG,YAAY;QACf,EAAE,EAAE,YAAY,CAAC,EAAE;QACnB,SAAS,EAAE,aAAa,CAAC,WAAW,EAAE;QACtC,MAAM,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC,MAAM;KACxC,CAAC;AACJ,CAAC","sourcesContent":["import type { INotification } from '../types/notification/notification';\nimport type { NormalisedAPINotification } from '../types/notification-api/notification-api';\nimport { shouldAutoExpire } from '../utils/should-auto-expire';\n\n/**\n * Processes API notifications to a normalized INotification shape\n *\n * @param notification - API Notification (On-Chain or Platform Notification)\n * @returns Normalized Notification\n */\nexport function processAPINotifications(\n notification: NormalisedAPINotification,\n): INotification {\n const createdAtDate = new Date(notification.created_at);\n const expired = shouldAutoExpire(createdAtDate);\n\n return {\n ...notification,\n id: notification.id,\n createdAt: createdAtDate.toISOString(),\n isRead: expired || !notification.unread,\n };\n}\n"]}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processFeatureAnnouncement = exports.isFeatureAnnouncementRead = void 0;
|
|
4
|
-
const
|
|
5
|
-
const shouldAutoExpire = (oldDate) => {
|
|
6
|
-
const differenceInTime = Date.now() - oldDate.getTime();
|
|
7
|
-
const differenceInDays = differenceInTime / ONE_DAY_MS;
|
|
8
|
-
return differenceInDays >= 90;
|
|
9
|
-
};
|
|
4
|
+
const should_auto_expire_1 = require("../utils/should-auto-expire.cjs");
|
|
10
5
|
/**
|
|
11
6
|
* Checks if a feature announcement should be read.
|
|
12
7
|
* Checks feature announcement state (from param), as well as if the notification is "expired"
|
|
@@ -19,7 +14,7 @@ function isFeatureAnnouncementRead(notification, readPlatformNotificationsList)
|
|
|
19
14
|
if (readPlatformNotificationsList.includes(notification.id)) {
|
|
20
15
|
return true;
|
|
21
16
|
}
|
|
22
|
-
return shouldAutoExpire(new Date(notification.createdAt));
|
|
17
|
+
return (0, should_auto_expire_1.shouldAutoExpire)(new Date(notification.createdAt));
|
|
23
18
|
}
|
|
24
19
|
exports.isFeatureAnnouncementRead = isFeatureAnnouncementRead;
|
|
25
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-feature-announcement.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.cjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":";;;AAEA,wEAA+D;AAE/D;;;;;;;GAOG;AACH,SAAgB,yBAAyB,CACvC,YAAqD,EACrD,6BAAuC;IAEvC,IAAI,6BAA6B,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAA,qCAAgB,EAAC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5D,CAAC;AARD,8DAQC;AAED;;;;;GAKG;AACH,SAAgB,0BAA0B,CACxC,YAAgD;IAEhD,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE;QACxB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QACzD,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC;AAVD,gEAUC","sourcesContent":["import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';\nimport type { INotification } from '../types/notification/notification';\nimport { shouldAutoExpire } from '../utils/should-auto-expire';\n\n/**\n * Checks if a feature announcement should be read.\n * Checks feature announcement state (from param), as well as if the notification is \"expired\"\n *\n * @param notification - notification to check\n * @param readPlatformNotificationsList - list of read notifications\n * @returns boolean if notification should be marked as read or unread\n */\nexport function isFeatureAnnouncementRead(\n notification: Pick<INotification, 'id' | 'createdAt'>,\n readPlatformNotificationsList: string[],\n): boolean {\n if (readPlatformNotificationsList.includes(notification.id)) {\n return true;\n }\n return shouldAutoExpire(new Date(notification.createdAt));\n}\n\n/**\n * Processes a feature announcement into a shared/normalised notification shape.\n *\n * @param notification - raw feature announcement\n * @returns a normalised feature announcement\n */\nexport function processFeatureAnnouncement(\n notification: FeatureAnnouncementRawNotification,\n): INotification {\n return {\n type: notification.type,\n id: notification.data.id,\n createdAt: new Date(notification.createdAt).toISOString(),\n data: notification.data,\n isRead: false,\n };\n}\n"]}
|
package/dist/NotificationServicesController/processors/process-feature-announcement.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-feature-announcement.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,+DAA2D;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.d.cts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,+DAA2D;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;AAGxE;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,EACrD,6BAA6B,EAAE,MAAM,EAAE,GACtC,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kCAAkC,GAC/C,aAAa,CAQf"}
|
package/dist/NotificationServicesController/processors/process-feature-announcement.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-feature-announcement.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,+DAA2D;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.d.mts","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kCAAkC,EAAE,+DAA2D;AAC7G,OAAO,KAAK,EAAE,aAAa,EAAE,+CAA2C;AAGxE;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,WAAW,CAAC,EACrD,6BAA6B,EAAE,MAAM,EAAE,GACtC,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kCAAkC,GAC/C,aAAa,CAQf"}
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
const shouldAutoExpire = (oldDate) => {
|
|
3
|
-
const differenceInTime = Date.now() - oldDate.getTime();
|
|
4
|
-
const differenceInDays = differenceInTime / ONE_DAY_MS;
|
|
5
|
-
return differenceInDays >= 90;
|
|
6
|
-
};
|
|
1
|
+
import { shouldAutoExpire } from "../utils/should-auto-expire.mjs";
|
|
7
2
|
/**
|
|
8
3
|
* Checks if a feature announcement should be read.
|
|
9
4
|
* Checks feature announcement state (from param), as well as if the notification is "expired"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"process-feature-announcement.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"process-feature-announcement.mjs","sourceRoot":"","sources":["../../../src/NotificationServicesController/processors/process-feature-announcement.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,wCAAoC;AAE/D;;;;;;;GAOG;AACH,MAAM,UAAU,yBAAyB,CACvC,YAAqD,EACrD,6BAAuC;IAEvC,IAAI,6BAA6B,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,gBAAgB,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC;AAC5D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CACxC,YAAgD;IAEhD,OAAO;QACL,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,EAAE,EAAE,YAAY,CAAC,IAAI,CAAC,EAAE;QACxB,SAAS,EAAE,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE;QACzD,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,MAAM,EAAE,KAAK;KACd,CAAC;AACJ,CAAC","sourcesContent":["import type { FeatureAnnouncementRawNotification } from '../types/feature-announcement/feature-announcement';\nimport type { INotification } from '../types/notification/notification';\nimport { shouldAutoExpire } from '../utils/should-auto-expire';\n\n/**\n * Checks if a feature announcement should be read.\n * Checks feature announcement state (from param), as well as if the notification is \"expired\"\n *\n * @param notification - notification to check\n * @param readPlatformNotificationsList - list of read notifications\n * @returns boolean if notification should be marked as read or unread\n */\nexport function isFeatureAnnouncementRead(\n notification: Pick<INotification, 'id' | 'createdAt'>,\n readPlatformNotificationsList: string[],\n): boolean {\n if (readPlatformNotificationsList.includes(notification.id)) {\n return true;\n }\n return shouldAutoExpire(new Date(notification.createdAt));\n}\n\n/**\n * Processes a feature announcement into a shared/normalised notification shape.\n *\n * @param notification - raw feature announcement\n * @returns a normalised feature announcement\n */\nexport function processFeatureAnnouncement(\n notification: FeatureAnnouncementRawNotification,\n): INotification {\n return {\n type: notification.type,\n id: notification.data.id,\n createdAt: new Date(notification.createdAt).toISOString(),\n data: notification.data,\n isRead: false,\n };\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processAndFilterNotifications = exports.safeProcessNotification = exports.processNotification = void 0;
|
|
4
|
+
const process_api_notifications_1 = require("./process-api-notifications.cjs");
|
|
4
5
|
const process_feature_announcement_1 = require("./process-feature-announcement.cjs");
|
|
5
|
-
const process_onchain_notifications_1 = require("./process-onchain-notifications.cjs");
|
|
6
6
|
const process_snap_notifications_1 = require("./process-snap-notifications.cjs");
|
|
7
7
|
const notification_schema_1 = require("../constants/notification-schema.cjs");
|
|
8
|
-
const isOnChainNotification = (n) =>
|
|
8
|
+
const isOnChainNotification = (n) => notification_schema_1.NOTIFICATION_API_TRIGGER_TYPES_SET.has(n.type);
|
|
9
9
|
const isFeatureAnnouncement = (n) => n.type === notification_schema_1.TRIGGER_TYPES.FEATURES_ANNOUNCEMENT;
|
|
10
10
|
const isSnapNotification = (n) => n.type === notification_schema_1.TRIGGER_TYPES.SNAP;
|
|
11
11
|
/**
|
|
@@ -30,7 +30,7 @@ function processNotification(notification, readNotifications = []) {
|
|
|
30
30
|
return (0, process_snap_notifications_1.processSnapNotification)(notification);
|
|
31
31
|
}
|
|
32
32
|
if (isOnChainNotification(notification)) {
|
|
33
|
-
return (0,
|
|
33
|
+
return (0, process_api_notifications_1.processAPINotifications)(notification);
|
|
34
34
|
}
|
|
35
35
|
return exhaustedAllCases(notification);
|
|
36
36
|
}
|