@metamask/notification-services-controller 19.0.0 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/CHANGELOG.md +25 -1
  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 +427 -529
  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 +424 -521
  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/feature-announcements.cjs.map +1 -1
  73. package/dist/NotificationServicesController/services/feature-announcements.mjs.map +1 -1
  74. package/dist/NotificationServicesController/services/notification-config-cache.cjs.map +1 -1
  75. package/dist/NotificationServicesController/services/notification-config-cache.mjs.map +1 -1
  76. package/dist/NotificationServicesController/services/perp-notifications.cjs +0 -1
  77. package/dist/NotificationServicesController/services/perp-notifications.cjs.map +1 -1
  78. package/dist/NotificationServicesController/services/perp-notifications.d.cts.map +1 -1
  79. package/dist/NotificationServicesController/services/perp-notifications.d.mts.map +1 -1
  80. package/dist/NotificationServicesController/services/perp-notifications.mjs +0 -1
  81. package/dist/NotificationServicesController/services/perp-notifications.mjs.map +1 -1
  82. package/dist/NotificationServicesController/types/index.cjs.map +1 -1
  83. package/dist/NotificationServicesController/types/index.d.cts +1 -1
  84. package/dist/NotificationServicesController/types/index.d.cts.map +1 -1
  85. package/dist/NotificationServicesController/types/index.d.mts +1 -1
  86. package/dist/NotificationServicesController/types/index.d.mts.map +1 -1
  87. package/dist/NotificationServicesController/types/index.mjs.map +1 -1
  88. package/dist/NotificationServicesController/types/notification/notification.cjs.map +1 -1
  89. package/dist/NotificationServicesController/types/notification/notification.d.cts +3 -11
  90. package/dist/NotificationServicesController/types/notification/notification.d.cts.map +1 -1
  91. package/dist/NotificationServicesController/types/notification/notification.d.mts +3 -11
  92. package/dist/NotificationServicesController/types/notification/notification.d.mts.map +1 -1
  93. package/dist/NotificationServicesController/types/notification/notification.mjs.map +1 -1
  94. package/dist/NotificationServicesController/types/notification-api/index.cjs.map +1 -0
  95. package/dist/NotificationServicesController/types/notification-api/index.d.cts +3 -0
  96. package/dist/NotificationServicesController/types/notification-api/index.d.cts.map +1 -0
  97. package/dist/NotificationServicesController/types/notification-api/index.d.mts +3 -0
  98. package/dist/NotificationServicesController/types/notification-api/index.d.mts.map +1 -0
  99. package/dist/NotificationServicesController/types/notification-api/index.mjs.map +1 -0
  100. package/dist/NotificationServicesController/types/{on-chain-notification/on-chain-notification.cjs → notification-api/notification-api.cjs} +1 -1
  101. package/dist/NotificationServicesController/types/notification-api/notification-api.cjs.map +1 -0
  102. package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts +64 -0
  103. package/dist/NotificationServicesController/types/notification-api/notification-api.d.cts.map +1 -0
  104. package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts +64 -0
  105. package/dist/NotificationServicesController/types/notification-api/notification-api.d.mts.map +1 -0
  106. package/dist/NotificationServicesController/types/notification-api/notification-api.mjs +2 -0
  107. package/dist/NotificationServicesController/types/notification-api/notification-api.mjs.map +1 -0
  108. package/dist/NotificationServicesController/types/notification-api/schema.cjs.map +1 -0
  109. package/dist/NotificationServicesController/types/notification-api/schema.d.cts +365 -0
  110. package/dist/NotificationServicesController/types/notification-api/schema.d.cts.map +1 -0
  111. package/dist/NotificationServicesController/types/notification-api/schema.d.mts +365 -0
  112. package/dist/NotificationServicesController/types/notification-api/schema.d.mts.map +1 -0
  113. package/dist/NotificationServicesController/types/notification-api/schema.mjs.map +1 -0
  114. package/dist/NotificationServicesController/ui/constants.d.cts +27 -27
  115. package/dist/NotificationServicesController/ui/constants.d.mts +27 -27
  116. package/dist/NotificationServicesController/utils/isVersionInBounds.cjs.map +1 -1
  117. package/dist/NotificationServicesController/utils/isVersionInBounds.mjs.map +1 -1
  118. package/dist/NotificationServicesController/utils/should-auto-expire.cjs +12 -0
  119. package/dist/NotificationServicesController/utils/should-auto-expire.cjs.map +1 -0
  120. package/dist/NotificationServicesController/utils/should-auto-expire.d.cts +2 -0
  121. package/dist/NotificationServicesController/utils/should-auto-expire.d.cts.map +1 -0
  122. package/dist/NotificationServicesController/utils/should-auto-expire.d.mts +2 -0
  123. package/dist/NotificationServicesController/utils/should-auto-expire.d.mts.map +1 -0
  124. package/dist/NotificationServicesController/utils/should-auto-expire.mjs +8 -0
  125. package/dist/NotificationServicesController/utils/should-auto-expire.mjs.map +1 -0
  126. package/dist/NotificationServicesPushController/NotificationServicesPushController.cjs.map +1 -1
  127. package/dist/NotificationServicesPushController/NotificationServicesPushController.mjs.map +1 -1
  128. package/dist/NotificationServicesPushController/services/push/push-web.cjs +5 -2
  129. package/dist/NotificationServicesPushController/services/push/push-web.cjs.map +1 -1
  130. package/dist/NotificationServicesPushController/services/push/push-web.d.cts.map +1 -1
  131. package/dist/NotificationServicesPushController/services/push/push-web.d.mts.map +1 -1
  132. package/dist/NotificationServicesPushController/services/push/push-web.mjs +6 -3
  133. package/dist/NotificationServicesPushController/services/push/push-web.mjs.map +1 -1
  134. package/dist/NotificationServicesPushController/services/services.cjs.map +1 -1
  135. package/dist/NotificationServicesPushController/services/services.mjs.map +1 -1
  136. package/dist/NotificationServicesPushController/utils/get-notification-data.cjs.map +1 -1
  137. package/dist/NotificationServicesPushController/utils/get-notification-data.mjs.map +1 -1
  138. package/dist/NotificationServicesPushController/utils/get-notification-message.cjs +51 -43
  139. package/dist/NotificationServicesPushController/utils/get-notification-message.cjs.map +1 -1
  140. package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts +4 -2
  141. package/dist/NotificationServicesPushController/utils/get-notification-message.d.cts.map +1 -1
  142. package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts +4 -2
  143. package/dist/NotificationServicesPushController/utils/get-notification-message.d.mts.map +1 -1
  144. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs +51 -43
  145. package/dist/NotificationServicesPushController/utils/get-notification-message.mjs.map +1 -1
  146. package/dist/NotificationServicesPushController/web/push-utils.cjs +5 -2
  147. package/dist/NotificationServicesPushController/web/push-utils.cjs.map +1 -1
  148. package/dist/NotificationServicesPushController/web/push-utils.d.cts.map +1 -1
  149. package/dist/NotificationServicesPushController/web/push-utils.d.mts.map +1 -1
  150. package/dist/NotificationServicesPushController/web/push-utils.mjs +6 -3
  151. package/dist/NotificationServicesPushController/web/push-utils.mjs.map +1 -1
  152. package/dist/shared/is-onchain-notification.cjs +1 -2
  153. package/dist/shared/is-onchain-notification.cjs.map +1 -1
  154. package/dist/shared/is-onchain-notification.d.cts.map +1 -1
  155. package/dist/shared/is-onchain-notification.d.mts.map +1 -1
  156. package/dist/shared/is-onchain-notification.mjs +1 -2
  157. package/dist/shared/is-onchain-notification.mjs.map +1 -1
  158. package/dist/shared/to-raw-notification.cjs +22 -6
  159. package/dist/shared/to-raw-notification.cjs.map +1 -1
  160. package/dist/shared/to-raw-notification.d.cts +2 -2
  161. package/dist/shared/to-raw-notification.d.cts.map +1 -1
  162. package/dist/shared/to-raw-notification.d.mts +2 -2
  163. package/dist/shared/to-raw-notification.d.mts.map +1 -1
  164. package/dist/shared/to-raw-notification.mjs +20 -4
  165. package/dist/shared/to-raw-notification.mjs.map +1 -1
  166. package/package.json +5 -3
  167. package/dist/NotificationServicesController/processors/process-onchain-notifications.cjs +0 -19
  168. package/dist/NotificationServicesController/processors/process-onchain-notifications.cjs.map +0 -1
  169. package/dist/NotificationServicesController/processors/process-onchain-notifications.d.cts +0 -10
  170. package/dist/NotificationServicesController/processors/process-onchain-notifications.d.cts.map +0 -1
  171. package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts +0 -10
  172. package/dist/NotificationServicesController/processors/process-onchain-notifications.d.mts.map +0 -1
  173. package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs +0 -15
  174. package/dist/NotificationServicesController/processors/process-onchain-notifications.mjs.map +0 -1
  175. package/dist/NotificationServicesController/services/onchain-notifications.cjs.map +0 -1
  176. package/dist/NotificationServicesController/services/onchain-notifications.d.cts.map +0 -1
  177. package/dist/NotificationServicesController/services/onchain-notifications.d.mts.map +0 -1
  178. package/dist/NotificationServicesController/services/onchain-notifications.mjs.map +0 -1
  179. package/dist/NotificationServicesController/types/on-chain-notification/index.cjs.map +0 -1
  180. package/dist/NotificationServicesController/types/on-chain-notification/index.d.cts +0 -2
  181. package/dist/NotificationServicesController/types/on-chain-notification/index.d.cts.map +0 -1
  182. package/dist/NotificationServicesController/types/on-chain-notification/index.d.mts +0 -2
  183. package/dist/NotificationServicesController/types/on-chain-notification/index.d.mts.map +0 -1
  184. package/dist/NotificationServicesController/types/on-chain-notification/index.mjs.map +0 -1
  185. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.cjs.map +0 -1
  186. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.cts +0 -49
  187. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.cts.map +0 -1
  188. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.mts +0 -49
  189. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.d.mts.map +0 -1
  190. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs +0 -2
  191. package/dist/NotificationServicesController/types/on-chain-notification/on-chain-notification.mjs.map +0 -1
  192. package/dist/NotificationServicesController/types/on-chain-notification/schema.cjs.map +0 -1
  193. package/dist/NotificationServicesController/types/on-chain-notification/schema.d.cts +0 -681
  194. package/dist/NotificationServicesController/types/on-chain-notification/schema.d.cts.map +0 -1
  195. package/dist/NotificationServicesController/types/on-chain-notification/schema.d.mts +0 -681
  196. package/dist/NotificationServicesController/types/on-chain-notification/schema.d.mts.map +0 -1
  197. package/dist/NotificationServicesController/types/on-chain-notification/schema.mjs.map +0 -1
  198. /package/dist/NotificationServicesController/types/{on-chain-notification → notification-api}/index.cjs +0 -0
  199. /package/dist/NotificationServicesController/types/{on-chain-notification → notification-api}/index.mjs +0 -0
  200. /package/dist/NotificationServicesController/types/{on-chain-notification → notification-api}/schema.cjs +0 -0
  201. /package/dist/NotificationServicesController/types/{on-chain-notification → notification-api}/schema.mjs +0 -0
