@metamask-previews/notification-services-controller 19.0.0-preview-7b698bb → 19.0.0-preview-ba016213

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