@metamask/notification-services-controller 19.0.0 → 21.0.0
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 +36 -2
- package/dist/NotificationServicesController/NotificationServicesController.cjs +20 -38
- package/dist/NotificationServicesController/NotificationServicesController.cjs.map +1 -1
- package/dist/NotificationServicesController/NotificationServicesController.d.cts +5 -2
- package/dist/NotificationServicesController/NotificationServicesController.d.cts.map +1 -1
- package/dist/NotificationServicesController/NotificationServicesController.d.mts +5 -2
- package/dist/NotificationServicesController/NotificationServicesController.d.mts.map +1 -1
- package/dist/NotificationServicesController/NotificationServicesController.mjs +20 -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 +427 -529
- 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 +424 -521
- 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 +5 -5
- 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} +57 -24
- package/dist/NotificationServicesController/services/api-notifications.cjs.map +1 -0
- package/dist/NotificationServicesController/services/{onchain-notifications.d.cts → api-notifications.d.cts} +20 -13
- package/dist/NotificationServicesController/services/api-notifications.d.cts.map +1 -0
- package/dist/NotificationServicesController/services/{onchain-notifications.d.mts → api-notifications.d.mts} +20 -13
- package/dist/NotificationServicesController/services/api-notifications.d.mts.map +1 -0
- package/dist/NotificationServicesController/services/{onchain-notifications.mjs → api-notifications.mjs} +49 -22
- package/dist/NotificationServicesController/services/api-notifications.mjs.map +1 -0
- package/dist/NotificationServicesController/services/feature-announcements.cjs.map +1 -1
- package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -1
- package/dist/NotificationServicesController/services/notification-config-cache.cjs.map +1 -1
- package/dist/NotificationServicesController/services/notification-config-cache.mjs.map +1 -1
- 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 +4 -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 +3 -0
- package/dist/NotificationServicesController/types/notification-api/schema.mjs.map +1 -0
- package/dist/NotificationServicesController/ui/constants.d.cts +27 -27
- package/dist/NotificationServicesController/ui/constants.d.mts +27 -27
- package/dist/NotificationServicesController/utils/isVersionInBounds.cjs.map +1 -1
- package/dist/NotificationServicesController/utils/isVersionInBounds.mjs.map +1 -1
- 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/NotificationServicesPushController.cjs +2 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts +2 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.cts.map +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts +2 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.d.mts.map +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +2 -0
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.cjs +1 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.cjs.map +1 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.mjs +1 -1
- package/dist/NotificationServicesPushController/mocks/mockResponse.mjs.map +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.cjs +10 -3
- package/dist/NotificationServicesPushController/services/endpoints.cjs.map +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.cts +3 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.cts.map +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.mts +3 -1
- package/dist/NotificationServicesPushController/services/endpoints.d.mts.map +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.mjs +7 -2
- package/dist/NotificationServicesPushController/services/endpoints.mjs.map +1 -1
- 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/services/services.cjs +2 -1
- package/dist/NotificationServicesPushController/services/services.cjs.map +1 -1
- package/dist/NotificationServicesPushController/services/services.d.cts +3 -0
- package/dist/NotificationServicesPushController/services/services.d.cts.map +1 -1
- package/dist/NotificationServicesPushController/services/services.d.mts +3 -0
- package/dist/NotificationServicesPushController/services/services.d.mts.map +1 -1
- package/dist/NotificationServicesPushController/services/services.mjs +2 -1
- package/dist/NotificationServicesPushController/services/services.mjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.cjs.map +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.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 +22 -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 +20 -4
- package/dist/shared/to-raw-notification.mjs.map +1 -1
- package/package.json +9 -7
- 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 +0 -10
- 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 +0 -9
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createMockRawOnChainNotifications = exports.
|
|
3
|
+
exports.createMockRawOnChainNotifications = exports.createMockPlatformNotification = exports.createMockNotificationLidoReadyToBeWithdrawn = exports.createMockNotificationLidoWithdrawalCompleted = exports.createMockNotificationLidoWithdrawalRequested = exports.createMockNotificationLidoStakeCompleted = exports.createMockNotificationRocketPoolUnStakeCompleted = exports.createMockNotificationRocketPoolStakeCompleted = exports.createMockNotificationMetaMaskSwapsCompleted = exports.createMockNotificationERC1155Received = exports.createMockNotificationERC1155Sent = exports.createMockNotificationERC721Received = exports.createMockNotificationERC721Sent = exports.createMockNotificationERC20Received = exports.createMockNotificationERC20Sent = exports.createMockNotificationEthReceived = exports.createMockNotificationEthSent = void 0;
|
|
4
4
|
const notification_schema_1 = require("../constants/notification-schema.cjs");
|
|
5
5
|
/**
|
|
6
6
|
* Mocking Utility - create a mock Eth sent notification
|
|
@@ -10,26 +10,28 @@ const notification_schema_1 = require("../constants/notification-schema.cjs");
|
|
|
10
10
|
function createMockNotificationEthSent() {
|
|
11
11
|
const mockNotification = {
|
|
12
12
|
type: notification_schema_1.TRIGGER_TYPES.ETH_SENT,
|
|
13
|
+
notification_type: 'on-chain',
|
|
13
14
|
id: '3fa85f64-5717-4562-b3fc-2c963f66afa7',
|
|
14
|
-
trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa7',
|
|
15
|
-
chain_id: 1,
|
|
16
|
-
block_number: 17485840,
|
|
17
|
-
block_timestamp: '2022-03-01T00:00:00Z',
|
|
18
|
-
tx_hash: '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
|
|
19
15
|
unread: true,
|
|
20
16
|
created_at: '2022-03-01T00:00:00Z',
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
17
|
+
payload: {
|
|
18
|
+
chain_id: 1,
|
|
19
|
+
block_number: 17485840,
|
|
20
|
+
block_timestamp: '2022-03-01T00:00:00Z',
|
|
21
|
+
tx_hash: '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
|
|
22
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
23
|
+
data: {
|
|
24
|
+
kind: 'eth_sent',
|
|
25
|
+
network_fee: {
|
|
26
|
+
gas_price: '207806259583',
|
|
27
|
+
native_token_price_in_usd: '0.83',
|
|
28
|
+
},
|
|
29
|
+
from: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
30
|
+
to: '0x881D40237659C251811CEC9c364ef91dC08D300D',
|
|
31
|
+
amount: {
|
|
32
|
+
usd: '670.64',
|
|
33
|
+
eth: '0.005',
|
|
34
|
+
},
|
|
33
35
|
},
|
|
34
36
|
},
|
|
35
37
|
};
|
|
@@ -44,26 +46,28 @@ exports.createMockNotificationEthSent = createMockNotificationEthSent;
|
|
|
44
46
|
function createMockNotificationEthReceived() {
|
|
45
47
|
const mockNotification = {
|
|
46
48
|
type: notification_schema_1.TRIGGER_TYPES.ETH_RECEIVED,
|
|
49
|
+
notification_type: 'on-chain',
|
|
47
50
|
id: '3fa85f64-5717-4562-b3fc-2c963f66afa8',
|
|
48
|
-
trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa8',
|
|
49
|
-
chain_id: 1,
|
|
50
|
-
block_number: 17485840,
|
|
51
|
-
block_timestamp: '2022-03-01T00:00:00Z',
|
|
52
|
-
tx_hash: '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
|
|
53
51
|
unread: true,
|
|
54
52
|
created_at: '2022-03-01T00:00:00Z',
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
payload: {
|
|
54
|
+
chain_id: 1,
|
|
55
|
+
block_number: 17485840,
|
|
56
|
+
block_timestamp: '2022-03-01T00:00:00Z',
|
|
57
|
+
tx_hash: '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
|
|
58
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
59
|
+
data: {
|
|
60
|
+
kind: 'eth_received',
|
|
61
|
+
network_fee: {
|
|
62
|
+
gas_price: '207806259583',
|
|
63
|
+
native_token_price_in_usd: '0.83',
|
|
64
|
+
},
|
|
65
|
+
from: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
66
|
+
to: '0x881D40237659C251811CEC9c364ef91dC08D300D',
|
|
67
|
+
amount: {
|
|
68
|
+
usd: '670.64',
|
|
69
|
+
eth: '808.000000000000000000',
|
|
70
|
+
},
|
|
67
71
|
},
|
|
68
72
|
},
|
|
69
73
|
};
|
|
@@ -78,31 +82,33 @@ exports.createMockNotificationEthReceived = createMockNotificationEthReceived;
|
|
|
78
82
|
function createMockNotificationERC20Sent() {
|
|
79
83
|
const mockNotification = {
|
|
80
84
|
type: notification_schema_1.TRIGGER_TYPES.ERC20_SENT,
|
|
85
|
+
notification_type: 'on-chain',
|
|
81
86
|
id: '3fa85f64-5717-4562-b3fc-2c963f66afa9',
|
|
82
|
-
trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa9',
|
|
83
|
-
chain_id: 1,
|
|
84
|
-
block_number: 17485840,
|
|
85
|
-
block_timestamp: '2022-03-01T00:00:00Z',
|
|
86
|
-
tx_hash: '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
|
|
87
87
|
unread: true,
|
|
88
88
|
created_at: '2022-03-01T00:00:00Z',
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
89
|
+
payload: {
|
|
90
|
+
chain_id: 1,
|
|
91
|
+
block_number: 17485840,
|
|
92
|
+
block_timestamp: '2022-03-01T00:00:00Z',
|
|
93
|
+
tx_hash: '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
|
|
94
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
95
|
+
data: {
|
|
96
|
+
kind: 'erc20_sent',
|
|
97
|
+
network_fee: {
|
|
98
|
+
gas_price: '207806259583',
|
|
99
|
+
native_token_price_in_usd: '0.83',
|
|
100
|
+
},
|
|
101
|
+
to: '0xecc19e177d24551aa7ed6bc6fe566eca726cc8a9',
|
|
102
|
+
from: '0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae',
|
|
103
|
+
token: {
|
|
104
|
+
usd: '1.00',
|
|
105
|
+
name: 'USDC',
|
|
106
|
+
image: 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdc.svg',
|
|
107
|
+
amount: '4956250000',
|
|
108
|
+
symbol: 'USDC',
|
|
109
|
+
address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
110
|
+
decimals: '6',
|
|
111
|
+
},
|
|
106
112
|
},
|
|
107
113
|
},
|
|
108
114
|
};
|
|
@@ -117,31 +123,33 @@ exports.createMockNotificationERC20Sent = createMockNotificationERC20Sent;
|
|
|
117
123
|
function createMockNotificationERC20Received() {
|
|
118
124
|
const mockNotification = {
|
|
119
125
|
type: notification_schema_1.TRIGGER_TYPES.ERC20_RECEIVED,
|
|
126
|
+
notification_type: 'on-chain',
|
|
120
127
|
id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
121
|
-
trigger_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
122
|
-
chain_id: 1,
|
|
123
|
-
block_number: 17485840,
|
|
124
|
-
block_timestamp: '2022-03-01T00:00:00Z',
|
|
125
|
-
tx_hash: '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
|
|
126
128
|
unread: true,
|
|
127
129
|
created_at: '2022-03-01T00:00:00Z',
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
130
|
+
payload: {
|
|
131
|
+
chain_id: 1,
|
|
132
|
+
block_number: 17485840,
|
|
133
|
+
block_timestamp: '2022-03-01T00:00:00Z',
|
|
134
|
+
tx_hash: '0xb2256b183f2fb3872f99294ab55fb03e6a479b0d4aca556a3b27568b712505a6',
|
|
135
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
136
|
+
data: {
|
|
137
|
+
kind: 'erc20_received',
|
|
138
|
+
network_fee: {
|
|
139
|
+
gas_price: '207806259583',
|
|
140
|
+
native_token_price_in_usd: '0.83',
|
|
141
|
+
},
|
|
142
|
+
to: '0xeae7380dd4cef6fbd1144f49e4d1e6964258a4f4',
|
|
143
|
+
from: '0x51c72848c68a965f66fa7a88855f9f7784502a7f',
|
|
144
|
+
token: {
|
|
145
|
+
usd: '0.00',
|
|
146
|
+
name: 'SHIBA INU',
|
|
147
|
+
image: 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/shib.svg',
|
|
148
|
+
amount: '8382798736999999457296646144',
|
|
149
|
+
symbol: 'SHIB',
|
|
150
|
+
address: '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',
|
|
151
|
+
decimals: '18',
|
|
152
|
+
},
|
|
145
153
|
},
|
|
146
154
|
},
|
|
147
155
|
};
|
|
@@ -156,35 +164,37 @@ exports.createMockNotificationERC20Received = createMockNotificationERC20Receive
|
|
|
156
164
|
function createMockNotificationERC721Sent() {
|
|
157
165
|
const mockNotification = {
|
|
158
166
|
type: notification_schema_1.TRIGGER_TYPES.ERC721_SENT,
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
chain_id: 1,
|
|
167
|
+
notification_type: 'on-chain',
|
|
168
|
+
id: 'a4193058-9814-537e-9df4-79dcac727fb6',
|
|
162
169
|
created_at: '2023-11-15T11:08:17.895407Z',
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
unread: true,
|
|
171
|
+
payload: {
|
|
172
|
+
block_number: 18576643,
|
|
173
|
+
block_timestamp: '1700043467',
|
|
174
|
+
chain_id: 1,
|
|
175
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
176
|
+
data: {
|
|
177
|
+
to: '0xf47f628fe3bd2595e9ab384bfffc3859b448e451',
|
|
178
|
+
nft: {
|
|
179
|
+
name: 'Captainz #8680',
|
|
180
|
+
image: 'https://i.seadn.io/s/raw/files/ae0fc06714ff7fb40217340d8a242c0e.gif?w=500&auto=format',
|
|
181
|
+
token_id: '8680',
|
|
182
|
+
collection: {
|
|
183
|
+
name: 'The Captainz',
|
|
184
|
+
image: 'https://i.seadn.io/gcs/files/6df4d75778066bce740050615bc84e21.png?w=500&auto=format',
|
|
185
|
+
symbol: 'Captainz',
|
|
186
|
+
address: '0x769272677fab02575e84945f03eca517acc544cc',
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',
|
|
190
|
+
kind: 'erc721_sent',
|
|
191
|
+
network_fee: {
|
|
192
|
+
gas_price: '24550653274',
|
|
193
|
+
native_token_price_in_usd: '1986.61',
|
|
175
194
|
},
|
|
176
195
|
},
|
|
177
|
-
|
|
178
|
-
kind: 'erc721_sent',
|
|
179
|
-
network_fee: {
|
|
180
|
-
gas_price: '24550653274',
|
|
181
|
-
native_token_price_in_usd: '1986.61',
|
|
182
|
-
},
|
|
196
|
+
tx_hash: '0x0833c69fb41cf972a0f031fceca242939bc3fcf82b964b74606649abcad371bd',
|
|
183
197
|
},
|
|
184
|
-
id: 'a4193058-9814-537e-9df4-79dcac727fb6',
|
|
185
|
-
trigger_id: '028485be-b994-422b-a93b-03fcc01ab715',
|
|
186
|
-
tx_hash: '0x0833c69fb41cf972a0f031fceca242939bc3fcf82b964b74606649abcad371bd',
|
|
187
|
-
unread: true,
|
|
188
198
|
};
|
|
189
199
|
return mockNotification;
|
|
190
200
|
}
|
|
@@ -197,35 +207,37 @@ exports.createMockNotificationERC721Sent = createMockNotificationERC721Sent;
|
|
|
197
207
|
function createMockNotificationERC721Received() {
|
|
198
208
|
const mockNotification = {
|
|
199
209
|
type: notification_schema_1.TRIGGER_TYPES.ERC721_RECEIVED,
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
chain_id: 1,
|
|
210
|
+
notification_type: 'on-chain',
|
|
211
|
+
id: '00a79d24-befa-57ed-a55a-9eb8696e1654',
|
|
203
212
|
created_at: '2023-11-14T17:40:52.319281Z',
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
unread: true,
|
|
214
|
+
payload: {
|
|
215
|
+
block_number: 18571446,
|
|
216
|
+
block_timestamp: '1699980623',
|
|
217
|
+
chain_id: 1,
|
|
218
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
219
|
+
data: {
|
|
220
|
+
to: '0xba7f3daa8adfdad686574406ab9bd5d2f0a49d2e',
|
|
221
|
+
nft: {
|
|
222
|
+
name: 'The Plague #2722',
|
|
223
|
+
image: 'https://i.seadn.io/s/raw/files/a96f90ec8ebf55a2300c66a0c46d6a16.png?w=500&auto=format',
|
|
224
|
+
token_id: '2722',
|
|
225
|
+
collection: {
|
|
226
|
+
name: 'The Plague NFT',
|
|
227
|
+
image: 'https://i.seadn.io/gcs/files/4577987a5ca45ca5118b2e31559ee4d1.jpg?w=500&auto=format',
|
|
228
|
+
symbol: 'FROG',
|
|
229
|
+
address: '0xc379e535caff250a01caa6c3724ed1359fe5c29b',
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
from: '0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f',
|
|
233
|
+
kind: 'erc721_received',
|
|
234
|
+
network_fee: {
|
|
235
|
+
gas_price: '53701898538',
|
|
236
|
+
native_token_price_in_usd: '2047.01',
|
|
216
237
|
},
|
|
217
238
|
},
|
|
218
|
-
|
|
219
|
-
kind: 'erc721_received',
|
|
220
|
-
network_fee: {
|
|
221
|
-
gas_price: '53701898538',
|
|
222
|
-
native_token_price_in_usd: '2047.01',
|
|
223
|
-
},
|
|
239
|
+
tx_hash: '0xe554c9e29e6eeca8ba94da4d047334ba08b8eb9ca3b801dd69cec08dfdd4ae43',
|
|
224
240
|
},
|
|
225
|
-
id: '00a79d24-befa-57ed-a55a-9eb8696e1654',
|
|
226
|
-
trigger_id: 'd24ac26a-8579-49ec-9947-d04d63592ebd',
|
|
227
|
-
tx_hash: '0xe554c9e29e6eeca8ba94da4d047334ba08b8eb9ca3b801dd69cec08dfdd4ae43',
|
|
228
|
-
unread: true,
|
|
229
241
|
};
|
|
230
242
|
return mockNotification;
|
|
231
243
|
}
|
|
@@ -238,35 +250,37 @@ exports.createMockNotificationERC721Received = createMockNotificationERC721Recei
|
|
|
238
250
|
function createMockNotificationERC1155Sent() {
|
|
239
251
|
const mockNotification = {
|
|
240
252
|
type: notification_schema_1.TRIGGER_TYPES.ERC1155_SENT,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
chain_id: 1,
|
|
253
|
+
notification_type: 'on-chain',
|
|
254
|
+
id: 'a09ff9d1-623a-52ab-a3d4-c7c8c9a58362',
|
|
244
255
|
created_at: '2023-11-20T20:44:10.110706Z',
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
256
|
+
unread: true,
|
|
257
|
+
payload: {
|
|
258
|
+
block_number: 18615206,
|
|
259
|
+
block_timestamp: '1700510003',
|
|
260
|
+
chain_id: 1,
|
|
261
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
262
|
+
data: {
|
|
263
|
+
to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',
|
|
264
|
+
nft: {
|
|
253
265
|
name: 'IlluminatiNFT DAO',
|
|
254
|
-
image: 'https://i.seadn.io/
|
|
255
|
-
|
|
256
|
-
|
|
266
|
+
image: 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',
|
|
267
|
+
token_id: '1',
|
|
268
|
+
collection: {
|
|
269
|
+
name: 'IlluminatiNFT DAO',
|
|
270
|
+
image: 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',
|
|
271
|
+
symbol: 'TRUTH',
|
|
272
|
+
address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
from: '0x0000000000000000000000000000000000000000',
|
|
276
|
+
kind: 'erc1155_sent',
|
|
277
|
+
network_fee: {
|
|
278
|
+
gas_price: '33571446596',
|
|
279
|
+
native_token_price_in_usd: '2038.88',
|
|
257
280
|
},
|
|
258
281
|
},
|
|
259
|
-
|
|
260
|
-
kind: 'erc1155_sent',
|
|
261
|
-
network_fee: {
|
|
262
|
-
gas_price: '33571446596',
|
|
263
|
-
native_token_price_in_usd: '2038.88',
|
|
264
|
-
},
|
|
282
|
+
tx_hash: '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',
|
|
265
283
|
},
|
|
266
|
-
id: 'a09ff9d1-623a-52ab-a3d4-c7c8c9a58362',
|
|
267
|
-
trigger_id: 'e2130f7d-78b8-4c34-999a-3f3d3bb5b03c',
|
|
268
|
-
tx_hash: '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',
|
|
269
|
-
unread: true,
|
|
270
284
|
};
|
|
271
285
|
return mockNotification;
|
|
272
286
|
}
|
|
@@ -279,35 +293,37 @@ exports.createMockNotificationERC1155Sent = createMockNotificationERC1155Sent;
|
|
|
279
293
|
function createMockNotificationERC1155Received() {
|
|
280
294
|
const mockNotification = {
|
|
281
295
|
type: notification_schema_1.TRIGGER_TYPES.ERC1155_RECEIVED,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
chain_id: 1,
|
|
296
|
+
notification_type: 'on-chain',
|
|
297
|
+
id: 'b6b93c84-e8dc-54ed-9396-7ea50474843a',
|
|
285
298
|
created_at: '2023-11-20T20:44:10.110706Z',
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
299
|
+
unread: true,
|
|
300
|
+
payload: {
|
|
301
|
+
block_number: 18615206,
|
|
302
|
+
block_timestamp: '1700510003',
|
|
303
|
+
chain_id: 1,
|
|
304
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
305
|
+
data: {
|
|
306
|
+
to: '0x15bd77ccacf2da39b84f0c31fee2e451225bb190',
|
|
307
|
+
nft: {
|
|
294
308
|
name: 'IlluminatiNFT DAO',
|
|
295
|
-
image: 'https://i.seadn.io/
|
|
296
|
-
|
|
297
|
-
|
|
309
|
+
image: 'https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format',
|
|
310
|
+
token_id: '1',
|
|
311
|
+
collection: {
|
|
312
|
+
name: 'IlluminatiNFT DAO',
|
|
313
|
+
image: 'https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format',
|
|
314
|
+
symbol: 'TRUTH',
|
|
315
|
+
address: '0xe25f0fe686477f9df3c2876c4902d3b85f75f33a',
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
from: '0x0000000000000000000000000000000000000000',
|
|
319
|
+
kind: 'erc1155_received',
|
|
320
|
+
network_fee: {
|
|
321
|
+
gas_price: '33571446596',
|
|
322
|
+
native_token_price_in_usd: '2038.88',
|
|
298
323
|
},
|
|
299
324
|
},
|
|
300
|
-
|
|
301
|
-
kind: 'erc1155_received',
|
|
302
|
-
network_fee: {
|
|
303
|
-
gas_price: '33571446596',
|
|
304
|
-
native_token_price_in_usd: '2038.88',
|
|
305
|
-
},
|
|
325
|
+
tx_hash: '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',
|
|
306
326
|
},
|
|
307
|
-
id: 'b6b93c84-e8dc-54ed-9396-7ea50474843a',
|
|
308
|
-
trigger_id: '710c8abb-43a9-42a5-9d86-9dd258726c82',
|
|
309
|
-
tx_hash: '0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f',
|
|
310
|
-
unread: true,
|
|
311
327
|
};
|
|
312
328
|
return mockNotification;
|
|
313
329
|
}
|
|
@@ -320,41 +336,43 @@ exports.createMockNotificationERC1155Received = createMockNotificationERC1155Rec
|
|
|
320
336
|
function createMockNotificationMetaMaskSwapsCompleted() {
|
|
321
337
|
const mockNotification = {
|
|
322
338
|
type: notification_schema_1.TRIGGER_TYPES.METAMASK_SWAP_COMPLETED,
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
chain_id: 1,
|
|
339
|
+
notification_type: 'on-chain',
|
|
340
|
+
id: '7ddfe6a1-ac52-5ffe-aa40-f04242db4b8b',
|
|
326
341
|
created_at: '2023-10-18T13:58:49.854596Z',
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
342
|
+
unread: true,
|
|
343
|
+
payload: {
|
|
344
|
+
block_number: 18377666,
|
|
345
|
+
block_timestamp: '1697637275',
|
|
346
|
+
chain_id: 1,
|
|
347
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
348
|
+
data: {
|
|
349
|
+
kind: 'metamask_swap_completed',
|
|
350
|
+
rate: '1558.27',
|
|
351
|
+
token_in: {
|
|
352
|
+
usd: '1576.73',
|
|
353
|
+
image: 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
|
|
354
|
+
amount: '9000000000000000',
|
|
355
|
+
symbol: 'ETH',
|
|
356
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
357
|
+
decimals: '18',
|
|
358
|
+
name: 'Ethereum',
|
|
359
|
+
},
|
|
360
|
+
token_out: {
|
|
361
|
+
usd: '1.00',
|
|
362
|
+
image: 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdt.svg',
|
|
363
|
+
amount: '14024419',
|
|
364
|
+
symbol: 'USDT',
|
|
365
|
+
address: '0xdac17f958d2ee523a2206206994597c13d831ec7',
|
|
366
|
+
decimals: '6',
|
|
367
|
+
name: 'USDT',
|
|
368
|
+
},
|
|
369
|
+
network_fee: {
|
|
370
|
+
gas_price: '15406129273',
|
|
371
|
+
native_token_price_in_usd: '1576.73',
|
|
372
|
+
},
|
|
352
373
|
},
|
|
374
|
+
tx_hash: '0xf69074290f3aa11bce567aabc9ca0df7a12559dfae1b80ba1a124e9dfe19ecc5',
|
|
353
375
|
},
|
|
354
|
-
id: '7ddfe6a1-ac52-5ffe-aa40-f04242db4b8b',
|
|
355
|
-
trigger_id: 'd2eaa2eb-2e6e-4fd5-8763-b70ea571b46c',
|
|
356
|
-
tx_hash: '0xf69074290f3aa11bce567aabc9ca0df7a12559dfae1b80ba1a124e9dfe19ecc5',
|
|
357
|
-
unread: true,
|
|
358
376
|
};
|
|
359
377
|
return mockNotification;
|
|
360
378
|
}
|
|
@@ -367,40 +385,42 @@ exports.createMockNotificationMetaMaskSwapsCompleted = createMockNotificationMet
|
|
|
367
385
|
function createMockNotificationRocketPoolStakeCompleted() {
|
|
368
386
|
const mockNotification = {
|
|
369
387
|
type: notification_schema_1.TRIGGER_TYPES.ROCKETPOOL_STAKE_COMPLETED,
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
chain_id: 1,
|
|
388
|
+
notification_type: 'on-chain',
|
|
389
|
+
id: 'c2a2f225-b2fb-5d6c-ba56-e27a5c71ffb9',
|
|
373
390
|
created_at: '2023-11-20T12:02:48.796824Z',
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
391
|
+
unread: true,
|
|
392
|
+
payload: {
|
|
393
|
+
block_number: 18585057,
|
|
394
|
+
block_timestamp: '1700145059',
|
|
395
|
+
chain_id: 1,
|
|
396
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
397
|
+
data: {
|
|
398
|
+
kind: 'rocketpool_stake_completed',
|
|
399
|
+
stake_in: {
|
|
400
|
+
usd: '2031.86',
|
|
401
|
+
name: 'Ethereum',
|
|
402
|
+
image: 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
|
|
403
|
+
amount: '190690478063438272',
|
|
404
|
+
symbol: 'ETH',
|
|
405
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
406
|
+
decimals: '18',
|
|
407
|
+
},
|
|
408
|
+
stake_out: {
|
|
409
|
+
usd: '2226.49',
|
|
410
|
+
name: 'Rocket Pool ETH',
|
|
411
|
+
image: 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',
|
|
412
|
+
amount: '175024360778165879',
|
|
413
|
+
symbol: 'RETH',
|
|
414
|
+
address: '0xae78736Cd615f374D3085123A210448E74Fc6393',
|
|
415
|
+
decimals: '18',
|
|
416
|
+
},
|
|
417
|
+
network_fee: {
|
|
418
|
+
gas_price: '36000000000',
|
|
419
|
+
native_token_price_in_usd: '2031.86',
|
|
420
|
+
},
|
|
398
421
|
},
|
|
422
|
+
tx_hash: '0xcfc0693bf47995907b0f46ef0644cf16dd9a0de797099b2e00fd481e1b2117d3',
|
|
399
423
|
},
|
|
400
|
-
id: 'c2a2f225-b2fb-5d6c-ba56-e27a5c71ffb9',
|
|
401
|
-
trigger_id: '5110ff97-acff-40c0-83b4-11d487b8c7b0',
|
|
402
|
-
tx_hash: '0xcfc0693bf47995907b0f46ef0644cf16dd9a0de797099b2e00fd481e1b2117d3',
|
|
403
|
-
unread: true,
|
|
404
424
|
};
|
|
405
425
|
return mockNotification;
|
|
406
426
|
}
|
|
@@ -413,40 +433,42 @@ exports.createMockNotificationRocketPoolStakeCompleted = createMockNotificationR
|
|
|
413
433
|
function createMockNotificationRocketPoolUnStakeCompleted() {
|
|
414
434
|
const mockNotification = {
|
|
415
435
|
type: notification_schema_1.TRIGGER_TYPES.ROCKETPOOL_UNSTAKE_COMPLETED,
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
chain_id: 1,
|
|
436
|
+
notification_type: 'on-chain',
|
|
437
|
+
id: '291ec897-f569-4837-b6c0-21001b198dff',
|
|
419
438
|
created_at: '2023-10-19T13:11:10.623042Z',
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
439
|
+
unread: true,
|
|
440
|
+
payload: {
|
|
441
|
+
block_number: 18384336,
|
|
442
|
+
block_timestamp: '1697718011',
|
|
443
|
+
chain_id: 1,
|
|
444
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
445
|
+
data: {
|
|
446
|
+
kind: 'rocketpool_unstake_completed',
|
|
447
|
+
stake_in: {
|
|
448
|
+
usd: '1686.34',
|
|
449
|
+
image: 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg',
|
|
450
|
+
amount: '66608041413696770',
|
|
451
|
+
symbol: 'RETH',
|
|
452
|
+
address: '0xae78736Cd615f374D3085123A210448E74Fc6393',
|
|
453
|
+
decimals: '18',
|
|
454
|
+
name: 'Rocketpool Eth',
|
|
455
|
+
},
|
|
456
|
+
stake_out: {
|
|
457
|
+
usd: '1553.75',
|
|
458
|
+
image: 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
|
|
459
|
+
amount: '72387843427700824',
|
|
460
|
+
symbol: 'ETH',
|
|
461
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
462
|
+
decimals: '18',
|
|
463
|
+
name: 'Ethereum',
|
|
464
|
+
},
|
|
465
|
+
network_fee: {
|
|
466
|
+
gas_price: '5656322987',
|
|
467
|
+
native_token_price_in_usd: '1553.75',
|
|
468
|
+
},
|
|
444
469
|
},
|
|
470
|
+
tx_hash: '0xc7972a7e409abfc62590ec90e633acd70b9b74e76ad02305be8bf133a0e22d5f',
|
|
445
471
|
},
|
|
446
|
-
id: '291ec897-f569-4837-b6c0-21001b198dff',
|
|
447
|
-
trigger_id: '291ec897-f569-4837-b6c0-21001b198dff',
|
|
448
|
-
tx_hash: '0xc7972a7e409abfc62590ec90e633acd70b9b74e76ad02305be8bf133a0e22d5f',
|
|
449
|
-
unread: true,
|
|
450
472
|
};
|
|
451
473
|
return mockNotification;
|
|
452
474
|
}
|
|
@@ -459,40 +481,42 @@ exports.createMockNotificationRocketPoolUnStakeCompleted = createMockNotificatio
|
|
|
459
481
|
function createMockNotificationLidoStakeCompleted() {
|
|
460
482
|
const mockNotification = {
|
|
461
483
|
type: notification_schema_1.TRIGGER_TYPES.LIDO_STAKE_COMPLETED,
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
chain_id: 1,
|
|
484
|
+
notification_type: 'on-chain',
|
|
485
|
+
id: 'ec10d66a-f78f-461f-83c9-609aada8cc50',
|
|
465
486
|
created_at: '2023-11-02T22:28:49.970865Z',
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
487
|
+
unread: true,
|
|
488
|
+
payload: {
|
|
489
|
+
block_number: 18487118,
|
|
490
|
+
block_timestamp: '1698961091',
|
|
491
|
+
chain_id: 1,
|
|
492
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
493
|
+
data: {
|
|
494
|
+
kind: 'lido_stake_completed',
|
|
495
|
+
stake_in: {
|
|
496
|
+
usd: '1806.33',
|
|
497
|
+
name: 'Ethereum',
|
|
498
|
+
image: 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
|
|
499
|
+
amount: '330303634023928032',
|
|
500
|
+
symbol: 'ETH',
|
|
501
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
502
|
+
decimals: '18',
|
|
503
|
+
},
|
|
504
|
+
stake_out: {
|
|
505
|
+
usd: '1801.30',
|
|
506
|
+
name: 'Liquid staked Ether 2.0',
|
|
507
|
+
image: 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',
|
|
508
|
+
amount: '330303634023928032',
|
|
509
|
+
symbol: 'STETH',
|
|
510
|
+
address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',
|
|
511
|
+
decimals: '18',
|
|
512
|
+
},
|
|
513
|
+
network_fee: {
|
|
514
|
+
gas_price: '26536359866',
|
|
515
|
+
native_token_price_in_usd: '1806.33',
|
|
516
|
+
},
|
|
490
517
|
},
|
|
518
|
+
tx_hash: '0x8cc0fa805f7c3b1743b14f3b91c6b824113b094f26d4ccaf6a71ad8547ce6a0f',
|
|
491
519
|
},
|
|
492
|
-
id: 'ec10d66a-f78f-461f-83c9-609aada8cc50',
|
|
493
|
-
trigger_id: 'ec10d66a-f78f-461f-83c9-609aada8cc50',
|
|
494
|
-
tx_hash: '0x8cc0fa805f7c3b1743b14f3b91c6b824113b094f26d4ccaf6a71ad8547ce6a0f',
|
|
495
|
-
unread: true,
|
|
496
520
|
};
|
|
497
521
|
return mockNotification;
|
|
498
522
|
}
|
|
@@ -505,40 +529,42 @@ exports.createMockNotificationLidoStakeCompleted = createMockNotificationLidoSta
|
|
|
505
529
|
function createMockNotificationLidoWithdrawalRequested() {
|
|
506
530
|
const mockNotification = {
|
|
507
531
|
type: notification_schema_1.TRIGGER_TYPES.LIDO_WITHDRAWAL_REQUESTED,
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
chain_id: 1,
|
|
532
|
+
notification_type: 'on-chain',
|
|
533
|
+
id: 'ef003925-3379-4ba7-9e2d-8218690cadc9',
|
|
511
534
|
created_at: '2023-10-18T15:04:02.482526Z',
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
535
|
+
unread: true,
|
|
536
|
+
payload: {
|
|
537
|
+
block_number: 18377760,
|
|
538
|
+
block_timestamp: '1697638415',
|
|
539
|
+
chain_id: 1,
|
|
540
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
541
|
+
data: {
|
|
542
|
+
kind: 'lido_withdrawal_requested',
|
|
543
|
+
stake_in: {
|
|
544
|
+
usd: '1568.54',
|
|
545
|
+
image: 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',
|
|
546
|
+
amount: '97180668792218669859',
|
|
547
|
+
symbol: 'STETH',
|
|
548
|
+
address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',
|
|
549
|
+
decimals: '18',
|
|
550
|
+
name: 'Staked Eth',
|
|
551
|
+
},
|
|
552
|
+
stake_out: {
|
|
553
|
+
usd: '1576.73',
|
|
554
|
+
image: 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
|
|
555
|
+
amount: '97180668792218669859',
|
|
556
|
+
symbol: 'ETH',
|
|
557
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
558
|
+
decimals: '18',
|
|
559
|
+
name: 'Ethereum',
|
|
560
|
+
},
|
|
561
|
+
network_fee: {
|
|
562
|
+
gas_price: '11658906980',
|
|
563
|
+
native_token_price_in_usd: '1576.73',
|
|
564
|
+
},
|
|
536
565
|
},
|
|
566
|
+
tx_hash: '0x58b5f82e084cb750ea174e02b20fbdfd2ba8d78053deac787f34fc38e5d427aa',
|
|
537
567
|
},
|
|
538
|
-
id: 'ef003925-3379-4ba7-9e2d-8218690cadc9',
|
|
539
|
-
trigger_id: 'ef003925-3379-4ba7-9e2d-8218690cadc9',
|
|
540
|
-
tx_hash: '0x58b5f82e084cb750ea174e02b20fbdfd2ba8d78053deac787f34fc38e5d427aa',
|
|
541
|
-
unread: true,
|
|
542
568
|
};
|
|
543
569
|
return mockNotification;
|
|
544
570
|
}
|
|
@@ -551,40 +577,42 @@ exports.createMockNotificationLidoWithdrawalRequested = createMockNotificationLi
|
|
|
551
577
|
function createMockNotificationLidoWithdrawalCompleted() {
|
|
552
578
|
const mockNotification = {
|
|
553
579
|
type: notification_schema_1.TRIGGER_TYPES.LIDO_WITHDRAWAL_COMPLETED,
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
chain_id: 1,
|
|
580
|
+
notification_type: 'on-chain',
|
|
581
|
+
id: 'd73df14d-ce73-4f38-bad3-ab028154042f',
|
|
557
582
|
created_at: '2023-10-18T16:35:03.147606Z',
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
583
|
+
unread: true,
|
|
584
|
+
payload: {
|
|
585
|
+
block_number: 18378208,
|
|
586
|
+
block_timestamp: '1697643851',
|
|
587
|
+
chain_id: 1,
|
|
588
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
589
|
+
data: {
|
|
590
|
+
kind: 'lido_withdrawal_completed',
|
|
591
|
+
stake_in: {
|
|
592
|
+
usd: '1570.23',
|
|
593
|
+
image: 'https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg',
|
|
594
|
+
amount: '35081997661451346',
|
|
595
|
+
symbol: 'STETH',
|
|
596
|
+
address: '0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84',
|
|
597
|
+
decimals: '18',
|
|
598
|
+
name: 'Staked Eth',
|
|
599
|
+
},
|
|
600
|
+
stake_out: {
|
|
601
|
+
usd: '1571.74',
|
|
602
|
+
image: 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
|
|
603
|
+
amount: '35081997661451346',
|
|
604
|
+
symbol: 'ETH',
|
|
605
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
606
|
+
decimals: '18',
|
|
607
|
+
name: 'Ethereum',
|
|
608
|
+
},
|
|
609
|
+
network_fee: {
|
|
610
|
+
gas_price: '12699495150',
|
|
611
|
+
native_token_price_in_usd: '1571.74',
|
|
612
|
+
},
|
|
582
613
|
},
|
|
614
|
+
tx_hash: '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',
|
|
583
615
|
},
|
|
584
|
-
id: 'd73df14d-ce73-4f38-bad3-ab028154042f',
|
|
585
|
-
trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042f',
|
|
586
|
-
tx_hash: '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',
|
|
587
|
-
unread: true,
|
|
588
616
|
};
|
|
589
617
|
return mockNotification;
|
|
590
618
|
}
|
|
@@ -597,189 +625,59 @@ exports.createMockNotificationLidoWithdrawalCompleted = createMockNotificationLi
|
|
|
597
625
|
function createMockNotificationLidoReadyToBeWithdrawn() {
|
|
598
626
|
const mockNotification = {
|
|
599
627
|
type: notification_schema_1.TRIGGER_TYPES.LIDO_STAKE_READY_TO_BE_WITHDRAWN,
|
|
600
|
-
|
|
601
|
-
block_timestamp: '1697643851',
|
|
602
|
-
chain_id: 1,
|
|
603
|
-
created_at: '2023-10-18T16:35:03.147606Z',
|
|
604
|
-
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
605
|
-
data: {
|
|
606
|
-
kind: 'lido_stake_ready_to_be_withdrawn',
|
|
607
|
-
request_id: '123456789',
|
|
608
|
-
staked_eth: {
|
|
609
|
-
address: '0x881D40237659C251811CEC9c364ef91dC08D300F',
|
|
610
|
-
symbol: 'ETH',
|
|
611
|
-
name: 'Ethereum',
|
|
612
|
-
amount: '2.5',
|
|
613
|
-
decimals: '18',
|
|
614
|
-
image: 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
|
|
615
|
-
usd: '10000.00',
|
|
616
|
-
},
|
|
617
|
-
},
|
|
628
|
+
notification_type: 'on-chain',
|
|
618
629
|
id: 'd73df14d-ce73-4f38-bad3-ab028154042e',
|
|
619
|
-
trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042e',
|
|
620
|
-
tx_hash: '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',
|
|
621
|
-
unread: true,
|
|
622
|
-
};
|
|
623
|
-
return mockNotification;
|
|
624
|
-
}
|
|
625
|
-
exports.createMockNotificationLidoReadyToBeWithdrawn = createMockNotificationLidoReadyToBeWithdrawn;
|
|
626
|
-
/**
|
|
627
|
-
* Mocking Utility - create a mock Aave V3 Health Factor notification
|
|
628
|
-
*
|
|
629
|
-
* @returns Mock raw Aave V3 Health Factor notification
|
|
630
|
-
*/
|
|
631
|
-
function createMockNotificationAaveV3HealthFactor() {
|
|
632
|
-
const mockNotification = {
|
|
633
|
-
type: notification_schema_1.TRIGGER_TYPES.AAVE_V3_HEALTH_FACTOR,
|
|
634
|
-
chain_id: 1,
|
|
635
|
-
created_at: '2023-10-18T16:35:03.147606Z',
|
|
636
|
-
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
637
|
-
data: {
|
|
638
|
-
kind: 'aave_v3_health_factor',
|
|
639
|
-
chainId: 1,
|
|
640
|
-
healthFactor: '3.4',
|
|
641
|
-
threshold: '5.5',
|
|
642
|
-
},
|
|
643
|
-
id: 'd73df14d-ce73-4f38-bad3-ab028154042b',
|
|
644
|
-
trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042b',
|
|
645
|
-
unread: true,
|
|
646
|
-
};
|
|
647
|
-
return mockNotification;
|
|
648
|
-
}
|
|
649
|
-
exports.createMockNotificationAaveV3HealthFactor = createMockNotificationAaveV3HealthFactor;
|
|
650
|
-
/**
|
|
651
|
-
* Mocking Utility - create a mock ENS Expiration notification
|
|
652
|
-
*
|
|
653
|
-
* @returns Mock raw ENS Expiration notification
|
|
654
|
-
*/
|
|
655
|
-
function createMockNotificationEnsExpiration() {
|
|
656
|
-
const mockNotification = {
|
|
657
|
-
type: notification_schema_1.TRIGGER_TYPES.ENS_EXPIRATION,
|
|
658
|
-
chain_id: 1,
|
|
659
630
|
created_at: '2023-10-18T16:35:03.147606Z',
|
|
660
|
-
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
661
|
-
data: {
|
|
662
|
-
kind: 'ens_expiration',
|
|
663
|
-
chainId: 1,
|
|
664
|
-
reverseEnsName: 'vitalik.eth',
|
|
665
|
-
expirationDateIso: '2024-01-01T00:00:00Z',
|
|
666
|
-
reminderDelayInSeconds: 86400,
|
|
667
|
-
},
|
|
668
|
-
id: 'f4ef0b7f-5612-537f-9144-0b5c63ae5391',
|
|
669
|
-
trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042c',
|
|
670
631
|
unread: true,
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
const mockNotification = {
|
|
682
|
-
type: notification_schema_1.TRIGGER_TYPES.LIDO_STAKING_REWARDS,
|
|
683
|
-
chain_id: 1,
|
|
684
|
-
created_at: '2023-10-18T16:35:03.147606Z',
|
|
685
|
-
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
686
|
-
data: {
|
|
687
|
-
kind: 'lido_staking_rewards',
|
|
688
|
-
chainId: 1,
|
|
689
|
-
currentStethBalance: '10',
|
|
690
|
-
currentEthValue: '10.5',
|
|
691
|
-
estimatedTotalRewardInPeriod: '0.5',
|
|
692
|
-
daysSinceLastNotification: 30,
|
|
693
|
-
notificationIntervalDays: 30,
|
|
694
|
-
},
|
|
695
|
-
id: 'd73df14d-ce73-4f38-bad3-ab028154042l',
|
|
696
|
-
trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042l',
|
|
697
|
-
unread: true,
|
|
698
|
-
};
|
|
699
|
-
return mockNotification;
|
|
700
|
-
}
|
|
701
|
-
exports.createMockNotificationLidoStakingRewards = createMockNotificationLidoStakingRewards;
|
|
702
|
-
/**
|
|
703
|
-
* Mocking Utility - create a mock Notional Loan Expiration notification
|
|
704
|
-
*
|
|
705
|
-
* @returns Mock raw Notional Loan Expiration notification
|
|
706
|
-
*/
|
|
707
|
-
function createMockNotificationNotionalLoanExpiration() {
|
|
708
|
-
const mockNotification = {
|
|
709
|
-
type: notification_schema_1.TRIGGER_TYPES.NOTIONAL_LOAN_EXPIRATION,
|
|
710
|
-
chain_id: 1,
|
|
711
|
-
created_at: '2023-10-18T16:35:03.147606Z',
|
|
712
|
-
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
713
|
-
data: {
|
|
714
|
-
kind: 'notional_loan_expiration',
|
|
715
|
-
chainId: 1,
|
|
716
|
-
loans: [
|
|
717
|
-
{
|
|
718
|
-
amount: '1.1234',
|
|
632
|
+
payload: {
|
|
633
|
+
block_number: 18378208,
|
|
634
|
+
block_timestamp: '1697643851',
|
|
635
|
+
chain_id: 1,
|
|
636
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
637
|
+
data: {
|
|
638
|
+
kind: 'lido_stake_ready_to_be_withdrawn',
|
|
639
|
+
request_id: '123456789',
|
|
640
|
+
staked_eth: {
|
|
641
|
+
address: '0x881D40237659C251811CEC9c364ef91dC08D300F',
|
|
719
642
|
symbol: 'ETH',
|
|
720
|
-
|
|
643
|
+
name: 'Ethereum',
|
|
644
|
+
amount: '2.5',
|
|
645
|
+
decimals: '18',
|
|
646
|
+
image: 'https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg',
|
|
647
|
+
usd: '10000.00',
|
|
721
648
|
},
|
|
722
|
-
|
|
723
|
-
|
|
649
|
+
},
|
|
650
|
+
tx_hash: '0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657',
|
|
724
651
|
},
|
|
725
|
-
id: 'd73df14d-ce73-4f38-bad3-ab028154042n',
|
|
726
|
-
trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042n',
|
|
727
|
-
unread: true,
|
|
728
652
|
};
|
|
729
653
|
return mockNotification;
|
|
730
654
|
}
|
|
731
|
-
exports.
|
|
655
|
+
exports.createMockNotificationLidoReadyToBeWithdrawn = createMockNotificationLidoReadyToBeWithdrawn;
|
|
732
656
|
/**
|
|
733
|
-
* Mocking Utility - create a mock
|
|
657
|
+
* Mocking Utility - create a mock Generic Platform notification
|
|
734
658
|
*
|
|
735
|
-
* @returns Mock raw
|
|
659
|
+
* @returns Mock raw Generic Platform notification
|
|
736
660
|
*/
|
|
737
|
-
function
|
|
661
|
+
function createMockPlatformNotification() {
|
|
738
662
|
const mockNotification = {
|
|
739
|
-
type: notification_schema_1.TRIGGER_TYPES.
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
743
|
-
data: {
|
|
744
|
-
kind: 'rocketpool_staking_rewards',
|
|
745
|
-
chainId: 1,
|
|
746
|
-
currentRethBalance: '10',
|
|
747
|
-
currentEthValue: '10.5',
|
|
748
|
-
estimatedTotalRewardInPeriod: '0.5',
|
|
749
|
-
daysSinceLastNotification: 30,
|
|
750
|
-
notificationIntervalDays: 30,
|
|
751
|
-
},
|
|
752
|
-
id: 'd73df14d-ce73-4f38-bad3-ab028154042r',
|
|
753
|
-
trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042r',
|
|
663
|
+
type: notification_schema_1.TRIGGER_TYPES.PLATFORM,
|
|
664
|
+
notification_type: 'platform',
|
|
665
|
+
id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',
|
|
754
666
|
unread: true,
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
function createMockNotificationSparkFiHealthFactor() {
|
|
765
|
-
const mockNotification = {
|
|
766
|
-
type: notification_schema_1.TRIGGER_TYPES.SPARK_FI_HEALTH_FACTOR,
|
|
767
|
-
chain_id: 1,
|
|
768
|
-
created_at: '2023-10-18T16:35:03.147606Z',
|
|
769
|
-
address: '0x881D40237659C251811CEC9c364ef91dC08D300C',
|
|
770
|
-
data: {
|
|
771
|
-
kind: 'spark_fi_health_factor',
|
|
772
|
-
chainId: 1,
|
|
773
|
-
healthFactor: '3.4',
|
|
774
|
-
threshold: '5.5',
|
|
667
|
+
created_at: '2025-10-09T09:45:34.202Z',
|
|
668
|
+
template: {
|
|
669
|
+
image_url: 'https://images.ctfassets.net/clixtyxoaeas/4rnpEzy1ATWRKVBOLxZ1Fm/a74dc1eed36d23d7ea6030383a4d5163/MetaMask-icon-fox.svg',
|
|
670
|
+
title: 'This is a Platform Notification!',
|
|
671
|
+
body: 'Teams can now build out their own notifications, and add an optional CTA (like this one below).',
|
|
672
|
+
cta: {
|
|
673
|
+
content: 'Get Started',
|
|
674
|
+
link: 'https://metamask.io/get-started',
|
|
675
|
+
},
|
|
775
676
|
},
|
|
776
|
-
id: 'd73df14d-ce73-4f38-bad3-ab028154042s',
|
|
777
|
-
trigger_id: 'd73df14d-ce73-4f38-bad3-ab028154042s',
|
|
778
|
-
unread: true,
|
|
779
677
|
};
|
|
780
678
|
return mockNotification;
|
|
781
679
|
}
|
|
782
|
-
exports.
|
|
680
|
+
exports.createMockPlatformNotification = createMockPlatformNotification;
|
|
783
681
|
/**
|
|
784
682
|
* Mocking Utility - creates an array of raw on-chain notifications
|
|
785
683
|
*
|