@@ -25,401 +25,425 @@ export declare const processAndFilterNotifications: (ns: RawNotificationUnion[],
25
25
  isRead: boolean;
26
26
  } | {
27
27
  id: string;
28
- address: string;
29
- trigger_id: string;
30
- chain_id: number;
31
- block_number: number;
32
- block_timestamp: string;
33
- tx_hash: string;
28
+ notification_type: "on-chain";
34
29
  unread: boolean;
35
30
  created_at: string;
36
31
  type: TRIGGER_TYPES.METAMASK_SWAP_COMPLETED;
37
- data: {
38
- kind: "metamask_swap_completed";
39
- network_fee: {
40
- gas_price: string;
41
- native_token_price_in_usd: string;
42
- };
43
- rate: string;
44
- token_in: {
45
- address: string;
46
- symbol: string;
47
- name: string;
48
- amount: string;
49
- decimals: string;
50
- image: string;
51
- usd: string;
52
- };
53
- token_out: {
54
- address: string;
55
- symbol: string;
56
- name: string;
57
- amount: string;
58
- decimals: string;
59
- image: string;
60
- usd: string;
32
+ payload: {
33
+ address: string;
34
+ chain_id: number;
35
+ block_number: number;
36
+ block_timestamp: string;
37
+ tx_hash: string;
38
+ data: {
39
+ kind: "metamask_swap_completed";
40
+ network_fee: {
41
+ gas_price: string;
42
+ native_token_price_in_usd: string;
43
+ };
44
+ rate: string;
45
+ token_in: {
46
+ address: string;
47
+ symbol: string;
48
+ name: string;
49
+ amount: string;
50
+ decimals: string;
51
+ image: string;
52
+ usd: string;
53
+ };
54
+ token_out: {
55
+ address: string;
56
+ symbol: string;
57
+ name: string;
58
+ amount: string;
59
+ decimals: string;
60
+ image: string;
61
+ usd: string;
62
+ };
61
63
  };
62
64
  };
63
65
  createdAt: string;
64
66
  isRead: boolean;
65
67
  } | {
66
68
  id: string;
67
- address: string;
68
- trigger_id: string;
69
- chain_id: number;
70
- block_number: number;
71
- block_timestamp: string;
72
- tx_hash: string;
69
+ notification_type: "on-chain";
73
70
  unread: boolean;
74
71
  created_at: string;
75
72
  type: TRIGGER_TYPES.ERC20_SENT;
76
- data: {
77
- kind: "erc20_sent";
78
- network_fee: {
79
- gas_price: string;
80
- native_token_price_in_usd: string;
81
- };
82
- from: string;
83
- to: string;
84
- token: {
85
- address: string;
86
- symbol: string;
87
- name: string;
88
- amount: string;
89
- decimals: string;
90
- image: string;
91
- usd: string;
73
+ payload: {
74
+ address: string;
75
+ chain_id: number;
76
+ block_number: number;
77
+ block_timestamp: string;
78
+ tx_hash: string;
79
+ data: {
80
+ kind: "erc20_sent";
81
+ network_fee: {
82
+ gas_price: string;
83
+ native_token_price_in_usd: string;
84
+ };
85
+ from: string;
86
+ to: string;
87
+ token: {
88
+ address: string;
89
+ symbol: string;
90
+ name: string;
91
+ amount: string;
92
+ decimals: string;
93
+ image: string;
94
+ usd: string;
95
+ };
92
96
  };
93
97
  };
94
98
  createdAt: string;
95
99
  isRead: boolean;
96
100
  } | {
97
101
  id: string;
98
- address: string;
99
- trigger_id: string;
100
- chain_id: number;
101
- block_number: number;
102
- block_timestamp: string;
103
- tx_hash: string;
102
+ notification_type: "on-chain";
104
103
  unread: boolean;
105
104
  created_at: string;
106
105
  type: TRIGGER_TYPES.ERC20_RECEIVED;
107
- data: {
108
- kind: "erc20_received";
109
- network_fee: {
110
- gas_price: string;
111
- native_token_price_in_usd: string;
112
- };
113
- from: string;
114
- to: string;
115
- token: {
116
- address: string;
117
- symbol: string;
118
- name: string;
119
- amount: string;
120
- decimals: string;
121
- image: string;
122
- usd: string;
106
+ payload: {
107
+ address: string;
108
+ chain_id: number;
109
+ block_number: number;
110
+ block_timestamp: string;
111
+ tx_hash: string;
112
+ data: {
113
+ kind: "erc20_received";
114
+ network_fee: {
115
+ gas_price: string;
116
+ native_token_price_in_usd: string;
117
+ };
118
+ from: string;
119
+ to: string;
120
+ token: {
121
+ address: string;
122
+ symbol: string;
123
+ name: string;
124
+ amount: string;
125
+ decimals: string;
126
+ image: string;
127
+ usd: string;
128
+ };
123
129
  };
124
130
  };
125
131
  createdAt: string;
126
132
  isRead: boolean;
127
133
  } | {
128
134
  id: string;
129
- address: string;
130
- trigger_id: string;
131
- chain_id: number;
132
- block_number: number;
133
- block_timestamp: string;
134
- tx_hash: string;
135
+ notification_type: "on-chain";
135
136
  unread: boolean;
136
137
  created_at: string;
137
138
  type: TRIGGER_TYPES.ETH_SENT;
138
- data: {
139
- kind: "eth_sent";
140
- network_fee: {
141
- gas_price: string;
142
- native_token_price_in_usd: string;
143
- };
144
- from: string;
145
- to: string;
146
- amount: {
147
- usd: string;
148
- eth: string;
139
+ payload: {
140
+ address: string;
141
+ chain_id: number;
142
+ block_number: number;
143
+ block_timestamp: string;
144
+ tx_hash: string;
145
+ data: {
146
+ kind: "eth_sent";
147
+ network_fee: {
148
+ gas_price: string;
149
+ native_token_price_in_usd: string;
150
+ };
151
+ from: string;
152
+ to: string;
153
+ amount: {
154
+ usd: string;
155
+ eth: string;
156
+ };
149
157
  };
150
158
  };
151
159
  createdAt: string;
152
160
  isRead: boolean;
153
161
  } | {
154
162
  id: string;
155
- address: string;
156
- trigger_id: string;
157
- chain_id: number;
158
- block_number: number;
159
- block_timestamp: string;
160
- tx_hash: string;
163
+ notification_type: "on-chain";
161
164
  unread: boolean;
162
165
  created_at: string;
163
166
  type: TRIGGER_TYPES.ETH_RECEIVED;
164
- data: {
165
- kind: "eth_received";
166
- network_fee: {
167
- gas_price: string;
168
- native_token_price_in_usd: string;
169
- };
170
- from: string;
171
- to: string;
172
- amount: {
173
- usd: string;
174
- eth: string;
167
+ payload: {
168
+ address: string;
169
+ chain_id: number;
170
+ block_number: number;
171
+ block_timestamp: string;
172
+ tx_hash: string;
173
+ data: {
174
+ kind: "eth_received";
175
+ network_fee: {
176
+ gas_price: string;
177
+ native_token_price_in_usd: string;
178
+ };
179
+ from: string;
180
+ to: string;
181
+ amount: {
182
+ usd: string;
183
+ eth: string;
184
+ };
175
185
  };
176
186
  };
177
187
  createdAt: string;
178
188
  isRead: boolean;
179
189
  } | {
180
190
  id: string;
181
- address: string;
182
- trigger_id: string;
183
- chain_id: number;
184
- block_number: number;
185
- block_timestamp: string;
186
- tx_hash: string;
191
+ notification_type: "on-chain";
187
192
  unread: boolean;
188
193
  created_at: string;
189
194
  type: TRIGGER_TYPES.ROCKETPOOL_STAKE_COMPLETED;
190
- data: {
191
- kind: "rocketpool_stake_completed";
192
- network_fee: {
193
- gas_price: string;
194
- native_token_price_in_usd: string;
195
- };
196
- stake_in: {
197
- address: string;
198
- symbol: string;
199
- name: string;
200
- amount: string;
201
- decimals: string;
202
- image: string;
203
- usd: string;
204
- };
205
- stake_out: {
206
- address: string;
207
- symbol: string;
208
- name: string;
209
- amount: string;
210
- decimals: string;
211
- image: string;
212
- usd: string;
195
+ payload: {
196
+ address: string;
197
+ chain_id: number;
198
+ block_number: number;
199
+ block_timestamp: string;
200
+ tx_hash: string;
201
+ data: {
202
+ kind: "rocketpool_stake_completed";
203
+ network_fee: {
204
+ gas_price: string;
205
+ native_token_price_in_usd: string;
206
+ };
207
+ stake_in: {
208
+ address: string;
209
+ symbol: string;
210
+ name: string;
211
+ amount: string;
212
+ decimals: string;
213
+ image: string;
214
+ usd: string;
215
+ };
216
+ stake_out: {
217
+ address: string;
218
+ symbol: string;
219
+ name: string;
220
+ amount: string;
221
+ decimals: string;
222
+ image: string;
223
+ usd: string;
224
+ };
213
225
  };
214
226
  };
215
227
  createdAt: string;
216
228
  isRead: boolean;
217
229
  } | {
218
230
  id: string;
219
- address: string;
220
- trigger_id: string;
221
- chain_id: number;
222
- block_number: number;
223
- block_timestamp: string;
224
- tx_hash: string;
231
+ notification_type: "on-chain";
225
232
  unread: boolean;
226
233
  created_at: string;
227
234
  type: TRIGGER_TYPES.ROCKETPOOL_UNSTAKE_COMPLETED;
228
- data: {
229
- kind: "rocketpool_unstake_completed";
230
- network_fee: {
231
- gas_price: string;
232
- native_token_price_in_usd: string;
233
- };
234
- stake_in: {
235
- address: string;
236
- symbol: string;
237
- name: string;
238
- amount: string;
239
- decimals: string;
240
- image: string;
241
- usd: string;
242
- };
243
- stake_out: {
244
- address: string;
245
- symbol: string;
246
- name: string;
247
- amount: string;
248
- decimals: string;
249
- image: string;
250
- usd: string;
235
+ payload: {
236
+ address: string;
237
+ chain_id: number;
238
+ block_number: number;
239
+ block_timestamp: string;
240
+ tx_hash: string;
241
+ data: {
242
+ kind: "rocketpool_unstake_completed";
243
+ network_fee: {
244
+ gas_price: string;
245
+ native_token_price_in_usd: string;
246
+ };
247
+ stake_in: {
248
+ address: string;
249
+ symbol: string;
250
+ name: string;
251
+ amount: string;
252
+ decimals: string;
253
+ image: string;
254
+ usd: string;
255
+ };
256
+ stake_out: {
257
+ address: string;
258
+ symbol: string;
259
+ name: string;
260
+ amount: string;
261
+ decimals: string;
262
+ image: string;
263
+ usd: string;
264
+ };
251
265
  };
252
266
  };
253
267
  createdAt: string;
254
268
  isRead: boolean;
255
269
  } | {
256
270
  id: string;
257
- address: string;
258
- trigger_id: string;
259
- chain_id: number;
260
- block_number: number;
261
- block_timestamp: string;
262
- tx_hash: string;
271
+ notification_type: "on-chain";
263
272
  unread: boolean;
264
273
  created_at: string;
265
274
  type: TRIGGER_TYPES.LIDO_STAKE_COMPLETED;
266
- data: {
267
- kind: "lido_stake_completed";
268
- network_fee: {
269
- gas_price: string;
270
- native_token_price_in_usd: string;
271
- };
272
- stake_in: {
273
- address: string;
274
- symbol: string;
275
- name: string;
276
- amount: string;
277
- decimals: string;
278
- image: string;
279
- usd: string;
280
- };
281
- stake_out: {
282
- address: string;
283
- symbol: string;
284
- name: string;
285
- amount: string;
286
- decimals: string;
287
- image: string;
288
- usd: string;
275
+ payload: {
276
+ address: string;
277
+ chain_id: number;
278
+ block_number: number;
279
+ block_timestamp: string;
280
+ tx_hash: string;
281
+ data: {
282
+ kind: "lido_stake_completed";
283
+ network_fee: {
284
+ gas_price: string;
285
+ native_token_price_in_usd: string;
286
+ };
287
+ stake_in: {
288
+ address: string;
289
+ symbol: string;
290
+ name: string;
291
+ amount: string;
292
+ decimals: string;
293
+ image: string;
294
+ usd: string;
295
+ };
296
+ stake_out: {
297
+ address: string;
298
+ symbol: string;
299
+ name: string;
300
+ amount: string;
301
+ decimals: string;
302
+ image: string;
303
+ usd: string;
304
+ };
289
305
  };
290
306
  };
291
307
  createdAt: string;
292
308
  isRead: boolean;
293
309
  } | {
294
310
  id: string;
295
- address: string;
296
- trigger_id: string;
297
- chain_id: number;
298
- block_number: number;
299
- block_timestamp: string;
300
- tx_hash: string;
311
+ notification_type: "on-chain";
301
312
  unread: boolean;
302
313
  created_at: string;
303
314
  type: TRIGGER_TYPES.LIDO_WITHDRAWAL_REQUESTED;
304
- data: {
305
- kind: "lido_withdrawal_requested";
306
- network_fee: {
307
- gas_price: string;
308
- native_token_price_in_usd: string;
309
- };
310
- stake_in: {
311
- address: string;
312
- symbol: string;
313
- name: string;
314
- amount: string;
315
- decimals: string;
316
- image: string;
317
- usd: string;
318
- };
319
- stake_out: {
320
- address: string;
321
- symbol: string;
322
- name: string;
323
- amount: string;
324
- decimals: string;
325
- image: string;
326
- usd: string;
315
+ payload: {
316
+ address: string;
317
+ chain_id: number;
318
+ block_number: number;
319
+ block_timestamp: string;
320
+ tx_hash: string;
321
+ data: {
322
+ kind: "lido_withdrawal_requested";
323
+ network_fee: {
324
+ gas_price: string;
325
+ native_token_price_in_usd: string;
326
+ };
327
+ stake_in: {
328
+ address: string;
329
+ symbol: string;
330
+ name: string;
331
+ amount: string;
332
+ decimals: string;
333
+ image: string;
334
+ usd: string;
335
+ };
336
+ stake_out: {
337
+ address: string;
338
+ symbol: string;
339
+ name: string;
340
+ amount: string;
341
+ decimals: string;
342
+ image: string;
343
+ usd: string;
344
+ };
327
345
  };
328
346
  };
329
347
  createdAt: string;
330
348
  isRead: boolean;
331
349
  } | {
332
350
  id: string;
333
- address: string;
334
- trigger_id: string;
335
- chain_id: number;
336
- block_number: number;
337
- block_timestamp: string;
338
- tx_hash: string;
351
+ notification_type: "on-chain";
339
352
  unread: boolean;
340
353
  created_at: string;
341
354
  type: TRIGGER_TYPES.LIDO_WITHDRAWAL_COMPLETED;
342
- data: {
343
- kind: "lido_withdrawal_completed";
344
- network_fee: {
345
- gas_price: string;
346
- native_token_price_in_usd: string;
347
- };
348
- stake_in: {
349
- address: string;
350
- symbol: string;
351
- name: string;
352
- amount: string;
353
- decimals: string;
354
- image: string;
355
- usd: string;
356
- };
357
- stake_out: {
358
- address: string;
359
- symbol: string;
360
- name: string;
361
- amount: string;
362
- decimals: string;
363
- image: string;
364
- usd: string;
355
+ payload: {
356
+ address: string;
357
+ chain_id: number;
358
+ block_number: number;
359
+ block_timestamp: string;
360
+ tx_hash: string;
361
+ data: {
362
+ kind: "lido_withdrawal_completed";
363
+ network_fee: {
364
+ gas_price: string;
365
+ native_token_price_in_usd: string;
366
+ };
367
+ stake_in: {
368
+ address: string;
369
+ symbol: string;
370
+ name: string;
371
+ amount: string;
372
+ decimals: string;
373
+ image: string;
374
+ usd: string;
375
+ };
376
+ stake_out: {
377
+ address: string;
378
+ symbol: string;
379
+ name: string;
380
+ amount: string;
381
+ decimals: string;
382
+ image: string;
383
+ usd: string;
384
+ };
365
385
  };
366
386
  };
367
387
  createdAt: string;
368
388
  isRead: boolean;
369
389
  } | {
370
390
  id: string;
371
- address: string;
372
- trigger_id: string;
373
- chain_id: number;
374
- block_number: number;
375
- block_timestamp: string;
376
- tx_hash: string;
391
+ notification_type: "on-chain";
377
392
  unread: boolean;
378
393
  created_at: string;
379
394
  type: TRIGGER_TYPES.LIDO_STAKE_READY_TO_BE_WITHDRAWN;
380
- data: {
381
- kind: "lido_stake_ready_to_be_withdrawn";
382
- request_id: string;
383
- staked_eth: {
384
- address: string;
385
- symbol: string;
386
- name: string;
387
- amount: string;
388
- decimals: string;
389
- image: string;
390
- usd: string;
395
+ payload: {
396
+ address: string;
397
+ chain_id: number;
398
+ block_number: number;
399
+ block_timestamp: string;
400
+ tx_hash: string;
401
+ data: {
402
+ kind: "lido_stake_ready_to_be_withdrawn";
403
+ request_id: string;
404
+ staked_eth: {
405
+ address: string;
406
+ symbol: string;
407
+ name: string;
408
+ amount: string;
409
+ decimals: string;
410
+ image: string;
411
+ usd: string;
412
+ };
391
413
  };
392
414
  };
393
415
  createdAt: string;
394
416
  isRead: boolean;
395
417
  } | {
396
418
  id: string;
397
- address: string;
398
- trigger_id: string;
399
- chain_id: number;
400
- block_number: number;
401
- block_timestamp: string;
402
- tx_hash: string;
419
+ notification_type: "on-chain";
403
420
  unread: boolean;
404
421
  created_at: string;
405
422
  type: TRIGGER_TYPES.ERC721_SENT;
406
- data: {
407
- kind: "erc721_sent";
408
- network_fee: {
409
- gas_price: string;
410
- native_token_price_in_usd: string;
411
- };
412
- from: string;
413
- to: string;
414
- nft: {
415
- name: string;
416
- token_id: string;
417
- image: string;
418
- collection: {
419
- address: string;
423
+ payload: {
424
+ address: string;
425
+ chain_id: number;
426
+ block_number: number;
427
+ block_timestamp: string;
428
+ tx_hash: string;
429
+ data: {
430
+ kind: "erc721_sent";
431
+ network_fee: {
432
+ gas_price: string;
433
+ native_token_price_in_usd: string;
434
+ };
435
+ from: string;
436
+ to: string;
437
+ nft: {
420
438
  name: string;
421
- symbol: string;
439
+ token_id: string;
422
440
  image: string;
441
+ collection: {
442
+ address: string;
443
+ name: string;
444
+ symbol: string;
445
+ image: string;
446
+ };
423
447
  };
424
448
  };
425
449
  };
@@ -427,32 +451,34 @@ export declare const processAndFilterNotifications: (ns: RawNotificationUnion[],
427
451
  isRead: boolean;
428
452
  } | {
429
453
  id: string;
430
- address: string;
431
- trigger_id: string;
432
- chain_id: number;
433
- block_number: number;
434
- block_timestamp: string;
435
- tx_hash: string;
454
+ notification_type: "on-chain";
436
455
  unread: boolean;
437
456
  created_at: string;
438
457
  type: TRIGGER_TYPES.ERC721_RECEIVED;
439
- data: {
440
- kind: "erc721_received";
441
- network_fee: {
442
- gas_price: string;
443
- native_token_price_in_usd: string;
444
- };
445
- from: string;
446
- to: string;
447
- nft: {
448
- name: string;
449
- token_id: string;
450
- image: string;
451
- collection: {
452
- address: string;
458
+ payload: {
459
+ address: string;
460
+ chain_id: number;
461
+ block_number: number;
462
+ block_timestamp: string;
463
+ tx_hash: string;
464
+ data: {
465
+ kind: "erc721_received";
466
+ network_fee: {
467
+ gas_price: string;
468
+ native_token_price_in_usd: string;
469
+ };
470
+ from: string;
471
+ to: string;
472
+ nft: {
453
473
  name: string;
454
- symbol: string;
474
+ token_id: string;
455
475
  image: string;
476
+ collection: {
477
+ address: string;
478
+ name: string;
479
+ symbol: string;
480
+ image: string;
481
+ };
456
482
  };
457
483
  };
458
484
  };
@@ -460,175 +486,89 @@ export declare const processAndFilterNotifications: (ns: RawNotificationUnion[],
460
486
  isRead: boolean;
461
487
  } | {
462
488
  id: string;
463
- address: string;
464
- trigger_id: string;
465
- chain_id: number;
466
- block_number: number;
467
- block_timestamp: string;
468
- tx_hash: string;
489
+ notification_type: "on-chain";
469
490
  unread: boolean;
470
491
  created_at: string;
471
492
  type: TRIGGER_TYPES.ERC1155_SENT;
472
- data: {
473
- kind: "erc1155_sent";
474
- network_fee: {
475
- gas_price: string;
476
- native_token_price_in_usd: string;
477
- };
478
- from: string;
479
- to: string;
480
- nft?: {
481
- name: string;
482
- token_id: string;
483
- image: string;
484
- collection: {
485
- address: string;
493
+ payload: {
494
+ address: string;
495
+ chain_id: number;
496
+ block_number: number;
497
+ block_timestamp: string;
498
+ tx_hash: string;
499
+ data: {
500
+ kind: "erc1155_sent";
501
+ network_fee: {
502
+ gas_price: string;
503
+ native_token_price_in_usd: string;
504
+ };
505
+ from: string;
506
+ to: string;
507
+ nft?: {
486
508
  name: string;
487
- symbol: string;
509
+ token_id: string;
488
510
  image: string;
489
- };
490
- } | undefined;
511
+ collection: {
512
+ address: string;
513
+ name: string;
514
+ symbol: string;
515
+ image: string;
516
+ };
517
+ } | undefined;
518
+ };
491
519
  };
492
520
  createdAt: string;
493
521
  isRead: boolean;
494
522
  } | {
495
523
  id: string;
496
- address: string;
497
- trigger_id: string;
498
- chain_id: number;
499
- block_number: number;
500
- block_timestamp: string;
501
- tx_hash: string;
524
+ notification_type: "on-chain";
502
525
  unread: boolean;
503
526
  created_at: string;
504
527
  type: TRIGGER_TYPES.ERC1155_RECEIVED;
505
- data: {
506
- kind: "erc1155_received";
507
- network_fee: {
508
- gas_price: string;
509
- native_token_price_in_usd: string;
510
- };
511
- from: string;
512
- to: string;
513
- nft?: {
514
- name: string;
515
- token_id: string;
516
- image: string;
517
- collection: {
518
- address: string;
528
+ payload: {
529
+ address: string;
530
+ chain_id: number;
531
+ block_number: number;
532
+ block_timestamp: string;
533
+ tx_hash: string;
534
+ data: {
535
+ kind: "erc1155_received";
536
+ network_fee: {
537
+ gas_price: string;
538
+ native_token_price_in_usd: string;
539
+ };
540
+ from: string;
541
+ to: string;
542
+ nft?: {
519
543
  name: string;
520
- symbol: string;
544
+ token_id: string;
521
545
  image: string;
522
- };
523
- } | undefined;
524
- };
525
- createdAt: string;
526
- isRead: boolean;
527
- } | {
528
- id: string;
529
- address: string;
530
- trigger_id: string;
531
- chain_id: number;
532
- unread: boolean;
533
- created_at: string;
534
- type: TRIGGER_TYPES.AAVE_V3_HEALTH_FACTOR;
535
- data: {
536
- kind: "aave_v3_health_factor";
537
- chainId: number;
538
- healthFactor: string;
539
- threshold: string;
540
- };
541
- createdAt: string;
542
- isRead: boolean;
543
- } | {
544
- id: string;
545
- address: string;
546
- trigger_id: string;
547
- chain_id: number;
548
- unread: boolean;
549
- created_at: string;
550
- type: TRIGGER_TYPES.ENS_EXPIRATION;
551
- data: {
552
- kind: "ens_expiration";
553
- chainId: number;
554
- reverseEnsName: string;
555
- expirationDateIso: string;
556
- reminderDelayInSeconds: number;
557
- };
558
- createdAt: string;
559
- isRead: boolean;
560
- } | {
561
- id: string;
562
- address: string;
563
- trigger_id: string;
564
- chain_id: number;
565
- unread: boolean;
566
- created_at: string;
567
- type: TRIGGER_TYPES.LIDO_STAKING_REWARDS;
568
- data: {
569
- kind: "lido_staking_rewards";
570
- chainId: number;
571
- currentStethBalance: string;
572
- currentEthValue: string;
573
- estimatedTotalRewardInPeriod: string;
574
- daysSinceLastNotification: number;
575
- notificationIntervalDays: number;
576
- };
577
- createdAt: string;
578
- isRead: boolean;
579
- } | {
580
- id: string;
581
- address: string;
582
- trigger_id: string;
583
- chain_id: number;
584
- unread: boolean;
585
- created_at: string;
586
- type: TRIGGER_TYPES.ROCKETPOOL_STAKING_REWARDS;
587
- data: {
588
- kind: "rocketpool_staking_rewards";
589
- chainId: number;
590
- currentRethBalance: string;
591
- currentEthValue: string;
592
- estimatedTotalRewardInPeriod: string;
593
- daysSinceLastNotification: number;
594
- notificationIntervalDays: number;
546
+ collection: {
547
+ address: string;
548
+ name: string;
549
+ symbol: string;
550
+ image: string;
551
+ };
552
+ } | undefined;
553
+ };
595
554
  };
596
555
  createdAt: string;
597
556
  isRead: boolean;
598
557
  } | {
599
558
  id: string;
600
- address: string;
601
- trigger_id: string;
602
- chain_id: number;
559
+ notification_type: "platform";
603
560
  unread: boolean;
604
- created_at: string;
605
- type: TRIGGER_TYPES.NOTIONAL_LOAN_EXPIRATION;
606
- data: {
607
- kind: "notional_loan_expiration";
608
- chainId: number;
609
- loans: {
610
- amount: string;
611
- symbol: string;
612
- maturityDateIso: string;
613
- }[];
614
- reminderDelayInSeconds: number;
561
+ template: {
562
+ image_url: string;
563
+ cta?: {
564
+ content: string;
565
+ link: string;
566
+ } | undefined;
567
+ title: string;
568
+ body: string;
615
569
  };
616
- createdAt: string;
617
- isRead: boolean;
618
- } | {
619
- id: string;
620
- address: string;
621
- trigger_id: string;
622
- chain_id: number;
623
- unread: boolean;
624
570
  created_at: string;
625
- type: TRIGGER_TYPES.SPARK_FI_HEALTH_FACTOR;
626
- data: {
627
- kind: "spark_fi_health_factor";
628
- chainId: number;
629
- healthFactor: string;
630
- threshold: string;
631
- };
571
+ type: TRIGGER_TYPES.PLATFORM;
632
572
  createdAt: string;
633
573
  isRead: boolean;
634
574
  } | {