@metamask-previews/notification-services-controller 0.2.1-preview-55328a6 → 0.2.1-preview-12fc043b

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