@metamask-previews/notification-services-controller 0.2.1-preview-12fc043b → 0.2.1-preview-21d139ea

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