@metamask-previews/notification-services-controller 0.1.0-preview-509f7952 → 0.1.0-preview-caf274f8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NotificationServicesController/NotificationServicesController.js +3 -3
- package/dist/NotificationServicesController/NotificationServicesController.mjs +2 -2
- package/dist/NotificationServicesController/constants/constants.js +1 -1
- package/dist/NotificationServicesController/constants/constants.mjs +1 -1
- package/dist/NotificationServicesController/constants/index.js +2 -2
- package/dist/NotificationServicesController/constants/index.mjs +2 -2
- package/dist/NotificationServicesController/constants/notification-schema.js +1 -1
- package/dist/NotificationServicesController/constants/notification-schema.mjs +1 -1
- package/dist/NotificationServicesController/index.js +6 -6
- package/dist/NotificationServicesController/index.mjs +5 -5
- package/dist/NotificationServicesController/processors/index.js +2 -2
- package/dist/NotificationServicesController/processors/index.mjs +2 -2
- package/dist/NotificationServicesController/processors/process-feature-announcement.js +1 -1
- package/dist/NotificationServicesController/processors/process-feature-announcement.mjs +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.js +1 -1
- package/dist/NotificationServicesController/processors/process-notifications.mjs +1 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.js +1 -1
- package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +1 -1
- package/dist/NotificationServicesController/services/feature-announcements.js +1 -1
- package/dist/NotificationServicesController/services/feature-announcements.mjs +1 -1
- package/dist/NotificationServicesController/services/onchain-notifications.js +1 -1
- package/dist/NotificationServicesController/services/onchain-notifications.mjs +1 -1
- package/dist/NotificationServicesController/utils/utils.js +1 -1
- package/dist/NotificationServicesController/utils/utils.mjs +1 -1
- package/dist/NotificationServicesPushController/NotificationServicesPushController.js +9 -9
- package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs +8 -8
- package/dist/NotificationServicesPushController/constants.js +1 -1
- package/dist/NotificationServicesPushController/constants.mjs +1 -1
- package/dist/NotificationServicesPushController/index.js +12 -12
- package/dist/NotificationServicesPushController/index.mjs +11 -11
- package/dist/NotificationServicesPushController/services/endpoints.js +1 -1
- package/dist/NotificationServicesPushController/services/endpoints.mjs +1 -1
- package/dist/NotificationServicesPushController/services/push/push-web.js +7 -7
- package/dist/NotificationServicesPushController/services/push/push-web.mjs +6 -6
- package/dist/NotificationServicesPushController/services/services.js +8 -8
- package/dist/NotificationServicesPushController/services/services.mjs +7 -7
- package/dist/NotificationServicesPushController/utils/get-notification-data.js +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-data.mjs +1 -1
- package/dist/NotificationServicesPushController/utils/get-notification-message.js +7 -7
- package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +6 -6
- package/dist/NotificationServicesPushController/utils/index.js +8 -8
- package/dist/NotificationServicesPushController/utils/index.mjs +7 -7
- package/dist/{chunk-QTK2RMF7.mjs → chunk-57S5B7X2.mjs} +2 -2
- package/dist/{chunk-UPVIT75F.js → chunk-6265FKB5.js} +3 -3
- package/dist/{chunk-O22GVG7K.js → chunk-6GPIA5G3.js} +35 -35
- package/dist/{chunk-PGMXFZ6Y.js → chunk-ABFHAGGB.js} +3 -3
- package/dist/{chunk-SSWX2N73.mjs → chunk-AHEMTJDE.mjs} +2 -2
- package/dist/{chunk-5DA74RWP.mjs → chunk-CQI6FYPZ.mjs} +2 -2
- package/dist/{chunk-JLHFZ2UG.mjs → chunk-DBTJ34DS.mjs} +3 -3
- package/dist/{chunk-YD3VVORT.js → chunk-DOYL2MCR.js} +85 -85
- package/dist/{chunk-ABJDEX2S.js → chunk-H4RSHSWR.js} +3 -3
- package/dist/chunk-IGY2S5BC.js +36 -0
- package/dist/{chunk-CQ6CGSKZ.js → chunk-IK7KP7N3.js} +3 -3
- package/dist/{chunk-FFQNSBPU.js → chunk-KCIC5BWH.js} +7 -7
- package/dist/chunk-NBRY7XVG.mjs +925 -0
- package/dist/chunk-NBRY7XVG.mjs.map +1 -0
- package/dist/{chunk-WTE64QEK.js → chunk-O6RMA2N6.js} +9 -36
- package/dist/chunk-O6RMA2N6.js.map +1 -0
- package/dist/{chunk-YETZSCGK.js → chunk-QJTZL7TJ.js} +4 -4
- package/dist/{chunk-VE4DTN4R.mjs → chunk-QSFGJCPI.mjs} +2 -2
- package/dist/{chunk-QUNLD7F2.mjs → chunk-TI4UC3G3.mjs} +2 -2
- package/dist/{chunk-ATR6FRAX.mjs → chunk-TS2NQOUA.mjs} +6 -33
- package/dist/chunk-TS2NQOUA.mjs.map +1 -0
- package/dist/chunk-U5UIDVOO.mjs +36 -0
- package/dist/chunk-XYIGTTEP.js +925 -0
- package/dist/chunk-XYIGTTEP.js.map +1 -0
- package/dist/{chunk-R6AIAXQV.mjs → chunk-YSNDM6BH.mjs} +2 -2
- package/dist/{chunk-7ET5GUSY.mjs → chunk-ZFNFSLS6.mjs} +4 -4
- package/dist/index.js +12 -12
- package/dist/index.mjs +11 -11
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/NotificationServicesController/__fixtures__/index.d.ts +0 -1
- package/dist/types/NotificationServicesController/__fixtures__/index.d.ts.map +1 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts +0 -1
- package/dist/types/NotificationServicesPushController/__fixtures__/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-26CCETCM.mjs +0 -70
- package/dist/chunk-5I4DIH6O.mjs +0 -4300
- package/dist/chunk-5I4DIH6O.mjs.map +0 -1
- package/dist/chunk-ATR6FRAX.mjs.map +0 -1
- package/dist/chunk-K75FPFTD.js +0 -4300
- package/dist/chunk-K75FPFTD.js.map +0 -1
- package/dist/chunk-V46WVGWN.js +0 -70
- package/dist/chunk-WTE64QEK.js.map +0 -1
- /package/dist/{chunk-QTK2RMF7.mjs.map → chunk-57S5B7X2.mjs.map} +0 -0
- /package/dist/{chunk-UPVIT75F.js.map → chunk-6265FKB5.js.map} +0 -0
- /package/dist/{chunk-O22GVG7K.js.map → chunk-6GPIA5G3.js.map} +0 -0
- /package/dist/{chunk-PGMXFZ6Y.js.map → chunk-ABFHAGGB.js.map} +0 -0
- /package/dist/{chunk-SSWX2N73.mjs.map → chunk-AHEMTJDE.mjs.map} +0 -0
- /package/dist/{chunk-5DA74RWP.mjs.map → chunk-CQI6FYPZ.mjs.map} +0 -0
- /package/dist/{chunk-JLHFZ2UG.mjs.map → chunk-DBTJ34DS.mjs.map} +0 -0
- /package/dist/{chunk-YD3VVORT.js.map → chunk-DOYL2MCR.js.map} +0 -0
- /package/dist/{chunk-ABJDEX2S.js.map → chunk-H4RSHSWR.js.map} +0 -0
- /package/dist/{chunk-V46WVGWN.js.map → chunk-IGY2S5BC.js.map} +0 -0
- /package/dist/{chunk-CQ6CGSKZ.js.map → chunk-IK7KP7N3.js.map} +0 -0
- /package/dist/{chunk-FFQNSBPU.js.map → chunk-KCIC5BWH.js.map} +0 -0
- /package/dist/{chunk-YETZSCGK.js.map → chunk-QJTZL7TJ.js.map} +0 -0
- /package/dist/{chunk-VE4DTN4R.mjs.map → chunk-QSFGJCPI.mjs.map} +0 -0
- /package/dist/{chunk-QUNLD7F2.mjs.map → chunk-TI4UC3G3.mjs.map} +0 -0
- /package/dist/{chunk-26CCETCM.mjs.map → chunk-U5UIDVOO.mjs.map} +0 -0
- /package/dist/{chunk-R6AIAXQV.mjs.map → chunk-YSNDM6BH.mjs.map} +0 -0
- /package/dist/{chunk-7ET5GUSY.mjs.map → chunk-ZFNFSLS6.mjs.map} +0 -0
|
@@ -0,0 +1,925 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk6265FKB5js = require('./chunk-6265FKB5.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk232HZSEVjs = require('./chunk-232HZSEV.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkDOYL2MCRjs = require('./chunk-DOYL2MCR.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkZMNXLHACjs = require('./chunk-ZMNXLHAC.js');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _chunkVOZ7Y2OOjs = require('./chunk-VOZ7Y2OO.js');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var _chunkPIZCE3JDjs = require('./chunk-PIZCE3JD.js');
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
var _chunkIK7KP7N3js = require('./chunk-IK7KP7N3.js');
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
var _chunkTLX5QQK5js = require('./chunk-TLX5QQK5.js');
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
var _chunkIGY2S5BCjs = require('./chunk-IGY2S5BC.js');
|
|
31
|
+
|
|
32
|
+
// src/NotificationServicesController/index.ts
|
|
33
|
+
var NotificationServicesController_exports = {};
|
|
34
|
+
_chunkIGY2S5BCjs.__export.call(void 0, NotificationServicesController_exports, {
|
|
35
|
+
Constants: () => _chunkIK7KP7N3js.constants_exports,
|
|
36
|
+
Controller: () => _chunkDOYL2MCRjs.NotificationServicesController,
|
|
37
|
+
Mocks: () => fixtures_exports,
|
|
38
|
+
Processors: () => _chunk6265FKB5js.processors_exports,
|
|
39
|
+
Types: () => _chunk232HZSEVjs.types_exports,
|
|
40
|
+
defaultState: () => _chunkDOYL2MCRjs.defaultState
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
// src/NotificationServicesController/__fixtures__/index.ts
|
|
44
|
+
var fixtures_exports = {};
|
|
45
|
+
_chunkIGY2S5BCjs.__export.call(void 0, fixtures_exports, {
|
|
46
|
+
CONTENTFUL_RESPONSE: () => CONTENTFUL_RESPONSE,
|
|
47
|
+
MOCK_RAW_ON_CHAIN_NOTIFICATIONS: () => MOCK_RAW_ON_CHAIN_NOTIFICATIONS,
|
|
48
|
+
MOCK_USER_STORAGE_ACCOUNT: () => MOCK_USER_STORAGE_ACCOUNT,
|
|
49
|
+
MOCK_USER_STORAGE_CHAIN: () => MOCK_USER_STORAGE_CHAIN,
|
|
50
|
+
createMockFeatureAnnouncementAPIResult: () => createMockFeatureAnnouncementAPIResult,
|
|
51
|
+
createMockFeatureAnnouncementRaw: () => createMockFeatureAnnouncementRaw,
|
|
52
|
+
createMockFullUserStorage: () => createMockFullUserStorage,
|
|
53
|
+
createMockNotificationERC1155Received: () => createMockNotificationERC1155Received,
|
|
54
|
+
createMockNotificationERC1155Sent: () => createMockNotificationERC1155Sent,
|
|
55
|
+
createMockNotificationERC20Received: () => createMockNotificationERC20Received,
|
|
56
|
+
createMockNotificationERC20Sent: () => createMockNotificationERC20Sent,
|
|
57
|
+
createMockNotificationERC721Received: () => createMockNotificationERC721Received,
|
|
58
|
+
createMockNotificationERC721Sent: () => createMockNotificationERC721Sent,
|
|
59
|
+
createMockNotificationEthReceived: () => createMockNotificationEthReceived,
|
|
60
|
+
createMockNotificationEthSent: () => createMockNotificationEthSent,
|
|
61
|
+
createMockNotificationLidoReadyToBeWithdrawn: () => createMockNotificationLidoReadyToBeWithdrawn,
|
|
62
|
+
createMockNotificationLidoStakeCompleted: () => createMockNotificationLidoStakeCompleted,
|
|
63
|
+
createMockNotificationLidoWithdrawalCompleted: () => createMockNotificationLidoWithdrawalCompleted,
|
|
64
|
+
createMockNotificationLidoWithdrawalRequested: () => createMockNotificationLidoWithdrawalRequested,
|
|
65
|
+
createMockNotificationMetaMaskSwapsCompleted: () => createMockNotificationMetaMaskSwapsCompleted,
|
|
66
|
+
createMockNotificationRocketPoolStakeCompleted: () => createMockNotificationRocketPoolStakeCompleted,
|
|
67
|
+
createMockNotificationRocketPoolUnStakeCompleted: () => createMockNotificationRocketPoolUnStakeCompleted,
|
|
68
|
+
createMockNotificationTrigger: () => createMockNotificationTrigger,
|
|
69
|
+
createMockRawOnChainNotifications: () => createMockRawOnChainNotifications,
|
|
70
|
+
createMockUserStorage: () => createMockUserStorage,
|
|
71
|
+
createMockUserStorageWithTriggers: () => createMockUserStorageWithTriggers,
|
|
72
|
+
getMockBatchCreateTriggersResponse: () => getMockBatchCreateTriggersResponse,
|
|
73
|
+
getMockBatchDeleteTriggersResponse: () => getMockBatchDeleteTriggersResponse,
|
|
74
|
+
getMockFeatureAnnouncementResponse: () => getMockFeatureAnnouncementResponse,
|
|
75
|
+
getMockListNotificationsResponse: () => getMockListNotificationsResponse,
|
|
76
|
+
getMockMarkNotificationsAsReadResponse: () => getMockMarkNotificationsAsReadResponse
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// src/NotificationServicesController/__fixtures__/mock-feature-announcements.ts
|
|
80
|
+
function createMockFeatureAnnouncementAPIResult() {
|
|
81
|
+
return {
|
|
82
|
+
sys: {
|
|
83
|
+
type: "Array"
|
|
84
|
+
},
|
|
85
|
+
total: 17,
|
|
86
|
+
skip: 0,
|
|
87
|
+
limit: 1,
|
|
88
|
+
items: [
|
|
89
|
+
{
|
|
90
|
+
metadata: {
|
|
91
|
+
tags: []
|
|
92
|
+
},
|
|
93
|
+
sys: {
|
|
94
|
+
space: {
|
|
95
|
+
sys: {
|
|
96
|
+
type: "Link",
|
|
97
|
+
linkType: "Space",
|
|
98
|
+
id: "jdkgyfmyd9sw"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
id: "1ABRmHaNCgmxROKXXLXsMu",
|
|
102
|
+
type: "Entry",
|
|
103
|
+
createdAt: "2024-04-09T13:24:01.872Z",
|
|
104
|
+
updatedAt: "2024-04-09T13:24:01.872Z",
|
|
105
|
+
environment: {
|
|
106
|
+
sys: {
|
|
107
|
+
id: "master",
|
|
108
|
+
type: "Link",
|
|
109
|
+
linkType: "Environment"
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
revision: 1,
|
|
113
|
+
contentType: {
|
|
114
|
+
sys: {
|
|
115
|
+
type: "Link",
|
|
116
|
+
linkType: "ContentType",
|
|
117
|
+
id: "productAnnouncement"
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
locale: "en-US"
|
|
121
|
+
},
|
|
122
|
+
fields: {
|
|
123
|
+
title: "Don\u2019t miss out on airdrops and new NFT mints!",
|
|
124
|
+
id: "dont-miss-out-on-airdrops-and-new-nft-mints",
|
|
125
|
+
category: "ANNOUNCEMENT",
|
|
126
|
+
shortDescription: "Check your airdrop eligibility and see trending NFT drops. Head over to the Explore tab to get started. ",
|
|
127
|
+
image: {
|
|
128
|
+
sys: {
|
|
129
|
+
type: "Link",
|
|
130
|
+
linkType: "Asset",
|
|
131
|
+
id: "5jqq8sFeLc6XEoeWlpI3aB"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
longDescription: {
|
|
135
|
+
data: {},
|
|
136
|
+
content: [
|
|
137
|
+
{
|
|
138
|
+
data: {},
|
|
139
|
+
content: [
|
|
140
|
+
{
|
|
141
|
+
data: {},
|
|
142
|
+
marks: [],
|
|
143
|
+
value: "You can now verify if any of your connected addresses are eligible for airdrops and other ERC-20 claims in a secure and convenient way. We\u2019ve also added trending NFT mints based on creators you\u2019ve minted from before or other tokens you hold. Head over to the Explore tab to get started. \n",
|
|
144
|
+
nodeType: "text"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
nodeType: "paragraph"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
nodeType: "document"
|
|
151
|
+
},
|
|
152
|
+
link: {
|
|
153
|
+
sys: {
|
|
154
|
+
type: "Link",
|
|
155
|
+
linkType: "Entry",
|
|
156
|
+
id: "62xKYM2ydo4F1mS5q97K5q"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
includes: {
|
|
163
|
+
Entry: [
|
|
164
|
+
{
|
|
165
|
+
metadata: {
|
|
166
|
+
tags: []
|
|
167
|
+
},
|
|
168
|
+
sys: {
|
|
169
|
+
space: {
|
|
170
|
+
sys: {
|
|
171
|
+
type: "Link",
|
|
172
|
+
linkType: "Space",
|
|
173
|
+
id: "jdkgyfmyd9sw"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
id: "62xKYM2ydo4F1mS5q97K5q",
|
|
177
|
+
type: "Entry",
|
|
178
|
+
createdAt: "2024-04-09T13:23:03.636Z",
|
|
179
|
+
updatedAt: "2024-04-09T13:23:03.636Z",
|
|
180
|
+
environment: {
|
|
181
|
+
sys: {
|
|
182
|
+
id: "master",
|
|
183
|
+
type: "Link",
|
|
184
|
+
linkType: "Environment"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
revision: 1,
|
|
188
|
+
contentType: {
|
|
189
|
+
sys: {
|
|
190
|
+
type: "Link",
|
|
191
|
+
linkType: "ContentType",
|
|
192
|
+
id: "link"
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
locale: "en-US"
|
|
196
|
+
},
|
|
197
|
+
fields: {
|
|
198
|
+
extensionLinkText: "Try now",
|
|
199
|
+
extensionLinkRoute: "home.html"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
Asset: [
|
|
204
|
+
{
|
|
205
|
+
metadata: {
|
|
206
|
+
tags: []
|
|
207
|
+
},
|
|
208
|
+
sys: {
|
|
209
|
+
space: {
|
|
210
|
+
sys: {
|
|
211
|
+
type: "Link",
|
|
212
|
+
linkType: "Space",
|
|
213
|
+
id: "jdkgyfmyd9sw"
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
id: "5jqq8sFeLc6XEoeWlpI3aB",
|
|
217
|
+
type: "Asset",
|
|
218
|
+
createdAt: "2024-04-09T13:23:13.327Z",
|
|
219
|
+
updatedAt: "2024-04-09T13:23:13.327Z",
|
|
220
|
+
environment: {
|
|
221
|
+
sys: {
|
|
222
|
+
id: "master",
|
|
223
|
+
type: "Link",
|
|
224
|
+
linkType: "Environment"
|
|
225
|
+
}
|
|
226
|
+
},
|
|
227
|
+
revision: 1,
|
|
228
|
+
locale: "en-US"
|
|
229
|
+
},
|
|
230
|
+
fields: {
|
|
231
|
+
title: "PDAPP notification image Airdrops & NFT mints",
|
|
232
|
+
description: "",
|
|
233
|
+
file: {
|
|
234
|
+
url: "//images.ctfassets.net/jdkgyfmyd9sw/5jqq8sFeLc6XEoeWlpI3aB/73ee0f1afa9916c3a7538b0bbee09c26/PDAPP_notification_image_Airdrops___NFT_mints.png",
|
|
235
|
+
details: {
|
|
236
|
+
size: 797731,
|
|
237
|
+
image: {
|
|
238
|
+
width: 2880,
|
|
239
|
+
height: 1921
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
fileName: "PDAPP notification image_Airdrops & NFT mints.png",
|
|
243
|
+
contentType: "image/png"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
function createMockFeatureAnnouncementRaw() {
|
|
252
|
+
return {
|
|
253
|
+
type: "features_announcement" /* FEATURES_ANNOUNCEMENT */,
|
|
254
|
+
createdAt: "2999-04-09T13:24:01.872Z",
|
|
255
|
+
data: {
|
|
256
|
+
id: "dont-miss-out-on-airdrops-and-new-nft-mints",
|
|
257
|
+
category: "ANNOUNCEMENT",
|
|
258
|
+
title: "Don\u2019t miss out on airdrops and new NFT mints!",
|
|
259
|
+
longDescription: `<p>You can now verify if any of your connected addresses are eligible for airdrops and other ERC-20 claims in a secure and convenient way. We\u2019ve also added trending NFT mints based on creators you\u2019ve minted from before or other tokens you hold. Head over to the Explore tab to get started.</p>`,
|
|
260
|
+
shortDescription: "Check your airdrop eligibility and see trending NFT drops. Head over to the Explore tab to get started.",
|
|
261
|
+
image: {
|
|
262
|
+
title: "PDAPP notification image Airdrops & NFT mints",
|
|
263
|
+
description: "",
|
|
264
|
+
url: "//images.ctfassets.net/jdkgyfmyd9sw/5jqq8sFeLc6XEoeWlpI3aB/73ee0f1afa9916c3a7538b0bbee09c26/PDAPP_notification_image_Airdrops___NFT_mints.png"
|
|
265
|
+
},
|
|
266
|
+
extensionLink: {
|
|
267
|
+
extensionLinkText: "Try now",
|
|
268
|
+
extensionLinkRoute: "home.html"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// src/NotificationServicesController/__fixtures__/mock-notification-trigger.ts
|
|
275
|
+
var _uuid = require('uuid');
|
|
276
|
+
function createMockNotificationTrigger(override) {
|
|
277
|
+
return {
|
|
278
|
+
id: _uuid.v4.call(void 0, ),
|
|
279
|
+
address: "0xFAKE_ADDRESS",
|
|
280
|
+
chainId: "1",
|
|
281
|
+
kind: "eth_sent",
|
|
282
|
+
enabled: true,
|
|
283
|
+
...override
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
// src/NotificationServicesController/__fixtures__/mock-notification-user-storage.ts
|
|
288
|
+
var MOCK_USER_STORAGE_ACCOUNT = "0x0000000000000000000000000000000000000000";
|
|
289
|
+
var MOCK_USER_STORAGE_CHAIN = "1";
|
|
290
|
+
function createMockUserStorage(override) {
|
|
291
|
+
return {
|
|
292
|
+
[_chunkTLX5QQK5js.USER_STORAGE_VERSION_KEY]: "1",
|
|
293
|
+
[MOCK_USER_STORAGE_ACCOUNT]: {
|
|
294
|
+
[MOCK_USER_STORAGE_CHAIN]: {
|
|
295
|
+
"111-111-111-111": {
|
|
296
|
+
k: "erc20_received" /* ERC20_RECEIVED */,
|
|
297
|
+
e: true
|
|
298
|
+
},
|
|
299
|
+
"222-222-222-222": {
|
|
300
|
+
k: "erc20_sent" /* ERC20_SENT */,
|
|
301
|
+
e: true
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
...override
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function createMockUserStorageWithTriggers(triggers) {
|
|
309
|
+
const userStorage = {
|
|
310
|
+
[_chunkTLX5QQK5js.USER_STORAGE_VERSION_KEY]: "1",
|
|
311
|
+
[MOCK_USER_STORAGE_ACCOUNT]: {
|
|
312
|
+
[MOCK_USER_STORAGE_CHAIN]: {}
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
triggers.forEach((t) => {
|
|
316
|
+
let tId;
|
|
317
|
+
let e;
|
|
318
|
+
let k;
|
|
319
|
+
if (typeof t === "string") {
|
|
320
|
+
tId = t;
|
|
321
|
+
e = true;
|
|
322
|
+
k = "erc20_received" /* ERC20_RECEIVED */;
|
|
323
|
+
} else {
|
|
324
|
+
tId = t.id;
|
|
325
|
+
e = t.e;
|
|
326
|
+
k = t.k ?? "erc20_received" /* ERC20_RECEIVED */;
|
|
327
|
+
}
|
|
328
|
+
userStorage[MOCK_USER_STORAGE_ACCOUNT][MOCK_USER_STORAGE_CHAIN][tId] = {
|
|
329
|
+
k,
|
|
330
|
+
e
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
return userStorage;
|
|
334
|
+
}
|
|
335
|
+
function createMockFullUserStorage(props = {}) {
|
|
336
|
+
return _chunkPIZCE3JDjs.initializeUserStorage.call(void 0,
|
|
337
|
+
[{ address: props.address ?? MOCK_USER_STORAGE_ACCOUNT }],
|
|
338
|
+
props.triggersEnabled ?? true
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
// src/NotificationServicesController/__fixtures__/mock-raw-notifications.ts
|
|
343
|
+
function createMockNotificationEthSent() {
|
|
344
|
+
const mockNotification = {
|
|
345
|
+
type: "eth_sent" /* ETH_SENT */,
|
|
346
|
+
id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
347
|
+
trigger_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
348
|
+
chain_id: 1,
|
|
349
|
+
block_number: 17485840,
|
|
350
|
+
block_timestamp: "2022-03-01T00:00:00Z",
|
|
351
|
+
tx_hash: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
352
|
+
unread: true,
|
|
353
|
+
created_at: "2022-03-01T00:00:00Z",
|
|
354
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
355
|
+
data: {
|
|
356
|
+
kind: "eth_sent",
|
|
357
|
+
network_fee: {
|
|
358
|
+
gas_price: "207806259583",
|
|
359
|
+
native_token_price_in_usd: "0.83"
|
|
360
|
+
},
|
|
361
|
+
from: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
362
|
+
to: "0x881D40237659C251811CEC9c364ef91dC08D300D",
|
|
363
|
+
amount: {
|
|
364
|
+
usd: "670.64",
|
|
365
|
+
eth: "0.005"
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
};
|
|
369
|
+
return mockNotification;
|
|
370
|
+
}
|
|
371
|
+
function createMockNotificationEthReceived() {
|
|
372
|
+
const mockNotification = {
|
|
373
|
+
type: "eth_received" /* ETH_RECEIVED */,
|
|
374
|
+
id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
375
|
+
trigger_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
376
|
+
chain_id: 1,
|
|
377
|
+
block_number: 17485840,
|
|
378
|
+
block_timestamp: "2022-03-01T00:00:00Z",
|
|
379
|
+
tx_hash: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
380
|
+
unread: true,
|
|
381
|
+
created_at: "2022-03-01T00:00:00Z",
|
|
382
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
383
|
+
data: {
|
|
384
|
+
kind: "eth_received",
|
|
385
|
+
network_fee: {
|
|
386
|
+
gas_price: "207806259583",
|
|
387
|
+
native_token_price_in_usd: "0.83"
|
|
388
|
+
},
|
|
389
|
+
from: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
390
|
+
to: "0x881D40237659C251811CEC9c364ef91dC08D300D",
|
|
391
|
+
amount: {
|
|
392
|
+
usd: "670.64",
|
|
393
|
+
eth: "808.000000000000000000"
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
return mockNotification;
|
|
398
|
+
}
|
|
399
|
+
function createMockNotificationERC20Sent() {
|
|
400
|
+
const mockNotification = {
|
|
401
|
+
type: "erc20_sent" /* ERC20_SENT */,
|
|
402
|
+
id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
403
|
+
trigger_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
404
|
+
chain_id: 1,
|
|
405
|
+
block_number: 17485840,
|
|
406
|
+
block_timestamp: "2022-03-01T00:00:00Z",
|
|
407
|
+
tx_hash: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
408
|
+
unread: true,
|
|
409
|
+
created_at: "2022-03-01T00:00:00Z",
|
|
410
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
411
|
+
data: {
|
|
412
|
+
kind: "erc20_sent",
|
|
413
|
+
network_fee: {
|
|
414
|
+
gas_price: "207806259583",
|
|
415
|
+
native_token_price_in_usd: "0.83"
|
|
416
|
+
},
|
|
417
|
+
to: "0xecc19e177d24551aa7ed6bc6fe566eca726cc8a9",
|
|
418
|
+
from: "0x1231deb6f5749ef6ce6943a275a1d3e7486f4eae",
|
|
419
|
+
token: {
|
|
420
|
+
usd: "1.00",
|
|
421
|
+
name: "USDC",
|
|
422
|
+
image: "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdc.svg",
|
|
423
|
+
amount: "4956250000",
|
|
424
|
+
symbol: "USDC",
|
|
425
|
+
address: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
|
|
426
|
+
decimals: "6"
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
return mockNotification;
|
|
431
|
+
}
|
|
432
|
+
function createMockNotificationERC20Received() {
|
|
433
|
+
const mockNotification = {
|
|
434
|
+
type: "erc20_received" /* ERC20_RECEIVED */,
|
|
435
|
+
id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
436
|
+
trigger_id: "3fa85f64-5717-4562-b3fc-2c963f66afa6",
|
|
437
|
+
chain_id: 1,
|
|
438
|
+
block_number: 17485840,
|
|
439
|
+
block_timestamp: "2022-03-01T00:00:00Z",
|
|
440
|
+
tx_hash: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
441
|
+
unread: true,
|
|
442
|
+
created_at: "2022-03-01T00:00:00Z",
|
|
443
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
444
|
+
data: {
|
|
445
|
+
kind: "erc20_received",
|
|
446
|
+
network_fee: {
|
|
447
|
+
gas_price: "207806259583",
|
|
448
|
+
native_token_price_in_usd: "0.83"
|
|
449
|
+
},
|
|
450
|
+
to: "0xeae7380dd4cef6fbd1144f49e4d1e6964258a4f4",
|
|
451
|
+
from: "0x51c72848c68a965f66fa7a88855f9f7784502a7f",
|
|
452
|
+
token: {
|
|
453
|
+
usd: "0.00",
|
|
454
|
+
name: "SHIBA INU",
|
|
455
|
+
image: "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/shib.svg",
|
|
456
|
+
amount: "8382798736999999457296646144",
|
|
457
|
+
symbol: "SHIB",
|
|
458
|
+
address: "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce",
|
|
459
|
+
decimals: "18"
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
return mockNotification;
|
|
464
|
+
}
|
|
465
|
+
function createMockNotificationERC721Sent() {
|
|
466
|
+
const mockNotification = {
|
|
467
|
+
type: "erc721_sent" /* ERC721_SENT */,
|
|
468
|
+
block_number: 18576643,
|
|
469
|
+
block_timestamp: "1700043467",
|
|
470
|
+
chain_id: 1,
|
|
471
|
+
created_at: "2023-11-15T11:08:17.895407Z",
|
|
472
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
473
|
+
data: {
|
|
474
|
+
to: "0xf47f628fe3bd2595e9ab384bfffc3859b448e451",
|
|
475
|
+
nft: {
|
|
476
|
+
name: "Captainz #8680",
|
|
477
|
+
image: "https://i.seadn.io/s/raw/files/ae0fc06714ff7fb40217340d8a242c0e.gif?w=500&auto=format",
|
|
478
|
+
token_id: "8680",
|
|
479
|
+
collection: {
|
|
480
|
+
name: "The Captainz",
|
|
481
|
+
image: "https://i.seadn.io/gcs/files/6df4d75778066bce740050615bc84e21.png?w=500&auto=format",
|
|
482
|
+
symbol: "Captainz",
|
|
483
|
+
address: "0x769272677fab02575e84945f03eca517acc544cc"
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
from: "0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f",
|
|
487
|
+
kind: "erc721_sent",
|
|
488
|
+
network_fee: {
|
|
489
|
+
gas_price: "24550653274",
|
|
490
|
+
native_token_price_in_usd: "1986.61"
|
|
491
|
+
}
|
|
492
|
+
},
|
|
493
|
+
id: "a4193058-9814-537e-9df4-79dcac727fb6",
|
|
494
|
+
trigger_id: "028485be-b994-422b-a93b-03fcc01ab715",
|
|
495
|
+
tx_hash: "0x0833c69fb41cf972a0f031fceca242939bc3fcf82b964b74606649abcad371bd",
|
|
496
|
+
unread: true
|
|
497
|
+
};
|
|
498
|
+
return mockNotification;
|
|
499
|
+
}
|
|
500
|
+
function createMockNotificationERC721Received() {
|
|
501
|
+
const mockNotification = {
|
|
502
|
+
type: "erc721_received" /* ERC721_RECEIVED */,
|
|
503
|
+
block_number: 18571446,
|
|
504
|
+
block_timestamp: "1699980623",
|
|
505
|
+
chain_id: 1,
|
|
506
|
+
created_at: "2023-11-14T17:40:52.319281Z",
|
|
507
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
508
|
+
data: {
|
|
509
|
+
to: "0xba7f3daa8adfdad686574406ab9bd5d2f0a49d2e",
|
|
510
|
+
nft: {
|
|
511
|
+
name: "The Plague #2722",
|
|
512
|
+
image: "https://i.seadn.io/s/raw/files/a96f90ec8ebf55a2300c66a0c46d6a16.png?w=500&auto=format",
|
|
513
|
+
token_id: "2722",
|
|
514
|
+
collection: {
|
|
515
|
+
name: "The Plague NFT",
|
|
516
|
+
image: "https://i.seadn.io/gcs/files/4577987a5ca45ca5118b2e31559ee4d1.jpg?w=500&auto=format",
|
|
517
|
+
symbol: "FROG",
|
|
518
|
+
address: "0xc379e535caff250a01caa6c3724ed1359fe5c29b"
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
from: "0x24a0bb54b7e7a8e406e9b28058a9fd6c49e6df4f",
|
|
522
|
+
kind: "erc721_received",
|
|
523
|
+
network_fee: {
|
|
524
|
+
gas_price: "53701898538",
|
|
525
|
+
native_token_price_in_usd: "2047.01"
|
|
526
|
+
}
|
|
527
|
+
},
|
|
528
|
+
id: "00a79d24-befa-57ed-a55a-9eb8696e1654",
|
|
529
|
+
trigger_id: "d24ac26a-8579-49ec-9947-d04d63592ebd",
|
|
530
|
+
tx_hash: "0xe554c9e29e6eeca8ba94da4d047334ba08b8eb9ca3b801dd69cec08dfdd4ae43",
|
|
531
|
+
unread: true
|
|
532
|
+
};
|
|
533
|
+
return mockNotification;
|
|
534
|
+
}
|
|
535
|
+
function createMockNotificationERC1155Sent() {
|
|
536
|
+
const mockNotification = {
|
|
537
|
+
type: "erc1155_sent" /* ERC1155_SENT */,
|
|
538
|
+
block_number: 18615206,
|
|
539
|
+
block_timestamp: "1700510003",
|
|
540
|
+
chain_id: 1,
|
|
541
|
+
created_at: "2023-11-20T20:44:10.110706Z",
|
|
542
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
543
|
+
data: {
|
|
544
|
+
to: "0x15bd77ccacf2da39b84f0c31fee2e451225bb190",
|
|
545
|
+
nft: {
|
|
546
|
+
name: "IlluminatiNFT DAO",
|
|
547
|
+
image: "https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format",
|
|
548
|
+
token_id: "1",
|
|
549
|
+
collection: {
|
|
550
|
+
name: "IlluminatiNFT DAO",
|
|
551
|
+
image: "https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format",
|
|
552
|
+
symbol: "TRUTH",
|
|
553
|
+
address: "0xe25f0fe686477f9df3c2876c4902d3b85f75f33a"
|
|
554
|
+
}
|
|
555
|
+
},
|
|
556
|
+
from: "0x0000000000000000000000000000000000000000",
|
|
557
|
+
kind: "erc1155_sent",
|
|
558
|
+
network_fee: {
|
|
559
|
+
gas_price: "33571446596",
|
|
560
|
+
native_token_price_in_usd: "2038.88"
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
id: "a09ff9d1-623a-52ab-a3d4-c7c8c9a58362",
|
|
564
|
+
trigger_id: "e2130f7d-78b8-4c34-999a-3f3d3bb5b03c",
|
|
565
|
+
tx_hash: "0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f",
|
|
566
|
+
unread: true
|
|
567
|
+
};
|
|
568
|
+
return mockNotification;
|
|
569
|
+
}
|
|
570
|
+
function createMockNotificationERC1155Received() {
|
|
571
|
+
const mockNotification = {
|
|
572
|
+
type: "erc1155_received" /* ERC1155_RECEIVED */,
|
|
573
|
+
block_number: 18615206,
|
|
574
|
+
block_timestamp: "1700510003",
|
|
575
|
+
chain_id: 1,
|
|
576
|
+
created_at: "2023-11-20T20:44:10.110706Z",
|
|
577
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
578
|
+
data: {
|
|
579
|
+
to: "0x15bd77ccacf2da39b84f0c31fee2e451225bb190",
|
|
580
|
+
nft: {
|
|
581
|
+
name: "IlluminatiNFT DAO",
|
|
582
|
+
image: "https://i.seadn.io/gcs/files/79a77cb37c7b2f1069f752645d29fea7.jpg?w=500&auto=format",
|
|
583
|
+
token_id: "1",
|
|
584
|
+
collection: {
|
|
585
|
+
name: "IlluminatiNFT DAO",
|
|
586
|
+
image: "https://i.seadn.io/gae/LTKz3om2eCQfn3M6PkqEmY7KhLtdMCOm0QVch2318KJq7-KyToCH7NBTMo4UuJ0AZI-oaBh1HcgrAEIEWYbXY3uMcYpuGXunaXEh?w=500&auto=format",
|
|
587
|
+
symbol: "TRUTH",
|
|
588
|
+
address: "0xe25f0fe686477f9df3c2876c4902d3b85f75f33a"
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
from: "0x0000000000000000000000000000000000000000",
|
|
592
|
+
kind: "erc1155_received",
|
|
593
|
+
network_fee: {
|
|
594
|
+
gas_price: "33571446596",
|
|
595
|
+
native_token_price_in_usd: "2038.88"
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
id: "b6b93c84-e8dc-54ed-9396-7ea50474843a",
|
|
599
|
+
trigger_id: "710c8abb-43a9-42a5-9d86-9dd258726c82",
|
|
600
|
+
tx_hash: "0x03381aba290facbaf71c123e263c8dc3dd550aac00ef589cce395182eaeff76f",
|
|
601
|
+
unread: true
|
|
602
|
+
};
|
|
603
|
+
return mockNotification;
|
|
604
|
+
}
|
|
605
|
+
function createMockNotificationMetaMaskSwapsCompleted() {
|
|
606
|
+
const mockNotification = {
|
|
607
|
+
type: "metamask_swap_completed" /* METAMASK_SWAP_COMPLETED */,
|
|
608
|
+
block_number: 18377666,
|
|
609
|
+
block_timestamp: "1697637275",
|
|
610
|
+
chain_id: 1,
|
|
611
|
+
created_at: "2023-10-18T13:58:49.854596Z",
|
|
612
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
613
|
+
data: {
|
|
614
|
+
kind: "metamask_swap_completed",
|
|
615
|
+
rate: "1558.27",
|
|
616
|
+
token_in: {
|
|
617
|
+
usd: "1576.73",
|
|
618
|
+
image: "https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg",
|
|
619
|
+
amount: "9000000000000000",
|
|
620
|
+
symbol: "ETH",
|
|
621
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
622
|
+
decimals: "18",
|
|
623
|
+
name: "Ethereum"
|
|
624
|
+
},
|
|
625
|
+
token_out: {
|
|
626
|
+
usd: "1.00",
|
|
627
|
+
image: "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/usdt.svg",
|
|
628
|
+
amount: "14024419",
|
|
629
|
+
symbol: "USDT",
|
|
630
|
+
address: "0xdac17f958d2ee523a2206206994597c13d831ec7",
|
|
631
|
+
decimals: "6",
|
|
632
|
+
name: "USDT"
|
|
633
|
+
},
|
|
634
|
+
network_fee: {
|
|
635
|
+
gas_price: "15406129273",
|
|
636
|
+
native_token_price_in_usd: "1576.73"
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
id: "7ddfe6a1-ac52-5ffe-aa40-f04242db4b8b",
|
|
640
|
+
trigger_id: "d2eaa2eb-2e6e-4fd5-8763-b70ea571b46c",
|
|
641
|
+
tx_hash: "0xf69074290f3aa11bce567aabc9ca0df7a12559dfae1b80ba1a124e9dfe19ecc5",
|
|
642
|
+
unread: true
|
|
643
|
+
};
|
|
644
|
+
return mockNotification;
|
|
645
|
+
}
|
|
646
|
+
function createMockNotificationRocketPoolStakeCompleted() {
|
|
647
|
+
const mockNotification = {
|
|
648
|
+
type: "rocketpool_stake_completed" /* ROCKETPOOL_STAKE_COMPLETED */,
|
|
649
|
+
block_number: 18585057,
|
|
650
|
+
block_timestamp: "1700145059",
|
|
651
|
+
chain_id: 1,
|
|
652
|
+
created_at: "2023-11-20T12:02:48.796824Z",
|
|
653
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
654
|
+
data: {
|
|
655
|
+
kind: "rocketpool_stake_completed",
|
|
656
|
+
stake_in: {
|
|
657
|
+
usd: "2031.86",
|
|
658
|
+
name: "Ethereum",
|
|
659
|
+
image: "https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg",
|
|
660
|
+
amount: "190690478063438272",
|
|
661
|
+
symbol: "ETH",
|
|
662
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
663
|
+
decimals: "18"
|
|
664
|
+
},
|
|
665
|
+
stake_out: {
|
|
666
|
+
usd: "2226.49",
|
|
667
|
+
name: "Rocket Pool ETH",
|
|
668
|
+
image: "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg",
|
|
669
|
+
amount: "175024360778165879",
|
|
670
|
+
symbol: "RETH",
|
|
671
|
+
address: "0xae78736Cd615f374D3085123A210448E74Fc6393",
|
|
672
|
+
decimals: "18"
|
|
673
|
+
},
|
|
674
|
+
network_fee: {
|
|
675
|
+
gas_price: "36000000000",
|
|
676
|
+
native_token_price_in_usd: "2031.86"
|
|
677
|
+
}
|
|
678
|
+
},
|
|
679
|
+
id: "c2a2f225-b2fb-5d6c-ba56-e27a5c71ffb9",
|
|
680
|
+
trigger_id: "5110ff97-acff-40c0-83b4-11d487b8c7b0",
|
|
681
|
+
tx_hash: "0xcfc0693bf47995907b0f46ef0644cf16dd9a0de797099b2e00fd481e1b2117d3",
|
|
682
|
+
unread: true
|
|
683
|
+
};
|
|
684
|
+
return mockNotification;
|
|
685
|
+
}
|
|
686
|
+
function createMockNotificationRocketPoolUnStakeCompleted() {
|
|
687
|
+
const mockNotification = {
|
|
688
|
+
type: "rocketpool_unstake_completed" /* ROCKETPOOL_UNSTAKE_COMPLETED */,
|
|
689
|
+
block_number: 18384336,
|
|
690
|
+
block_timestamp: "1697718011",
|
|
691
|
+
chain_id: 1,
|
|
692
|
+
created_at: "2023-10-19T13:11:10.623042Z",
|
|
693
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
694
|
+
data: {
|
|
695
|
+
kind: "rocketpool_unstake_completed",
|
|
696
|
+
stake_in: {
|
|
697
|
+
usd: "1686.34",
|
|
698
|
+
image: "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/rETH.svg",
|
|
699
|
+
amount: "66608041413696770",
|
|
700
|
+
symbol: "RETH",
|
|
701
|
+
address: "0xae78736Cd615f374D3085123A210448E74Fc6393",
|
|
702
|
+
decimals: "18",
|
|
703
|
+
name: "Rocketpool Eth"
|
|
704
|
+
},
|
|
705
|
+
stake_out: {
|
|
706
|
+
usd: "1553.75",
|
|
707
|
+
image: "https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg",
|
|
708
|
+
amount: "72387843427700824",
|
|
709
|
+
symbol: "ETH",
|
|
710
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
711
|
+
decimals: "18",
|
|
712
|
+
name: "Ethereum"
|
|
713
|
+
},
|
|
714
|
+
network_fee: {
|
|
715
|
+
gas_price: "5656322987",
|
|
716
|
+
native_token_price_in_usd: "1553.75"
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
id: "d8c246e7-a0a4-5f1d-b079-2b1707665fbc",
|
|
720
|
+
trigger_id: "291ec897-f569-4837-b6c0-21001b198dff",
|
|
721
|
+
tx_hash: "0xc7972a7e409abfc62590ec90e633acd70b9b74e76ad02305be8bf133a0e22d5f",
|
|
722
|
+
unread: true
|
|
723
|
+
};
|
|
724
|
+
return mockNotification;
|
|
725
|
+
}
|
|
726
|
+
function createMockNotificationLidoStakeCompleted() {
|
|
727
|
+
const mockNotification = {
|
|
728
|
+
type: "lido_stake_completed" /* LIDO_STAKE_COMPLETED */,
|
|
729
|
+
block_number: 18487118,
|
|
730
|
+
block_timestamp: "1698961091",
|
|
731
|
+
chain_id: 1,
|
|
732
|
+
created_at: "2023-11-02T22:28:49.970865Z",
|
|
733
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
734
|
+
data: {
|
|
735
|
+
kind: "lido_stake_completed",
|
|
736
|
+
stake_in: {
|
|
737
|
+
usd: "1806.33",
|
|
738
|
+
name: "Ethereum",
|
|
739
|
+
image: "https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg",
|
|
740
|
+
amount: "330303634023928032",
|
|
741
|
+
symbol: "ETH",
|
|
742
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
743
|
+
decimals: "18"
|
|
744
|
+
},
|
|
745
|
+
stake_out: {
|
|
746
|
+
usd: "1801.30",
|
|
747
|
+
name: "Liquid staked Ether 2.0",
|
|
748
|
+
image: "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg",
|
|
749
|
+
amount: "330303634023928032",
|
|
750
|
+
symbol: "STETH",
|
|
751
|
+
address: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
|
|
752
|
+
decimals: "18"
|
|
753
|
+
},
|
|
754
|
+
network_fee: {
|
|
755
|
+
gas_price: "26536359866",
|
|
756
|
+
native_token_price_in_usd: "1806.33"
|
|
757
|
+
}
|
|
758
|
+
},
|
|
759
|
+
id: "9d9b1467-b3ee-5492-8ca2-22382657b690",
|
|
760
|
+
trigger_id: "ec10d66a-f78f-461f-83c9-609aada8cc50",
|
|
761
|
+
tx_hash: "0x8cc0fa805f7c3b1743b14f3b91c6b824113b094f26d4ccaf6a71ad8547ce6a0f",
|
|
762
|
+
unread: true
|
|
763
|
+
};
|
|
764
|
+
return mockNotification;
|
|
765
|
+
}
|
|
766
|
+
function createMockNotificationLidoWithdrawalRequested() {
|
|
767
|
+
const mockNotification = {
|
|
768
|
+
type: "lido_withdrawal_requested" /* LIDO_WITHDRAWAL_REQUESTED */,
|
|
769
|
+
block_number: 18377760,
|
|
770
|
+
block_timestamp: "1697638415",
|
|
771
|
+
chain_id: 1,
|
|
772
|
+
created_at: "2023-10-18T15:04:02.482526Z",
|
|
773
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
774
|
+
data: {
|
|
775
|
+
kind: "lido_withdrawal_requested",
|
|
776
|
+
stake_in: {
|
|
777
|
+
usd: "1568.54",
|
|
778
|
+
image: "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg",
|
|
779
|
+
amount: "97180668792218669859",
|
|
780
|
+
symbol: "STETH",
|
|
781
|
+
address: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
|
|
782
|
+
decimals: "18",
|
|
783
|
+
name: "Staked Eth"
|
|
784
|
+
},
|
|
785
|
+
stake_out: {
|
|
786
|
+
usd: "1576.73",
|
|
787
|
+
image: "https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg",
|
|
788
|
+
amount: "97180668792218669859",
|
|
789
|
+
symbol: "ETH",
|
|
790
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
791
|
+
decimals: "18",
|
|
792
|
+
name: "Ethereum"
|
|
793
|
+
},
|
|
794
|
+
network_fee: {
|
|
795
|
+
gas_price: "11658906980",
|
|
796
|
+
native_token_price_in_usd: "1576.73"
|
|
797
|
+
}
|
|
798
|
+
},
|
|
799
|
+
id: "29ddc718-78c6-5f91-936f-2bef13a605f0",
|
|
800
|
+
trigger_id: "ef003925-3379-4ba7-9e2d-8218690cadc8",
|
|
801
|
+
tx_hash: "0x58b5f82e084cb750ea174e02b20fbdfd2ba8d78053deac787f34fc38e5d427aa",
|
|
802
|
+
unread: true
|
|
803
|
+
};
|
|
804
|
+
return mockNotification;
|
|
805
|
+
}
|
|
806
|
+
function createMockNotificationLidoWithdrawalCompleted() {
|
|
807
|
+
const mockNotification = {
|
|
808
|
+
type: "lido_withdrawal_completed" /* LIDO_WITHDRAWAL_COMPLETED */,
|
|
809
|
+
block_number: 18378208,
|
|
810
|
+
block_timestamp: "1697643851",
|
|
811
|
+
chain_id: 1,
|
|
812
|
+
created_at: "2023-10-18T16:35:03.147606Z",
|
|
813
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
814
|
+
data: {
|
|
815
|
+
kind: "lido_withdrawal_completed",
|
|
816
|
+
stake_in: {
|
|
817
|
+
usd: "1570.23",
|
|
818
|
+
image: "https://raw.githubusercontent.com/MetaMask/contract-metadata/master/images/stETH.svg",
|
|
819
|
+
amount: "35081997661451346",
|
|
820
|
+
symbol: "STETH",
|
|
821
|
+
address: "0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84",
|
|
822
|
+
decimals: "18",
|
|
823
|
+
name: "Staked Eth"
|
|
824
|
+
},
|
|
825
|
+
stake_out: {
|
|
826
|
+
usd: "1571.74",
|
|
827
|
+
image: "https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg",
|
|
828
|
+
amount: "35081997661451346",
|
|
829
|
+
symbol: "ETH",
|
|
830
|
+
address: "0x0000000000000000000000000000000000000000",
|
|
831
|
+
decimals: "18",
|
|
832
|
+
name: "Ethereum"
|
|
833
|
+
},
|
|
834
|
+
network_fee: {
|
|
835
|
+
gas_price: "12699495150",
|
|
836
|
+
native_token_price_in_usd: "1571.74"
|
|
837
|
+
}
|
|
838
|
+
},
|
|
839
|
+
id: "f4ef0b7f-5612-537f-9144-0b5c63ae5391",
|
|
840
|
+
trigger_id: "d73df14d-ce73-4f38-bad3-ab028154042c",
|
|
841
|
+
tx_hash: "0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657",
|
|
842
|
+
unread: true
|
|
843
|
+
};
|
|
844
|
+
return mockNotification;
|
|
845
|
+
}
|
|
846
|
+
function createMockNotificationLidoReadyToBeWithdrawn() {
|
|
847
|
+
const mockNotification = {
|
|
848
|
+
type: "lido_stake_ready_to_be_withdrawn" /* LIDO_STAKE_READY_TO_BE_WITHDRAWN */,
|
|
849
|
+
block_number: 18378208,
|
|
850
|
+
block_timestamp: "1697643851",
|
|
851
|
+
chain_id: 1,
|
|
852
|
+
created_at: "2023-10-18T16:35:03.147606Z",
|
|
853
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300C",
|
|
854
|
+
data: {
|
|
855
|
+
kind: "lido_stake_ready_to_be_withdrawn",
|
|
856
|
+
request_id: "123456789",
|
|
857
|
+
staked_eth: {
|
|
858
|
+
address: "0x881D40237659C251811CEC9c364ef91dC08D300F",
|
|
859
|
+
symbol: "ETH",
|
|
860
|
+
name: "Ethereum",
|
|
861
|
+
amount: "2.5",
|
|
862
|
+
decimals: "18",
|
|
863
|
+
image: "https://token.api.cx.metamask.io/assets/nativeCurrencyLogos/ethereum.svg",
|
|
864
|
+
usd: "10000.00"
|
|
865
|
+
}
|
|
866
|
+
},
|
|
867
|
+
id: "f4ef0b7f-5612-537f-9144-0b5c63ae5391",
|
|
868
|
+
trigger_id: "d73df14d-ce73-4f38-bad3-ab028154042c",
|
|
869
|
+
tx_hash: "0xe6d210d2e601ef3dd1075c48e71452cf35f2daae3886911e964e3babad8ac657",
|
|
870
|
+
unread: true
|
|
871
|
+
};
|
|
872
|
+
return mockNotification;
|
|
873
|
+
}
|
|
874
|
+
function createMockRawOnChainNotifications() {
|
|
875
|
+
return [1, 2, 3].map((id) => {
|
|
876
|
+
const notification = createMockNotificationEthSent();
|
|
877
|
+
notification.id += `-${id}`;
|
|
878
|
+
return notification;
|
|
879
|
+
});
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
// src/NotificationServicesController/__fixtures__/mockResponses.ts
|
|
883
|
+
var CONTENTFUL_RESPONSE = createMockFeatureAnnouncementAPIResult();
|
|
884
|
+
var getMockFeatureAnnouncementResponse = () => {
|
|
885
|
+
return {
|
|
886
|
+
url: _chunkZMNXLHACjs.FEATURE_ANNOUNCEMENT_API,
|
|
887
|
+
requestMethod: "GET",
|
|
888
|
+
response: CONTENTFUL_RESPONSE
|
|
889
|
+
};
|
|
890
|
+
};
|
|
891
|
+
var getMockBatchCreateTriggersResponse = () => {
|
|
892
|
+
return {
|
|
893
|
+
url: _chunkVOZ7Y2OOjs.TRIGGER_API_BATCH_ENDPOINT,
|
|
894
|
+
requestMethod: "POST",
|
|
895
|
+
response: null
|
|
896
|
+
};
|
|
897
|
+
};
|
|
898
|
+
var getMockBatchDeleteTriggersResponse = () => {
|
|
899
|
+
return {
|
|
900
|
+
url: _chunkVOZ7Y2OOjs.TRIGGER_API_BATCH_ENDPOINT,
|
|
901
|
+
requestMethod: "DELETE",
|
|
902
|
+
response: null
|
|
903
|
+
};
|
|
904
|
+
};
|
|
905
|
+
var MOCK_RAW_ON_CHAIN_NOTIFICATIONS = createMockRawOnChainNotifications();
|
|
906
|
+
var getMockListNotificationsResponse = () => {
|
|
907
|
+
return {
|
|
908
|
+
url: _chunkVOZ7Y2OOjs.NOTIFICATION_API_LIST_ENDPOINT,
|
|
909
|
+
requestMethod: "POST",
|
|
910
|
+
response: MOCK_RAW_ON_CHAIN_NOTIFICATIONS
|
|
911
|
+
};
|
|
912
|
+
};
|
|
913
|
+
var getMockMarkNotificationsAsReadResponse = () => {
|
|
914
|
+
return {
|
|
915
|
+
url: _chunkVOZ7Y2OOjs.NOTIFICATION_API_MARK_ALL_AS_READ_ENDPOINT,
|
|
916
|
+
requestMethod: "POST",
|
|
917
|
+
response: null
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
|
|
924
|
+
exports.fixtures_exports = fixtures_exports; exports.NotificationServicesController_exports = NotificationServicesController_exports;
|
|
925
|
+
//# sourceMappingURL=chunk-XYIGTTEP.js.map
|