@metamask/snaps-simulation 3.3.0 → 3.4.1

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 (118) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/methods/hooks/end-trace.cjs +29 -0
  3. package/dist/methods/hooks/end-trace.cjs.map +1 -0
  4. package/dist/methods/hooks/end-trace.d.cts +9 -0
  5. package/dist/methods/hooks/end-trace.d.cts.map +1 -0
  6. package/dist/methods/hooks/end-trace.d.mts +9 -0
  7. package/dist/methods/hooks/end-trace.d.mts.map +1 -0
  8. package/dist/methods/hooks/end-trace.mjs +25 -0
  9. package/dist/methods/hooks/end-trace.mjs.map +1 -0
  10. package/dist/methods/hooks/get-snap.cjs +52 -0
  11. package/dist/methods/hooks/get-snap.cjs.map +1 -0
  12. package/dist/methods/hooks/get-snap.d.cts +11 -0
  13. package/dist/methods/hooks/get-snap.d.cts.map +1 -0
  14. package/dist/methods/hooks/get-snap.d.mts +11 -0
  15. package/dist/methods/hooks/get-snap.d.mts.map +1 -0
  16. package/dist/methods/hooks/get-snap.mjs +48 -0
  17. package/dist/methods/hooks/get-snap.mjs.map +1 -0
  18. package/dist/methods/hooks/index.cjs +5 -0
  19. package/dist/methods/hooks/index.cjs.map +1 -1
  20. package/dist/methods/hooks/index.d.cts +5 -0
  21. package/dist/methods/hooks/index.d.cts.map +1 -1
  22. package/dist/methods/hooks/index.d.mts +5 -0
  23. package/dist/methods/hooks/index.d.mts.map +1 -1
  24. package/dist/methods/hooks/index.mjs +5 -0
  25. package/dist/methods/hooks/index.mjs.map +1 -1
  26. package/dist/methods/hooks/start-trace.cjs +34 -0
  27. package/dist/methods/hooks/start-trace.cjs.map +1 -0
  28. package/dist/methods/hooks/start-trace.d.cts +9 -0
  29. package/dist/methods/hooks/start-trace.d.cts.map +1 -0
  30. package/dist/methods/hooks/start-trace.d.mts +9 -0
  31. package/dist/methods/hooks/start-trace.d.mts.map +1 -0
  32. package/dist/methods/hooks/start-trace.mjs +30 -0
  33. package/dist/methods/hooks/start-trace.mjs.map +1 -0
  34. package/dist/methods/hooks/track-error.cjs +31 -0
  35. package/dist/methods/hooks/track-error.cjs.map +1 -0
  36. package/dist/methods/hooks/track-error.d.cts +9 -0
  37. package/dist/methods/hooks/track-error.d.cts.map +1 -0
  38. package/dist/methods/hooks/track-error.d.mts +9 -0
  39. package/dist/methods/hooks/track-error.d.mts.map +1 -0
  40. package/dist/methods/hooks/track-error.mjs +27 -0
  41. package/dist/methods/hooks/track-error.mjs.map +1 -0
  42. package/dist/methods/hooks/track-event.cjs +29 -0
  43. package/dist/methods/hooks/track-event.cjs.map +1 -0
  44. package/dist/methods/hooks/track-event.d.cts +13 -0
  45. package/dist/methods/hooks/track-event.d.cts.map +1 -0
  46. package/dist/methods/hooks/track-event.d.mts +13 -0
  47. package/dist/methods/hooks/track-event.d.mts.map +1 -0
  48. package/dist/methods/hooks/track-event.mjs +25 -0
  49. package/dist/methods/hooks/track-event.mjs.map +1 -0
  50. package/dist/request.cjs +21 -1
  51. package/dist/request.cjs.map +1 -1
  52. package/dist/request.d.cts.map +1 -1
  53. package/dist/request.d.mts.map +1 -1
  54. package/dist/request.mjs +22 -2
  55. package/dist/request.mjs.map +1 -1
  56. package/dist/simulation.cjs +6 -1
  57. package/dist/simulation.cjs.map +1 -1
  58. package/dist/simulation.d.cts +34 -2
  59. package/dist/simulation.d.cts.map +1 -1
  60. package/dist/simulation.d.mts +34 -2
  61. package/dist/simulation.d.mts.map +1 -1
  62. package/dist/simulation.mjs +7 -2
  63. package/dist/simulation.mjs.map +1 -1
  64. package/dist/store/index.cjs +1 -0
  65. package/dist/store/index.cjs.map +1 -1
  66. package/dist/store/index.d.cts +1 -0
  67. package/dist/store/index.d.cts.map +1 -1
  68. package/dist/store/index.d.mts +1 -0
  69. package/dist/store/index.d.mts.map +1 -1
  70. package/dist/store/index.mjs +1 -0
  71. package/dist/store/index.mjs.map +1 -1
  72. package/dist/store/mocks.d.cts +1 -0
  73. package/dist/store/mocks.d.cts.map +1 -1
  74. package/dist/store/mocks.d.mts +1 -0
  75. package/dist/store/mocks.d.mts.map +1 -1
  76. package/dist/store/notifications.d.cts +1 -0
  77. package/dist/store/notifications.d.cts.map +1 -1
  78. package/dist/store/notifications.d.mts +1 -0
  79. package/dist/store/notifications.d.mts.map +1 -1
  80. package/dist/store/state.d.cts +2 -0
  81. package/dist/store/state.d.cts.map +1 -1
  82. package/dist/store/state.d.mts +2 -0
  83. package/dist/store/state.d.mts.map +1 -1
  84. package/dist/store/store.cjs +2 -0
  85. package/dist/store/store.cjs.map +1 -1
  86. package/dist/store/store.d.cts +1 -0
  87. package/dist/store/store.d.cts.map +1 -1
  88. package/dist/store/store.d.mts +1 -0
  89. package/dist/store/store.d.mts.map +1 -1
  90. package/dist/store/store.mjs +2 -0
  91. package/dist/store/store.mjs.map +1 -1
  92. package/dist/store/trackables.cjs +70 -0
  93. package/dist/store/trackables.cjs.map +1 -0
  94. package/dist/store/trackables.d.cts +98 -0
  95. package/dist/store/trackables.d.cts.map +1 -0
  96. package/dist/store/trackables.d.mts +98 -0
  97. package/dist/store/trackables.d.mts.map +1 -0
  98. package/dist/store/trackables.mjs +67 -0
  99. package/dist/store/trackables.mjs.map +1 -0
  100. package/dist/store/ui.d.cts +1 -0
  101. package/dist/store/ui.d.cts.map +1 -1
  102. package/dist/store/ui.d.mts +1 -0
  103. package/dist/store/ui.d.mts.map +1 -1
  104. package/dist/structs.cjs +17 -0
  105. package/dist/structs.cjs.map +1 -1
  106. package/dist/structs.d.cts +182 -12
  107. package/dist/structs.d.cts.map +1 -1
  108. package/dist/structs.d.mts +182 -12
  109. package/dist/structs.d.mts.map +1 -1
  110. package/dist/structs.mjs +18 -1
  111. package/dist/structs.mjs.map +1 -1
  112. package/dist/types.cjs.map +1 -1
  113. package/dist/types.d.cts +11 -1
  114. package/dist/types.d.cts.map +1 -1
  115. package/dist/types.d.mts +11 -1
  116. package/dist/types.d.mts.map +1 -1
  117. package/dist/types.mjs.map +1 -1
  118. package/package.json +8 -7
@@ -1,5 +1,6 @@
1
1
  import type { SnapResponse, SnapResponseWithInterface } from "./types.mjs";
2
2
  export declare const TransactionOptionsStruct: import("@metamask/superstruct").Struct<{
3
+ data: `0x${string}`;
3
4
  value: `0x${string}`;
4
5
  chainId: string;
5
6
  origin: string;
@@ -9,7 +10,6 @@ export declare const TransactionOptionsStruct: import("@metamask/superstruct").S
9
10
  maxFeePerGas: `0x${string}`;
10
11
  maxPriorityFeePerGas: `0x${string}`;
11
12
  nonce: `0x${string}`;
12
- data: `0x${string}`;
13
13
  }, {
14
14
  /**
15
15
  * The CAIP-2 chain ID to send the transaction on. Defaults to `eip155:1`.
@@ -63,9 +63,9 @@ export declare const TransactionOptionsStruct: import("@metamask/superstruct").S
63
63
  data: import("@metamask/superstruct").Struct<`0x${string}`, null>;
64
64
  }>;
65
65
  export declare const SignatureOptionsStruct: import("@metamask/superstruct").Struct<{
66
+ data: `0x${string}` | Record<string, any> | Record<string, any>[];
66
67
  origin: string;
67
68
  from: `0x${string}`;
68
- data: `0x${string}` | Record<string, any> | Record<string, any>[];
69
69
  signatureMethod: "eth_signTypedData" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "personal_sign";
70
70
  }, {
71
71
  /**
@@ -128,8 +128,8 @@ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/super
128
128
  id: string;
129
129
  notifications: {
130
130
  id: string;
131
- type: "inApp" | "native";
132
131
  message: string;
132
+ type: "inApp" | "native";
133
133
  title?: string | undefined;
134
134
  content?: string | undefined;
135
135
  footerLink?: {
@@ -142,6 +142,22 @@ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/super
142
142
  } | {
143
143
  error: import("@metamask/snaps-sdk").Json;
144
144
  };
145
+ tracked: {
146
+ events: {
147
+ event: string;
148
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
149
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
150
+ }[];
151
+ errors: import("@metamask/snaps-sdk").TrackableError[];
152
+ traces: {
153
+ name: string;
154
+ id?: string | undefined;
155
+ data?: Record<string, string | number | boolean> | undefined;
156
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
157
+ startTime?: number | undefined;
158
+ tags?: Record<string, string | number | boolean> | undefined;
159
+ }[];
160
+ };
145
161
  }, {
146
162
  id: import("@metamask/superstruct").Struct<string, null>;
147
163
  response: import("@metamask/superstruct").Struct<{
@@ -151,8 +167,8 @@ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/super
151
167
  }, null>;
152
168
  notifications: import("@metamask/superstruct").Struct<{
153
169
  id: string;
154
- type: "inApp" | "native";
155
170
  message: string;
171
+ type: "inApp" | "native";
156
172
  title?: string | undefined;
157
173
  content?: string | undefined;
158
174
  footerLink?: {
@@ -161,8 +177,8 @@ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/super
161
177
  } | undefined;
162
178
  }[], import("@metamask/superstruct").Struct<{
163
179
  id: string;
164
- type: "inApp" | "native";
165
180
  message: string;
181
+ type: "inApp" | "native";
166
182
  title?: string | undefined;
167
183
  content?: string | undefined;
168
184
  footerLink?: {
@@ -183,14 +199,66 @@ export declare const SnapResponseWithoutInterfaceStruct: import("@metamask/super
183
199
  text: import("@metamask/superstruct").Struct<string, null>;
184
200
  }>;
185
201
  }>>;
202
+ tracked: import("@metamask/superstruct").Struct<{
203
+ events: {
204
+ event: string;
205
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
206
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
207
+ }[];
208
+ errors: import("@metamask/snaps-sdk").TrackableError[];
209
+ traces: {
210
+ name: string;
211
+ id?: string | undefined;
212
+ data?: Record<string, string | number | boolean> | undefined;
213
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
214
+ startTime?: number | undefined;
215
+ tags?: Record<string, string | number | boolean> | undefined;
216
+ }[];
217
+ }, {
218
+ errors: import("@metamask/superstruct").Struct<import("@metamask/snaps-sdk").TrackableError[], import("@metamask/superstruct").Struct<import("@metamask/snaps-sdk").TrackableError, unknown>>;
219
+ events: import("@metamask/superstruct").Struct<{
220
+ event: string;
221
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
222
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
223
+ }[], import("@metamask/superstruct").Struct<{
224
+ event: string;
225
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
226
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
227
+ }, {
228
+ event: import("@metamask/superstruct").Struct<string, null>;
229
+ properties: import("@metamask/superstruct").Struct<Record<string, import("@metamask/snaps-sdk").Json> | undefined, null>;
230
+ sensitiveProperties: import("@metamask/superstruct").Struct<Record<string, import("@metamask/snaps-sdk").Json> | undefined, null>;
231
+ }>>;
232
+ traces: import("@metamask/superstruct").Struct<{
233
+ name: string;
234
+ id?: string | undefined;
235
+ data?: Record<string, string | number | boolean> | undefined;
236
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
237
+ startTime?: number | undefined;
238
+ tags?: Record<string, string | number | boolean> | undefined;
239
+ }[], import("@metamask/superstruct").Struct<{
240
+ name: string;
241
+ id?: string | undefined;
242
+ data?: Record<string, string | number | boolean> | undefined;
243
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
244
+ startTime?: number | undefined;
245
+ tags?: Record<string, string | number | boolean> | undefined;
246
+ }, {
247
+ id: import("@metamask/superstruct").Struct<string | undefined, null>;
248
+ name: import("@metamask/superstruct").Struct<string, null>;
249
+ parentContext: import("@metamask/superstruct").Struct<import("@metamask/snaps-sdk").Json | undefined, unknown>;
250
+ startTime: import("@metamask/superstruct").Struct<number | undefined, null>;
251
+ data: import("@metamask/superstruct").Struct<Record<string, string | number | boolean> | undefined, null>;
252
+ tags: import("@metamask/superstruct").Struct<Record<string, string | number | boolean> | undefined, null>;
253
+ }>>;
254
+ }>;
186
255
  }>;
187
256
  export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstruct").Struct<{
188
257
  id: string;
189
- getInterface: Function;
190
258
  notifications: {
191
259
  id: string;
192
- type: "inApp" | "native";
193
260
  message: string;
261
+ type: "inApp" | "native";
194
262
  title?: string | undefined;
195
263
  content?: string | undefined;
196
264
  footerLink?: {
@@ -198,18 +266,35 @@ export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstr
198
266
  href: string;
199
267
  } | undefined;
200
268
  }[];
269
+ getInterface: Function;
201
270
  response: {
202
271
  result: import("@metamask/snaps-sdk").Json;
203
272
  } | {
204
273
  error: import("@metamask/snaps-sdk").Json;
205
274
  };
275
+ tracked: {
276
+ events: {
277
+ event: string;
278
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
279
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
280
+ }[];
281
+ errors: import("@metamask/snaps-sdk").TrackableError[];
282
+ traces: {
283
+ name: string;
284
+ id?: string | undefined;
285
+ data?: Record<string, string | number | boolean> | undefined;
286
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
287
+ startTime?: number | undefined;
288
+ tags?: Record<string, string | number | boolean> | undefined;
289
+ }[];
290
+ };
206
291
  }, {
207
292
  getInterface: import("@metamask/superstruct").Struct<Function, null>;
208
293
  id: import("@metamask/superstruct").Struct<string, null>;
209
294
  notifications: import("@metamask/superstruct").Struct<{
210
295
  id: string;
211
- type: "inApp" | "native";
212
296
  message: string;
297
+ type: "inApp" | "native";
213
298
  title?: string | undefined;
214
299
  content?: string | undefined;
215
300
  footerLink?: {
@@ -218,8 +303,8 @@ export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstr
218
303
  } | undefined;
219
304
  }[], import("@metamask/superstruct").Struct<{
220
305
  id: string;
221
- type: "inApp" | "native";
222
306
  message: string;
307
+ type: "inApp" | "native";
223
308
  title?: string | undefined;
224
309
  content?: string | undefined;
225
310
  footerLink?: {
@@ -245,13 +330,66 @@ export declare const SnapResponseWithInterfaceStruct: import("@metamask/superstr
245
330
  } | {
246
331
  error: import("@metamask/snaps-sdk").Json;
247
332
  }, null>;
333
+ tracked: import("@metamask/superstruct").Struct<{
334
+ events: {
335
+ event: string;
336
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
337
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
338
+ }[];
339
+ errors: import("@metamask/snaps-sdk").TrackableError[];
340
+ traces: {
341
+ name: string;
342
+ id?: string | undefined;
343
+ data?: Record<string, string | number | boolean> | undefined;
344
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
345
+ startTime?: number | undefined;
346
+ tags?: Record<string, string | number | boolean> | undefined;
347
+ }[];
348
+ }, {
349
+ errors: import("@metamask/superstruct").Struct<import("@metamask/snaps-sdk").TrackableError[], import("@metamask/superstruct").Struct<import("@metamask/snaps-sdk").TrackableError, unknown>>;
350
+ events: import("@metamask/superstruct").Struct<{
351
+ event: string;
352
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
353
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
354
+ }[], import("@metamask/superstruct").Struct<{
355
+ event: string;
356
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
357
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
358
+ }, {
359
+ event: import("@metamask/superstruct").Struct<string, null>;
360
+ properties: import("@metamask/superstruct").Struct<Record<string, import("@metamask/snaps-sdk").Json> | undefined, null>;
361
+ sensitiveProperties: import("@metamask/superstruct").Struct<Record<string, import("@metamask/snaps-sdk").Json> | undefined, null>;
362
+ }>>;
363
+ traces: import("@metamask/superstruct").Struct<{
364
+ name: string;
365
+ id?: string | undefined;
366
+ data?: Record<string, string | number | boolean> | undefined;
367
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
368
+ startTime?: number | undefined;
369
+ tags?: Record<string, string | number | boolean> | undefined;
370
+ }[], import("@metamask/superstruct").Struct<{
371
+ name: string;
372
+ id?: string | undefined;
373
+ data?: Record<string, string | number | boolean> | undefined;
374
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
375
+ startTime?: number | undefined;
376
+ tags?: Record<string, string | number | boolean> | undefined;
377
+ }, {
378
+ id: import("@metamask/superstruct").Struct<string | undefined, null>;
379
+ name: import("@metamask/superstruct").Struct<string, null>;
380
+ parentContext: import("@metamask/superstruct").Struct<import("@metamask/snaps-sdk").Json | undefined, unknown>;
381
+ startTime: import("@metamask/superstruct").Struct<number | undefined, null>;
382
+ data: import("@metamask/superstruct").Struct<Record<string, string | number | boolean> | undefined, null>;
383
+ tags: import("@metamask/superstruct").Struct<Record<string, string | number | boolean> | undefined, null>;
384
+ }>>;
385
+ }>;
248
386
  }>;
249
387
  export declare const SnapResponseStruct: import("@metamask/superstruct").Struct<{
250
388
  id: string;
251
389
  notifications: {
252
390
  id: string;
253
- type: "inApp" | "native";
254
391
  message: string;
392
+ type: "inApp" | "native";
255
393
  title?: string | undefined;
256
394
  content?: string | undefined;
257
395
  footerLink?: {
@@ -264,13 +402,28 @@ export declare const SnapResponseStruct: import("@metamask/superstruct").Struct<
264
402
  } | {
265
403
  error: import("@metamask/snaps-sdk").Json;
266
404
  };
405
+ tracked: {
406
+ events: {
407
+ event: string;
408
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
409
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
410
+ }[];
411
+ errors: import("@metamask/snaps-sdk").TrackableError[];
412
+ traces: {
413
+ name: string;
414
+ id?: string | undefined;
415
+ data?: Record<string, string | number | boolean> | undefined;
416
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
417
+ startTime?: number | undefined;
418
+ tags?: Record<string, string | number | boolean> | undefined;
419
+ }[];
420
+ };
267
421
  } | {
268
422
  id: string;
269
- getInterface: Function;
270
423
  notifications: {
271
424
  id: string;
272
- type: "inApp" | "native";
273
425
  message: string;
426
+ type: "inApp" | "native";
274
427
  title?: string | undefined;
275
428
  content?: string | undefined;
276
429
  footerLink?: {
@@ -278,11 +431,28 @@ export declare const SnapResponseStruct: import("@metamask/superstruct").Struct<
278
431
  href: string;
279
432
  } | undefined;
280
433
  }[];
434
+ getInterface: Function;
281
435
  response: {
282
436
  result: import("@metamask/snaps-sdk").Json;
283
437
  } | {
284
438
  error: import("@metamask/snaps-sdk").Json;
285
439
  };
440
+ tracked: {
441
+ events: {
442
+ event: string;
443
+ properties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
444
+ sensitiveProperties?: Record<string, import("@metamask/snaps-sdk").Json> | undefined;
445
+ }[];
446
+ errors: import("@metamask/snaps-sdk").TrackableError[];
447
+ traces: {
448
+ name: string;
449
+ id?: string | undefined;
450
+ data?: Record<string, string | number | boolean> | undefined;
451
+ parentContext?: import("@metamask/snaps-sdk").Json | undefined;
452
+ startTime?: number | undefined;
453
+ tags?: Record<string, string | number | boolean> | undefined;
454
+ }[];
455
+ };
286
456
  }, null>;
287
457
  /**
288
458
  * Ensure that the actual response contains `getInterface`.
@@ -1 +1 @@
1
- {"version":3,"file":"structs.d.mts","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,YAAY,EAAE,yBAAyB,EAAE,oBAAgB;AAUvE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;IACnC;;OAEG;;IAGH;;OAEG;;IAGH;;;OAGG;;IAUH;;;OAGG;;IAUH;;;OAGG;;IAQH;;;OAGG;;IAQH;;;;OAIG;;IAQH;;;;OAIG;;IAQH;;;OAGG;;IAQH;;;OAGG;;EAOH,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;IACjC;;OAEG;;IAGH;;;OAGG;;IASH;;;;OAIG;;IAWH;;OAEG;;EAUH,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;IACtC;;OAEG;;EAEH,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;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H,eAAO,MAAM,eAAe;;;;EAE1B,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyD7C,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK3C,CAAC;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAG7B,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,QAAQ,IAAI,yBAAyB,CAE/C"}
package/dist/structs.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { NotificationType, enumValue } from "@metamask/snaps-sdk";
2
2
  import { JSXElementStruct } from "@metamask/snaps-sdk/jsx";
3
- import { array, assign, bigint, coerce, defaulted, instance, literal, number, object, optional, string, union, record, any, func, type } from "@metamask/superstruct";
3
+ import { TrackableErrorStruct } from "@metamask/snaps-utils";
4
+ import { array, assign, bigint, coerce, defaulted, instance, literal, number, object, optional, string, union, record, any, func, type, boolean } from "@metamask/superstruct";
4
5
  import { assertStruct, bytesToHex, JsonStruct, StrictHexStruct, valueToBytes } from "@metamask/utils";
5
6
  import { randomBytes } from "crypto";
6
7
  // TODO: Export this from `@metamask/utils` instead.
@@ -168,6 +169,22 @@ export const SnapResponseWithoutInterfaceStruct = object({
168
169
  text: string(),
169
170
  })),
170
171
  })),
172
+ tracked: object({
173
+ errors: array(TrackableErrorStruct),
174
+ events: array(object({
175
+ event: string(),
176
+ properties: optional(record(string(), JsonStruct)),
177
+ sensitiveProperties: optional(record(string(), JsonStruct)),
178
+ })),
179
+ traces: array(object({
180
+ id: optional(string()),
181
+ name: string(),
182
+ parentContext: optional(JsonStruct),
183
+ startTime: optional(number()),
184
+ data: optional(record(string(), union([string(), number(), boolean()]))),
185
+ tags: optional(record(string(), union([string(), number(), boolean()]))),
186
+ })),
187
+ }),
171
188
  });
172
189
  export const SnapResponseWithInterfaceStruct = assign(SnapResponseWithoutInterfaceStruct, object({
173
190
  getInterface: func(),
@@ -1 +1 @@
1
- {"version":3,"file":"structs.mjs","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,4BAA4B;AAClE,OAAO,EAAE,gBAAgB,EAAE,gCAAgC;AAC3D,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,GAAG,EACH,IAAI,EACJ,IAAI,EACL,8BAA8B;AAC/B,OAAO,EACL,YAAY,EACZ,UAAU,EACV,UAAU,EACV,eAAe,EACf,YAAY,EACb,wBAAwB;AACzB,OAAO,EAAE,WAAW,EAAE,eAAe;AAIrC,oDAAoD;AACpD,MAAM,eAAe,GAAG,KAAK,CAAC;IAC5B,MAAM,EAAE;IACR,MAAM,EAAE;IACR,MAAM,EAAE;IACR,QAAQ,CAAC,UAAU,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC;IAC7C;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAExC;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC;IAE1C;;;OAGG;IACH,gDAAgD;IAChD,IAAI,EAAE,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a,EAAE,KAAK,CAClB,MAAM,CAAC;QACL,EAAE,EAAE,MAAM,EAAE;QACZ,OAAO,EAAE,MAAM,EAAE;QACjB,IAAI,EAAE,KAAK,CAAC;YACV,SAAS,CAAC,gBAAgB,CAAC,KAAK,CAAC;YACjC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC;SACnC,CAAC;QACF,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QACzB,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC3B,UAAU,EAAE,QAAQ,CAClB,MAAM,CAAC;YACL,IAAI,EAAE,MAAM,EAAE;YACd,IAAI,EAAE,MAAM,EAAE;SACf,CAAC,CACH;KACF,CAAC,CACH;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CACnD,kCAAkC,EAClC,MAAM,CAAC;IACL,YAAY,EAAE,IAAI,EAAE;CACrB,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;IACtC,kCAAkC;IAClC,+BAA+B;CAChC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAsB;IAEtB,YAAY,CAAC,QAAQ,EAAE,+BAA+B,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import { NotificationType, enumValue } from '@metamask/snaps-sdk';\nimport { JSXElementStruct } from '@metamask/snaps-sdk/jsx';\nimport {\n array,\n assign,\n bigint,\n coerce,\n defaulted,\n instance,\n literal,\n number,\n object,\n optional,\n string,\n union,\n record,\n any,\n func,\n type,\n} from '@metamask/superstruct';\nimport {\n assertStruct,\n bytesToHex,\n JsonStruct,\n StrictHexStruct,\n valueToBytes,\n} from '@metamask/utils';\nimport { randomBytes } from 'crypto';\n\nimport type { SnapResponse, SnapResponseWithInterface } from './types';\n\n// TODO: Export this from `@metamask/utils` instead.\nconst BytesLikeStruct = union([\n bigint(),\n number(),\n string(),\n instance(Uint8Array),\n]);\n\nexport const TransactionOptionsStruct = object({\n /**\n * The CAIP-2 chain ID to send the transaction on. Defaults to `eip155:1`.\n */\n chainId: defaulted(string(), 'eip155:1'),\n\n /**\n * The origin to send the transaction from. Defaults to `metamask.io`.\n */\n origin: defaulted(string(), 'metamask.io'),\n\n /**\n * The address to send the transaction from. Defaults to a randomly generated\n * address.\n */\n // TODO: Move this coercer to `@metamask/utils`.\n from: coerce(StrictHexStruct, optional(BytesLikeStruct), (value) => {\n if (value) {\n return bytesToHex(valueToBytes(value));\n }\n\n return bytesToHex(randomBytes(20));\n }),\n\n /**\n * The address to send the transaction to. Defaults to a randomly generated\n * address.\n */\n // TODO: Move this coercer to `@metamask/utils`.\n to: coerce(StrictHexStruct, optional(BytesLikeStruct), (value) => {\n if (value) {\n return bytesToHex(valueToBytes(value));\n }\n\n return bytesToHex(randomBytes(20));\n }),\n\n /**\n * The value to send with the transaction. The value may be specified as a\n * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0`.\n */\n value: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n '0x0',\n ),\n\n /**\n * The gas limit to use for the transaction. The gas limit may be specified\n * as a `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `21_000`.\n */\n gasLimit: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n valueToBytes(21_000),\n ),\n\n /**\n * The max fee per gas (in Wei) to use for the transaction. The max fee per\n * gas may be specified as a `number`, `bigint`, `string`, or `Uint8Array`.\n * Defaults to `1`.\n */\n maxFeePerGas: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n valueToBytes(1),\n ),\n\n /**\n * The max priority fee per gas (in Wei) to use for the transaction. The max\n * priority fee per gas may be specified as a `number`, `bigint`, `string`,\n * or `Uint8Array`. Defaults to `1`.\n */\n maxPriorityFeePerGas: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n valueToBytes(1),\n ),\n\n /**\n * The nonce to use for the transaction. The nonce may be specified as a\n * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0`.\n */\n nonce: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n valueToBytes(0),\n ),\n\n /**\n * The data to send with the transaction. The data may be specified as a\n * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0x`.\n */\n data: defaulted(\n coerce(union([StrictHexStruct, literal('0x')]), BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n '0x',\n ),\n});\n\nexport const SignatureOptionsStruct = object({\n /**\n * The origin making the signature request.\n */\n origin: defaulted(string(), 'metamask.io'),\n\n /**\n * The address signing the signature request. Defaults to a randomly generated\n * address.\n */\n from: coerce(StrictHexStruct, optional(BytesLikeStruct), (value) => {\n if (value) {\n return bytesToHex(valueToBytes(value));\n }\n\n return bytesToHex(randomBytes(20));\n }),\n\n /**\n * The data to send with the transaction. The data may be specified as a\n * `string`, an object, or an array of objects. This covers the data types\n * for the supported signature methods. Defaults to `0x`.\n */\n data: defaulted(\n union([\n StrictHexStruct,\n literal('0x'),\n record(string(), any()),\n array(record(string(), any())),\n ]),\n '0x',\n ),\n\n /**\n * The signature method being used.\n */\n signatureMethod: defaulted(\n union([\n literal('personal_sign'),\n literal('eth_signTypedData'),\n literal('eth_signTypedData_v3'),\n literal('eth_signTypedData_v4'),\n ]),\n 'personal_sign',\n ),\n});\n\nexport const BaseNameLookupOptionsStruct = object({\n /**\n * The CAIP-2 chain ID. Defaults to `eip155:1`.\n */\n chainId: defaulted(string(), 'eip155:1'),\n});\n\nexport const NameLookupOptionsStruct = union([\n assign(\n BaseNameLookupOptionsStruct,\n object({\n /**\n * Address to lookup.\n */\n address: string(),\n }),\n ),\n assign(\n BaseNameLookupOptionsStruct,\n object({\n /**\n * Domain name to lookup.\n */\n domain: string(),\n }),\n ),\n]);\n\nexport const SnapOptionsStruct = object({\n /**\n * The timeout in milliseconds to use for requests to the snap. Defaults to\n * `1000`.\n */\n timeout: defaulted(optional(number()), 1000),\n});\n\nexport const JsonRpcMockOptionsStruct = object({\n method: string(),\n result: JsonStruct,\n});\n\nexport const InterfaceStruct = type({\n content: optional(JSXElementStruct),\n});\n\nexport const SnapResponseWithoutInterfaceStruct = object({\n id: string(),\n\n response: union([\n object({\n result: JsonStruct,\n }),\n object({\n error: JsonStruct,\n }),\n ]),\n\n notifications: array(\n object({\n id: string(),\n message: string(),\n type: union([\n enumValue(NotificationType.InApp),\n enumValue(NotificationType.Native),\n ]),\n title: optional(string()),\n content: optional(string()),\n footerLink: optional(\n object({\n href: string(),\n text: string(),\n }),\n ),\n }),\n ),\n});\n\nexport const SnapResponseWithInterfaceStruct = assign(\n SnapResponseWithoutInterfaceStruct,\n object({\n getInterface: func(),\n }),\n);\n\nexport const SnapResponseStruct = union([\n SnapResponseWithoutInterfaceStruct,\n SnapResponseWithInterfaceStruct,\n]);\n\n/**\n * Ensure that the actual response contains `getInterface`.\n *\n * @param response - The response of the handler.\n */\nexport function assertIsResponseWithInterface(\n response: SnapResponse,\n): asserts response is SnapResponseWithInterface {\n assertStruct(response, SnapResponseWithInterfaceStruct);\n}\n"]}
1
+ {"version":3,"file":"structs.mjs","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,4BAA4B;AAClE,OAAO,EAAE,gBAAgB,EAAE,gCAAgC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,8BAA8B;AAC7D,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,SAAS,EACT,QAAQ,EACR,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,GAAG,EACH,IAAI,EACJ,IAAI,EACJ,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,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC;SAC5D,CAAC,CACH;QAED,MAAM,EAAE,KAAK,CACX,MAAM,CAAC;YACL,EAAE,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;YACtB,IAAI,EAAE,MAAM,EAAE;YACd,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC;YACnC,SAAS,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;YAC7B,IAAI,EAAE,QAAQ,CACZ,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CACzD;YACD,IAAI,EAAE,QAAQ,CACZ,MAAM,CAAC,MAAM,EAAE,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,CACzD;SACF,CAAC,CACH;KACF,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CACnD,kCAAkC,EAClC,MAAM,CAAC;IACL,YAAY,EAAE,IAAI,EAAE;CACrB,CAAC,CACH,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;IACtC,kCAAkC;IAClC,+BAA+B;CAChC,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,UAAU,6BAA6B,CAC3C,QAAsB;IAEtB,YAAY,CAAC,QAAQ,EAAE,+BAA+B,CAAC,CAAC;AAC1D,CAAC","sourcesContent":["import { NotificationType, enumValue } from '@metamask/snaps-sdk';\nimport { JSXElementStruct } from '@metamask/snaps-sdk/jsx';\nimport { TrackableErrorStruct } from '@metamask/snaps-utils';\nimport {\n array,\n assign,\n bigint,\n coerce,\n defaulted,\n instance,\n literal,\n number,\n object,\n optional,\n string,\n union,\n record,\n any,\n func,\n type,\n boolean,\n} from '@metamask/superstruct';\nimport {\n assertStruct,\n bytesToHex,\n JsonStruct,\n StrictHexStruct,\n valueToBytes,\n} from '@metamask/utils';\nimport { randomBytes } from 'crypto';\n\nimport type { SnapResponse, SnapResponseWithInterface } from './types';\n\n// TODO: Export this from `@metamask/utils` instead.\nconst BytesLikeStruct = union([\n bigint(),\n number(),\n string(),\n instance(Uint8Array),\n]);\n\nexport const TransactionOptionsStruct = object({\n /**\n * The CAIP-2 chain ID to send the transaction on. Defaults to `eip155:1`.\n */\n chainId: defaulted(string(), 'eip155:1'),\n\n /**\n * The origin to send the transaction from. Defaults to `metamask.io`.\n */\n origin: defaulted(string(), 'metamask.io'),\n\n /**\n * The address to send the transaction from. Defaults to a randomly generated\n * address.\n */\n // TODO: Move this coercer to `@metamask/utils`.\n from: coerce(StrictHexStruct, optional(BytesLikeStruct), (value) => {\n if (value) {\n return bytesToHex(valueToBytes(value));\n }\n\n return bytesToHex(randomBytes(20));\n }),\n\n /**\n * The address to send the transaction to. Defaults to a randomly generated\n * address.\n */\n // TODO: Move this coercer to `@metamask/utils`.\n to: coerce(StrictHexStruct, optional(BytesLikeStruct), (value) => {\n if (value) {\n return bytesToHex(valueToBytes(value));\n }\n\n return bytesToHex(randomBytes(20));\n }),\n\n /**\n * The value to send with the transaction. The value may be specified as a\n * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0`.\n */\n value: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n '0x0',\n ),\n\n /**\n * The gas limit to use for the transaction. The gas limit may be specified\n * as a `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `21_000`.\n */\n gasLimit: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n valueToBytes(21_000),\n ),\n\n /**\n * The max fee per gas (in Wei) to use for the transaction. The max fee per\n * gas may be specified as a `number`, `bigint`, `string`, or `Uint8Array`.\n * Defaults to `1`.\n */\n maxFeePerGas: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n valueToBytes(1),\n ),\n\n /**\n * The max priority fee per gas (in Wei) to use for the transaction. The max\n * priority fee per gas may be specified as a `number`, `bigint`, `string`,\n * or `Uint8Array`. Defaults to `1`.\n */\n maxPriorityFeePerGas: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n valueToBytes(1),\n ),\n\n /**\n * The nonce to use for the transaction. The nonce may be specified as a\n * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0`.\n */\n nonce: defaulted(\n coerce(StrictHexStruct, BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n valueToBytes(0),\n ),\n\n /**\n * The data to send with the transaction. The data may be specified as a\n * `number`, `bigint`, `string`, or `Uint8Array`. Defaults to `0x`.\n */\n data: defaulted(\n coerce(union([StrictHexStruct, literal('0x')]), BytesLikeStruct, (value) =>\n bytesToHex(valueToBytes(value)),\n ),\n '0x',\n ),\n});\n\nexport const SignatureOptionsStruct = object({\n /**\n * The origin making the signature request.\n */\n origin: defaulted(string(), 'metamask.io'),\n\n /**\n * The address signing the signature request. Defaults to a randomly generated\n * address.\n */\n from: coerce(StrictHexStruct, optional(BytesLikeStruct), (value) => {\n if (value) {\n return bytesToHex(valueToBytes(value));\n }\n\n return bytesToHex(randomBytes(20));\n }),\n\n /**\n * The data to send with the transaction. The data may be specified as a\n * `string`, an object, or an array of objects. This covers the data types\n * for the supported signature methods. Defaults to `0x`.\n */\n data: defaulted(\n union([\n StrictHexStruct,\n literal('0x'),\n record(string(), any()),\n array(record(string(), any())),\n ]),\n '0x',\n ),\n\n /**\n * The signature method being used.\n */\n signatureMethod: defaulted(\n union([\n literal('personal_sign'),\n literal('eth_signTypedData'),\n literal('eth_signTypedData_v3'),\n literal('eth_signTypedData_v4'),\n ]),\n 'personal_sign',\n ),\n});\n\nexport const BaseNameLookupOptionsStruct = object({\n /**\n * The CAIP-2 chain ID. Defaults to `eip155:1`.\n */\n chainId: defaulted(string(), 'eip155:1'),\n});\n\nexport const NameLookupOptionsStruct = union([\n assign(\n BaseNameLookupOptionsStruct,\n object({\n /**\n * Address to lookup.\n */\n address: string(),\n }),\n ),\n assign(\n BaseNameLookupOptionsStruct,\n object({\n /**\n * Domain name to lookup.\n */\n domain: string(),\n }),\n ),\n]);\n\nexport const SnapOptionsStruct = object({\n /**\n * The timeout in milliseconds to use for requests to the snap. Defaults to\n * `1000`.\n */\n timeout: defaulted(optional(number()), 1000),\n});\n\nexport const JsonRpcMockOptionsStruct = object({\n method: string(),\n result: JsonStruct,\n});\n\nexport const InterfaceStruct = type({\n content: optional(JSXElementStruct),\n});\n\nexport const SnapResponseWithoutInterfaceStruct = object({\n id: string(),\n\n response: union([\n object({\n result: JsonStruct,\n }),\n object({\n error: JsonStruct,\n }),\n ]),\n\n notifications: array(\n object({\n id: string(),\n message: string(),\n type: union([\n enumValue(NotificationType.InApp),\n enumValue(NotificationType.Native),\n ]),\n title: optional(string()),\n content: optional(string()),\n footerLink: optional(\n object({\n href: string(),\n text: string(),\n }),\n ),\n }),\n ),\n\n tracked: object({\n errors: array(TrackableErrorStruct),\n\n events: array(\n object({\n event: string(),\n properties: optional(record(string(), JsonStruct)),\n sensitiveProperties: optional(record(string(), JsonStruct)),\n }),\n ),\n\n traces: array(\n object({\n id: optional(string()),\n name: string(),\n parentContext: optional(JsonStruct),\n startTime: optional(number()),\n data: optional(\n record(string(), union([string(), number(), boolean()])),\n ),\n tags: optional(\n record(string(), union([string(), number(), boolean()])),\n ),\n }),\n ),\n }),\n});\n\nexport const SnapResponseWithInterfaceStruct = assign(\n SnapResponseWithoutInterfaceStruct,\n object({\n getInterface: func(),\n }),\n);\n\nexport const SnapResponseStruct = union([\n SnapResponseWithoutInterfaceStruct,\n SnapResponseWithInterfaceStruct,\n]);\n\n/**\n * Ensure that the actual response contains `getInterface`.\n *\n * @param response - The response of the handler.\n */\nexport function assertIsResponseWithInterface(\n response: SnapResponse,\n): asserts response is SnapResponseWithInterface {\n assertStruct(response, SnapResponseWithInterfaceStruct);\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { NotificationType, EnumToUnion } from '@metamask/snaps-sdk';\nimport type { JSXElement } from '@metamask/snaps-sdk/jsx';\nimport type { InferMatching } from '@metamask/snaps-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport type {\n CaipChainId,\n Json,\n JsonRpcId,\n JsonRpcParams,\n} from '@metamask/utils';\n\nimport type {\n NameLookupOptionsStruct,\n SignatureOptionsStruct,\n SnapOptionsStruct,\n SnapResponseStruct,\n TransactionOptionsStruct,\n} from './structs';\n\nexport type RequestOptions = {\n /**\n * The JSON-RPC request ID.\n */\n id?: JsonRpcId;\n\n /**\n * The JSON-RPC method.\n */\n method: string;\n\n /**\n * The JSON-RPC params.\n */\n params?: JsonRpcParams;\n\n /**\n * The origin to send the request from.\n */\n origin?: string;\n};\n\n/**\n * The `runCronjob` options. This is the same as {@link RequestOptions}, except\n * that it does not have an `origin` property.\n */\nexport type CronjobOptions = Omit<RequestOptions, 'origin'>;\n\n/**\n * The options to use for transaction requests.\n *\n * @property chainId - The CAIP-2 chain ID to send the transaction on. Defaults\n * to `eip155:1`.\n * @property origin - The origin to send the transaction from. Defaults to\n * `metamask.io`.\n * @property from - The address to send the transaction from. Defaults to a\n * randomly generated address.\n * @property to - The address to send the transaction to. Defaults to a randomly\n * generated address.\n * @property value - The value to send with the transaction. Defaults to `0`.\n * @property data - The data to send with the transaction. Defaults to `0x`.\n * @property gasLimit - The gas limit to use for the transaction. Defaults to\n * `21_000`.\n * @property maxFeePerGas - The maximum fee per gas to use for the transaction.\n * Defaults to `1`.\n * @property maxPriorityFeePerGas - The maximum priority fee per gas to use for\n * the transaction. Defaults to `1`.\n * @property nonce - The nonce to use for the transaction. Defaults to `0`.\n */\nexport type TransactionOptions = Infer<typeof TransactionOptionsStruct>;\n\n/**\n * The options to use for keyring requests.\n */\nexport type KeyringOptions = RequestOptions;\n\n/**\n * The options to use for name lookup requests.\n *\n * @property chainId - Chain ID.\n * @property domain - Domain name to lookup and resolve.\n * @property address - Address to lookup and resolve.\n */\nexport type NameLookupOptions = Infer<typeof NameLookupOptionsStruct>;\n\n/**\n * The options to use for signature requests.\n *\n * @property origin - The origin to send the signature request from. Defaults to\n * `metamask.io`.\n * @property from - The address to send the signature from. Defaults to a\n * randomly generated address.\n * @property data - The data to sign. Defaults to `0x`.\n * @property signatureMethod - The signature method.\n */\nexport type SignatureOptions = Infer<typeof SignatureOptionsStruct>;\n\n/**\n * The options to use for requests to the snap.\n *\n * @property timeout - The timeout in milliseconds to use. Defaults to `1000`.\n */\nexport type SnapOptions = Infer<typeof SnapOptionsStruct>;\n\n/**\n * Options for uploading a file.\n *\n * @property fileName - The name of the file. By default, this is inferred from\n * the file path if it's a path, and defaults to an empty string if it's a\n * `Uint8Array`.\n * @property contentType - The content type of the file. By default, this is\n * inferred from the file name if it's a path, and defaults to\n * `application/octet-stream` if it's a `Uint8Array` or the content type cannot\n * be inferred from the file name.\n */\nexport type FileOptions = {\n fileName?: string;\n contentType?: string;\n};\n\nexport type SnapInterfaceActions = {\n /**\n * Click on an interface element.\n *\n * @param name - The element name to click.\n */\n clickElement(name: string): Promise<void>;\n\n /**\n * Type a value in a interface field.\n *\n * @param name - The element name to type in.\n * @param value - The value to type.\n */\n typeInField(name: string, value: string): Promise<void>;\n\n /**\n * Select an option with a value in a dropdown.\n *\n * @param name - The element name to type in.\n * @param value - The value to type.\n */\n selectInDropdown(name: string, value: string): Promise<void>;\n\n /**\n * Choose an option with a value from radio group.\n *\n * @param name - The element name to type in.\n * @param value - The value to type.\n */\n selectFromRadioGroup(name: string, value: string): Promise<void>;\n\n /**\n * Choose an option with a value from a Selector, AccountSelector or AssetSelector component.\n *\n * @param name - The element name to type in.\n * @param value - The value to select.\n */\n selectFromSelector(name: string, value: string): Promise<void>;\n\n /**\n * Upload a file.\n *\n * @param name - The element name to upload the file to.\n * @param file - The file to upload. This can be a path to a file or a\n * `Uint8Array` containing the file contents. If this is a path, the file is\n * resolved relative to the current working directory.\n * @param options - The file options.\n * @param options.fileName - The name of the file. By default, this is\n * inferred from the file path if it's a path, and defaults to an empty string\n * if it's a `Uint8Array`.\n * @param options.contentType - The content type of the file. By default, this\n * is inferred from the file name if it's a path, and defaults to\n * `application/octet-stream` if it's a `Uint8Array` or the content type\n * cannot be inferred from the file name.\n */\n uploadFile(\n name: string,\n file: string | Uint8Array,\n options?: FileOptions,\n ): Promise<void>;\n\n /**\n * Wait for the interface to be updated.\n */\n waitForUpdate: () => Promise<SnapHandlerInterface>;\n};\n\n/**\n * A `snap_dialog` alert interface.\n */\nexport type SnapAlertInterface = {\n /**\n * The type of the interface. This is always `alert`.\n */\n type: 'alert';\n\n /**\n * The content to show in the alert.\n */\n content: JSXElement;\n\n /**\n * The ID of the interface.\n */\n id: string;\n\n /**\n * Close the alert.\n */\n ok(): Promise<void>;\n};\n\n/**\n * A `snap_dialog` confirmation interface.\n */\nexport type SnapConfirmationInterface = {\n /**\n * The type of the interface. This is always `confirmation`.\n */\n type: 'confirmation';\n\n /**\n * The content to show in the confirmation.\n */\n content: JSXElement;\n\n /**\n * The ID of the interface.\n */\n id: string;\n\n /**\n * Close the confirmation.\n */\n ok(): Promise<void>;\n\n /**\n * Cancel the confirmation.\n */\n cancel(): Promise<void>;\n};\n\n/**\n * A `snap_dialog` prompt interface.\n */\nexport type SnapPromptInterface = {\n /**\n * The type of the interface. This is always `prompt`.\n */\n type: 'prompt';\n\n /**\n * The content to show in the prompt.\n */\n content: JSXElement;\n\n /**\n * The ID of the interface.\n */\n id: string;\n\n /**\n * Close the prompt.\n *\n * @param value - The value to close the prompt with.\n */\n ok(value?: string): Promise<void>;\n\n /**\n * Cancel the prompt.\n */\n cancel(): Promise<void>;\n};\n\n/**\n * A `snap_dialog` default interface that has a Footer with two buttons defined.\n * The approval of this confirmation is handled by the snap.\n */\nexport type DefaultSnapInterfaceWithFooter = {\n /**\n * The content to show in the interface.\n */\n content: JSXElement;\n\n /**\n * The ID of the interface.\n */\n id: string;\n};\n\n/**\n * A `snap_dialog` default interface that has a Footer with one button defined.\n * A cancel button is automatically applied to the interface in this case.\n */\nexport type DefaultSnapInterfaceWithPartialFooter =\n DefaultSnapInterfaceWithFooter & {\n /**\n * Cancel the dialog.\n */\n cancel(): Promise<void>;\n };\n\n/**\n * A `snap_dialog` default interface that has no Footer defined.\n * A cancel and ok button is automatically applied to the interface in this case.\n */\nexport type DefaultSnapInterfaceWithoutFooter =\n DefaultSnapInterfaceWithPartialFooter & {\n /**\n * Close the dialog.\n *\n */\n ok(): Promise<void>;\n };\n\nexport type DefaultSnapInterface = (\n | DefaultSnapInterfaceWithFooter\n | DefaultSnapInterfaceWithPartialFooter\n | DefaultSnapInterfaceWithoutFooter\n) & {\n type?: never;\n};\n\nexport type SnapInterface = (\n | SnapAlertInterface\n | SnapConfirmationInterface\n | SnapPromptInterface\n | DefaultSnapInterface\n) &\n SnapInterfaceActions;\n\nexport type SnapRequestObject = {\n /**\n * Get a user interface object from a snap. This will throw an error if the\n * snap does not show a user interface within the timeout.\n *\n * @param options - The options to use.\n * @param options.timeout - The timeout in milliseconds to use. Defaults to\n * `1000`.\n * @returns The user interface object.\n */\n getInterface(options?: SnapOptions): Promise<SnapInterface>;\n};\n\n/**\n * A pending request object. This is a promise with extra\n * {@link SnapRequestObject} fields.\n */\nexport type SnapRequest = Promise<SnapResponse> & SnapRequestObject;\n\n/**\n * The options to use for mocking a JSON-RPC request.\n */\nexport type JsonRpcMockOptions = {\n /**\n * The JSON-RPC request method.\n */\n method: string;\n\n /**\n * The JSON-RPC response, which will be returned when a request with the\n * specified method is sent.\n */\n result: Json;\n};\n\n/**\n * This is the main entry point to interact with the snap. It is returned by\n * {@link installSnap}, and has methods to send requests to the snap.\n *\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * const snap = await installSnap();\n * const response = await snap.request({ method: 'hello' });\n *\n * expect(response).toRespondWith('Hello, world!');\n */\nexport type Snap = {\n /**\n * Send a JSON-RPC request to the snap.\n *\n * @param request - The request. This is similar to a JSON-RPC request, but\n * has an extra `origin` field.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n request(request: RequestOptions): SnapRequest;\n\n /**\n * Send a transaction to the snap.\n *\n * @param transaction - The transaction. This is similar to an Ethereum\n * transaction object, but has an extra `origin` field. Any missing fields\n * will be filled in with default values.\n * @returns The response.\n */\n onTransaction(\n transaction?: Partial<TransactionOptions>,\n ): Promise<SnapResponseWithInterface>;\n\n /**\n * Send a transaction to the snap.\n *\n * @param transaction - The transaction. This is similar to an Ethereum\n * transaction object, but has an extra `origin` field. Any missing fields\n * will be filled in with default values.\n * @returns The response.\n * @deprecated Use {@link onTransaction} instead.\n */\n sendTransaction(\n transaction?: Partial<TransactionOptions>,\n ): Promise<SnapResponseWithInterface>;\n\n /**\n * Send a signature request to the snap.\n *\n * @param signature - The signature request object. Contains the params from\n * the various signature methods, but has an extra `origin` and `signatureMethod` field.\n * Any missing fields will be filled in with default values.\n * @returns The response.\n */\n onSignature(\n signature?: Partial<SignatureOptions>,\n ): Promise<SnapResponseWithInterface>;\n\n /**\n * Run a cronjob in the snap. This is similar to {@link request}, but the\n * request will be sent to the `onCronjob` method of the snap.\n *\n * @param cronjob - The cronjob request. This is similar to a JSON-RPC\n * request, and is normally specified in the snap manifest, under the\n * `endowment:cronjob` permission.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onCronjob(cronjob?: Partial<CronjobOptions>): SnapRequest;\n\n /**\n * Run a cronjob in the snap. This is similar to {@link request}, but the\n * request will be sent to the `onCronjob` method of the snap.\n *\n * @param cronjob - The cronjob request. This is similar to a JSON-RPC\n * request, and is normally specified in the snap manifest, under the\n * `endowment:cronjob` permission.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n * @deprecated Use {@link onCronjob} instead.\n */\n runCronjob(cronjob: CronjobOptions): SnapRequest;\n\n /**\n * Run a background event in the snap. This is similar to {@link request}, but the\n * request will be sent to the `onCronjob` method of the snap.\n *\n * @param backgroundEvent - The cronjob request. This is similar to a JSON-RPC\n * request, and is normally specified as the `request` param in the `snap_scheduleBackgroundEvent` method.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onBackgroundEvent(backgroundEvent: CronjobOptions): SnapRequest;\n\n /**\n * Get the response from the snap's `onHomePage` method.\n *\n * @returns The response.\n */\n onHomePage(): Promise<SnapResponseWithInterface>;\n\n /**\n * Get the response from the snap's `onSettingsPage` method.\n *\n * @returns The response.\n */\n onSettingsPage(): Promise<SnapResponseWithInterface>;\n\n /**\n * Send a keyring to the Snap.\n *\n * @param keyringRequest - Keyring request options.\n * @returns The response.\n */\n onKeyringRequest(keyringRequest: KeyringOptions): SnapRequest;\n\n /**\n * Get the response from the Snap's `onInstall` handler.\n *\n * @returns The response.\n */\n onInstall(request?: Pick<RequestOptions, 'origin'>): SnapRequest;\n\n /**\n * Get the response from the Snap's `onUpdate` handler.\n *\n * @returns The response.\n */\n onUpdate(request?: Pick<RequestOptions, 'origin'>): SnapRequest;\n\n /**\n * Get the response from the Snap's `onStart` handler.\n *\n * @returns The response.\n */\n onStart(request?: Pick<RequestOptions, 'origin'>): SnapRequest;\n\n /**\n * Get the response from the Snap's `onNameLookup` handler.\n *\n * @returns The response.\n */\n onNameLookup(\n nameLookupRequest: NameLookupOptions,\n ): Promise<SnapResponseWithoutInterface>;\n\n /**\n * Send a JSON-RPC protocol request to the Snap.\n *\n * @param scope - A CAIP-2 scope.\n * @param request - The request. This is similar to a JSON-RPC request, but\n * has an extra `origin` field.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onProtocolRequest(\n scope: CaipChainId,\n request: RequestOptions,\n ): Promise<SnapResponseWithoutInterface>;\n\n /**\n * Send a JSON-RPC client request to the Snap.\n *\n * @param request - The JSON-RPC request.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onClientRequest(request: Omit<RequestOptions, 'origin'>): SnapRequest;\n\n /**\n * Mock a JSON-RPC request. This will cause the snap to respond with the\n * specified response when a request with the specified method is sent.\n *\n * @param mock - The mock options.\n * @param mock.method - The JSON-RPC request method.\n * @param mock.result - The JSON-RPC response, which will be returned when a\n * request with the specified method is sent.\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * // In the test\n * const snap = await installSnap();\n * snap.mockJsonRpc({ method: 'eth_accounts', result: ['0x1234'] });\n *\n * // In the Snap\n * const response =\n * await ethereum.request({ method: 'eth_accounts' }); // ['0x1234']\n */\n mockJsonRpc(mock: JsonRpcMockOptions): {\n /**\n * Remove the mock.\n */\n unmock(): void;\n };\n\n /**\n * Close the page running the snap. This is mainly useful for cleaning up\n * the test environment, and calling it is not strictly necessary.\n *\n * @returns A promise that resolves when the page is closed.\n * @deprecated Snaps are now automatically closed when the test ends. This\n * method will be removed in a future release.\n */\n close(): Promise<void>;\n};\n\nexport type SnapHandlerInterface = {\n content: JSXElement;\n} & SnapInterfaceActions;\n\nexport type SnapResponseWithInterface = {\n id: string;\n response: { result: Json } | { error: Json };\n notifications: {\n id: string;\n message: string;\n type: EnumToUnion<NotificationType>;\n title?: string | undefined;\n content?: string | undefined;\n footerLink?: { text: string; href: string } | undefined;\n }[];\n getInterface(): SnapHandlerInterface;\n};\n\nexport type SnapResponseWithoutInterface = Omit<\n SnapResponseWithInterface,\n 'getInterface'\n>;\n\nexport type SnapResponseType =\n | SnapResponseWithoutInterface\n | SnapResponseWithInterface;\n\nexport type SnapResponse = InferMatching<\n typeof SnapResponseStruct,\n SnapResponseType\n>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n NotificationType,\n EnumToUnion,\n TrackableError,\n TraceRequest,\n} from '@metamask/snaps-sdk';\nimport type { JSXElement } from '@metamask/snaps-sdk/jsx';\nimport type { InferMatching } from '@metamask/snaps-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport type {\n CaipChainId,\n Json,\n JsonRpcId,\n JsonRpcParams,\n} from '@metamask/utils';\n\nimport type {\n NameLookupOptionsStruct,\n SignatureOptionsStruct,\n SnapOptionsStruct,\n SnapResponseStruct,\n TransactionOptionsStruct,\n} from './structs';\n\nexport type RequestOptions = {\n /**\n * The JSON-RPC request ID.\n */\n id?: JsonRpcId;\n\n /**\n * The JSON-RPC method.\n */\n method: string;\n\n /**\n * The JSON-RPC params.\n */\n params?: JsonRpcParams;\n\n /**\n * The origin to send the request from.\n */\n origin?: string;\n};\n\n/**\n * The `runCronjob` options. This is the same as {@link RequestOptions}, except\n * that it does not have an `origin` property.\n */\nexport type CronjobOptions = Omit<RequestOptions, 'origin'>;\n\n/**\n * The options to use for transaction requests.\n *\n * @property chainId - The CAIP-2 chain ID to send the transaction on. Defaults\n * to `eip155:1`.\n * @property origin - The origin to send the transaction from. Defaults to\n * `metamask.io`.\n * @property from - The address to send the transaction from. Defaults to a\n * randomly generated address.\n * @property to - The address to send the transaction to. Defaults to a randomly\n * generated address.\n * @property value - The value to send with the transaction. Defaults to `0`.\n * @property data - The data to send with the transaction. Defaults to `0x`.\n * @property gasLimit - The gas limit to use for the transaction. Defaults to\n * `21_000`.\n * @property maxFeePerGas - The maximum fee per gas to use for the transaction.\n * Defaults to `1`.\n * @property maxPriorityFeePerGas - The maximum priority fee per gas to use for\n * the transaction. Defaults to `1`.\n * @property nonce - The nonce to use for the transaction. Defaults to `0`.\n */\nexport type TransactionOptions = Infer<typeof TransactionOptionsStruct>;\n\n/**\n * The options to use for keyring requests.\n */\nexport type KeyringOptions = RequestOptions;\n\n/**\n * The options to use for name lookup requests.\n *\n * @property chainId - Chain ID.\n * @property domain - Domain name to lookup and resolve.\n * @property address - Address to lookup and resolve.\n */\nexport type NameLookupOptions = Infer<typeof NameLookupOptionsStruct>;\n\n/**\n * The options to use for signature requests.\n *\n * @property origin - The origin to send the signature request from. Defaults to\n * `metamask.io`.\n * @property from - The address to send the signature from. Defaults to a\n * randomly generated address.\n * @property data - The data to sign. Defaults to `0x`.\n * @property signatureMethod - The signature method.\n */\nexport type SignatureOptions = Infer<typeof SignatureOptionsStruct>;\n\n/**\n * The options to use for requests to the snap.\n *\n * @property timeout - The timeout in milliseconds to use. Defaults to `1000`.\n */\nexport type SnapOptions = Infer<typeof SnapOptionsStruct>;\n\n/**\n * Options for uploading a file.\n *\n * @property fileName - The name of the file. By default, this is inferred from\n * the file path if it's a path, and defaults to an empty string if it's a\n * `Uint8Array`.\n * @property contentType - The content type of the file. By default, this is\n * inferred from the file name if it's a path, and defaults to\n * `application/octet-stream` if it's a `Uint8Array` or the content type cannot\n * be inferred from the file name.\n */\nexport type FileOptions = {\n fileName?: string;\n contentType?: string;\n};\n\nexport type SnapInterfaceActions = {\n /**\n * Click on an interface element.\n *\n * @param name - The element name to click.\n */\n clickElement(name: string): Promise<void>;\n\n /**\n * Type a value in a interface field.\n *\n * @param name - The element name to type in.\n * @param value - The value to type.\n */\n typeInField(name: string, value: string): Promise<void>;\n\n /**\n * Select an option with a value in a dropdown.\n *\n * @param name - The element name to type in.\n * @param value - The value to type.\n */\n selectInDropdown(name: string, value: string): Promise<void>;\n\n /**\n * Choose an option with a value from radio group.\n *\n * @param name - The element name to type in.\n * @param value - The value to type.\n */\n selectFromRadioGroup(name: string, value: string): Promise<void>;\n\n /**\n * Choose an option with a value from a Selector, AccountSelector or AssetSelector component.\n *\n * @param name - The element name to type in.\n * @param value - The value to select.\n */\n selectFromSelector(name: string, value: string): Promise<void>;\n\n /**\n * Upload a file.\n *\n * @param name - The element name to upload the file to.\n * @param file - The file to upload. This can be a path to a file or a\n * `Uint8Array` containing the file contents. If this is a path, the file is\n * resolved relative to the current working directory.\n * @param options - The file options.\n * @param options.fileName - The name of the file. By default, this is\n * inferred from the file path if it's a path, and defaults to an empty string\n * if it's a `Uint8Array`.\n * @param options.contentType - The content type of the file. By default, this\n * is inferred from the file name if it's a path, and defaults to\n * `application/octet-stream` if it's a `Uint8Array` or the content type\n * cannot be inferred from the file name.\n */\n uploadFile(\n name: string,\n file: string | Uint8Array,\n options?: FileOptions,\n ): Promise<void>;\n\n /**\n * Wait for the interface to be updated.\n */\n waitForUpdate: () => Promise<SnapHandlerInterface>;\n};\n\n/**\n * A `snap_dialog` alert interface.\n */\nexport type SnapAlertInterface = {\n /**\n * The type of the interface. This is always `alert`.\n */\n type: 'alert';\n\n /**\n * The content to show in the alert.\n */\n content: JSXElement;\n\n /**\n * The ID of the interface.\n */\n id: string;\n\n /**\n * Close the alert.\n */\n ok(): Promise<void>;\n};\n\n/**\n * A `snap_dialog` confirmation interface.\n */\nexport type SnapConfirmationInterface = {\n /**\n * The type of the interface. This is always `confirmation`.\n */\n type: 'confirmation';\n\n /**\n * The content to show in the confirmation.\n */\n content: JSXElement;\n\n /**\n * The ID of the interface.\n */\n id: string;\n\n /**\n * Close the confirmation.\n */\n ok(): Promise<void>;\n\n /**\n * Cancel the confirmation.\n */\n cancel(): Promise<void>;\n};\n\n/**\n * A `snap_dialog` prompt interface.\n */\nexport type SnapPromptInterface = {\n /**\n * The type of the interface. This is always `prompt`.\n */\n type: 'prompt';\n\n /**\n * The content to show in the prompt.\n */\n content: JSXElement;\n\n /**\n * The ID of the interface.\n */\n id: string;\n\n /**\n * Close the prompt.\n *\n * @param value - The value to close the prompt with.\n */\n ok(value?: string): Promise<void>;\n\n /**\n * Cancel the prompt.\n */\n cancel(): Promise<void>;\n};\n\n/**\n * A `snap_dialog` default interface that has a Footer with two buttons defined.\n * The approval of this confirmation is handled by the snap.\n */\nexport type DefaultSnapInterfaceWithFooter = {\n /**\n * The content to show in the interface.\n */\n content: JSXElement;\n\n /**\n * The ID of the interface.\n */\n id: string;\n};\n\n/**\n * A `snap_dialog` default interface that has a Footer with one button defined.\n * A cancel button is automatically applied to the interface in this case.\n */\nexport type DefaultSnapInterfaceWithPartialFooter =\n DefaultSnapInterfaceWithFooter & {\n /**\n * Cancel the dialog.\n */\n cancel(): Promise<void>;\n };\n\n/**\n * A `snap_dialog` default interface that has no Footer defined.\n * A cancel and ok button is automatically applied to the interface in this case.\n */\nexport type DefaultSnapInterfaceWithoutFooter =\n DefaultSnapInterfaceWithPartialFooter & {\n /**\n * Close the dialog.\n *\n */\n ok(): Promise<void>;\n };\n\nexport type DefaultSnapInterface = (\n | DefaultSnapInterfaceWithFooter\n | DefaultSnapInterfaceWithPartialFooter\n | DefaultSnapInterfaceWithoutFooter\n) & {\n type?: never;\n};\n\nexport type SnapInterface = (\n | SnapAlertInterface\n | SnapConfirmationInterface\n | SnapPromptInterface\n | DefaultSnapInterface\n) &\n SnapInterfaceActions;\n\nexport type SnapRequestObject = {\n /**\n * Get a user interface object from a snap. This will throw an error if the\n * snap does not show a user interface within the timeout.\n *\n * @param options - The options to use.\n * @param options.timeout - The timeout in milliseconds to use. Defaults to\n * `1000`.\n * @returns The user interface object.\n */\n getInterface(options?: SnapOptions): Promise<SnapInterface>;\n};\n\n/**\n * A pending request object. This is a promise with extra\n * {@link SnapRequestObject} fields.\n */\nexport type SnapRequest = Promise<SnapResponse> & SnapRequestObject;\n\n/**\n * The options to use for mocking a JSON-RPC request.\n */\nexport type JsonRpcMockOptions = {\n /**\n * The JSON-RPC request method.\n */\n method: string;\n\n /**\n * The JSON-RPC response, which will be returned when a request with the\n * specified method is sent.\n */\n result: Json;\n};\n\n/**\n * This is the main entry point to interact with the snap. It is returned by\n * {@link installSnap}, and has methods to send requests to the snap.\n *\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * const snap = await installSnap();\n * const response = await snap.request({ method: 'hello' });\n *\n * expect(response).toRespondWith('Hello, world!');\n */\nexport type Snap = {\n /**\n * Send a JSON-RPC request to the snap.\n *\n * @param request - The request. This is similar to a JSON-RPC request, but\n * has an extra `origin` field.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n request(request: RequestOptions): SnapRequest;\n\n /**\n * Send a transaction to the snap.\n *\n * @param transaction - The transaction. This is similar to an Ethereum\n * transaction object, but has an extra `origin` field. Any missing fields\n * will be filled in with default values.\n * @returns The response.\n */\n onTransaction(\n transaction?: Partial<TransactionOptions>,\n ): Promise<SnapResponseWithInterface>;\n\n /**\n * Send a transaction to the snap.\n *\n * @param transaction - The transaction. This is similar to an Ethereum\n * transaction object, but has an extra `origin` field. Any missing fields\n * will be filled in with default values.\n * @returns The response.\n * @deprecated Use {@link onTransaction} instead.\n */\n sendTransaction(\n transaction?: Partial<TransactionOptions>,\n ): Promise<SnapResponseWithInterface>;\n\n /**\n * Send a signature request to the snap.\n *\n * @param signature - The signature request object. Contains the params from\n * the various signature methods, but has an extra `origin` and `signatureMethod` field.\n * Any missing fields will be filled in with default values.\n * @returns The response.\n */\n onSignature(\n signature?: Partial<SignatureOptions>,\n ): Promise<SnapResponseWithInterface>;\n\n /**\n * Run a cronjob in the snap. This is similar to {@link request}, but the\n * request will be sent to the `onCronjob` method of the snap.\n *\n * @param cronjob - The cronjob request. This is similar to a JSON-RPC\n * request, and is normally specified in the snap manifest, under the\n * `endowment:cronjob` permission.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onCronjob(cronjob?: Partial<CronjobOptions>): SnapRequest;\n\n /**\n * Run a cronjob in the snap. This is similar to {@link request}, but the\n * request will be sent to the `onCronjob` method of the snap.\n *\n * @param cronjob - The cronjob request. This is similar to a JSON-RPC\n * request, and is normally specified in the snap manifest, under the\n * `endowment:cronjob` permission.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n * @deprecated Use {@link onCronjob} instead.\n */\n runCronjob(cronjob: CronjobOptions): SnapRequest;\n\n /**\n * Run a background event in the snap. This is similar to {@link request}, but the\n * request will be sent to the `onCronjob` method of the snap.\n *\n * @param backgroundEvent - The cronjob request. This is similar to a JSON-RPC\n * request, and is normally specified as the `request` param in the `snap_scheduleBackgroundEvent` method.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onBackgroundEvent(backgroundEvent: CronjobOptions): SnapRequest;\n\n /**\n * Get the response from the snap's `onHomePage` method.\n *\n * @returns The response.\n */\n onHomePage(): Promise<SnapResponseWithInterface>;\n\n /**\n * Get the response from the snap's `onSettingsPage` method.\n *\n * @returns The response.\n */\n onSettingsPage(): Promise<SnapResponseWithInterface>;\n\n /**\n * Send a keyring to the Snap.\n *\n * @param keyringRequest - Keyring request options.\n * @returns The response.\n */\n onKeyringRequest(keyringRequest: KeyringOptions): SnapRequest;\n\n /**\n * Get the response from the Snap's `onInstall` handler.\n *\n * @returns The response.\n */\n onInstall(request?: Pick<RequestOptions, 'origin'>): SnapRequest;\n\n /**\n * Get the response from the Snap's `onUpdate` handler.\n *\n * @returns The response.\n */\n onUpdate(request?: Pick<RequestOptions, 'origin'>): SnapRequest;\n\n /**\n * Get the response from the Snap's `onStart` handler.\n *\n * @returns The response.\n */\n onStart(request?: Pick<RequestOptions, 'origin'>): SnapRequest;\n\n /**\n * Get the response from the Snap's `onNameLookup` handler.\n *\n * @returns The response.\n */\n onNameLookup(\n nameLookupRequest: NameLookupOptions,\n ): Promise<SnapResponseWithoutInterface>;\n\n /**\n * Send a JSON-RPC protocol request to the Snap.\n *\n * @param scope - A CAIP-2 scope.\n * @param request - The request. This is similar to a JSON-RPC request, but\n * has an extra `origin` field.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onProtocolRequest(\n scope: CaipChainId,\n request: RequestOptions,\n ): Promise<SnapResponseWithoutInterface>;\n\n /**\n * Send a JSON-RPC client request to the Snap.\n *\n * @param request - The JSON-RPC request.\n * @returns The response promise, with extra {@link SnapRequestObject} fields.\n */\n onClientRequest(request: Omit<RequestOptions, 'origin'>): SnapRequest;\n\n /**\n * Mock a JSON-RPC request. This will cause the snap to respond with the\n * specified response when a request with the specified method is sent.\n *\n * @param mock - The mock options.\n * @param mock.method - The JSON-RPC request method.\n * @param mock.result - The JSON-RPC response, which will be returned when a\n * request with the specified method is sent.\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * // In the test\n * const snap = await installSnap();\n * snap.mockJsonRpc({ method: 'eth_accounts', result: ['0x1234'] });\n *\n * // In the Snap\n * const response =\n * await ethereum.request({ method: 'eth_accounts' }); // ['0x1234']\n */\n mockJsonRpc(mock: JsonRpcMockOptions): {\n /**\n * Remove the mock.\n */\n unmock(): void;\n };\n\n /**\n * Close the page running the snap. This is mainly useful for cleaning up\n * the test environment, and calling it is not strictly necessary.\n *\n * @returns A promise that resolves when the page is closed.\n * @deprecated Snaps are now automatically closed when the test ends. This\n * method will be removed in a future release.\n */\n close(): Promise<void>;\n};\n\nexport type SnapHandlerInterface = {\n content: JSXElement;\n} & SnapInterfaceActions;\n\nexport type TrackedSnapResponseData = {\n errors: TrackableError[];\n events: {\n event: string;\n properties?: Record<string, Json>;\n sensitiveProperties?: Record<string, Json>;\n }[];\n traces: TraceRequest[];\n};\n\nexport type SnapResponseWithInterface = {\n id: string;\n response: { result: Json } | { error: Json };\n\n notifications: {\n id: string;\n message: string;\n type: EnumToUnion<NotificationType>;\n title?: string | undefined;\n content?: string | undefined;\n footerLink?: { text: string; href: string } | undefined;\n }[];\n\n tracked: TrackedSnapResponseData;\n\n getInterface(): SnapHandlerInterface;\n};\n\nexport type SnapResponseWithoutInterface = Omit<\n SnapResponseWithInterface,\n 'getInterface'\n>;\n\nexport type SnapResponseType =\n | SnapResponseWithoutInterface\n | SnapResponseWithInterface;\n\nexport type SnapResponse = InferMatching<\n typeof SnapResponseStruct,\n SnapResponseType\n>;\n"]}
package/dist/types.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import type { NotificationType, EnumToUnion } from "@metamask/snaps-sdk";
1
+ import type { NotificationType, EnumToUnion, TrackableError, TraceRequest } from "@metamask/snaps-sdk";
2
2
  import type { JSXElement } from "@metamask/snaps-sdk/jsx";
3
3
  import type { InferMatching } from "@metamask/snaps-utils";
4
4
  import type { Infer } from "@metamask/superstruct";
@@ -469,6 +469,15 @@ export type Snap = {
469
469
  export type SnapHandlerInterface = {
470
470
  content: JSXElement;
471
471
  } & SnapInterfaceActions;
472
+ export type TrackedSnapResponseData = {
473
+ errors: TrackableError[];
474
+ events: {
475
+ event: string;
476
+ properties?: Record<string, Json>;
477
+ sensitiveProperties?: Record<string, Json>;
478
+ }[];
479
+ traces: TraceRequest[];
480
+ };
472
481
  export type SnapResponseWithInterface = {
473
482
  id: string;
474
483
  response: {
@@ -487,6 +496,7 @@ export type SnapResponseWithInterface = {
487
496
  href: string;
488
497
  } | undefined;
489
498
  }[];
499
+ tracked: TrackedSnapResponseData;
490
500
  getInterface(): SnapHandlerInterface;
491
501
  };
492
502
  export type SnapResponseWithoutInterface = Omit<SnapResponseWithInterface, 'getInterface'>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,4BAA4B;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,gCAAgC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,8BAA8B;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AACnD,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EACJ,SAAS,EACT,aAAa,EACd,wBAAwB;AAEzB,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACzB,sBAAkB;AAEnB,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,EAAE,CAAC,EAAE,SAAS,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAE5D;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AM,CAAC;IACX,QAAQ,EAAE;QAAE,MAAM,EAAE,IAAI,CAAA;KAAE,GAAG;QAAE,KAAK,EAAE,IAAI,CAAA;KAAE,CAAC;IAE7C,aAAa,EAAE;QACb,EAAE,EAAE,MAAM,CAAC;QACX,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;QACpC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC7B,UAAU,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,GAAG,SAAS,CAAC;KACzD,EAAE,CAAC;IAEJ,OAAO,EAAE,uBAAuB,CAAC;IAEjC,YAAY,IAAI,oBAAoB,CAAC;CACtC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAC7C,yBAAyB,EACzB,cAAc,CACf,CAAC;AAEF,MAAM,MAAM,gBAAgB,GACxB,4BAA4B,GAC5B,yBAAyB,CAAC;AAE9B,MAAM,MAAM,YAAY,GAAG,aAAa,CACtC,OAAO,kBAAkB,EACzB,gBAAgB,CACjB,CAAC"}
package/dist/types.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import type { NotificationType, EnumToUnion } from "@metamask/snaps-sdk";
1
+ import type { NotificationType, EnumToUnion, TrackableError, TraceRequest } from "@metamask/snaps-sdk";
2
2
  import type { JSXElement } from "@metamask/snaps-sdk/jsx";
3
3
  import type { InferMatching } from "@metamask/snaps-utils";
4
4
  import type { Infer } from "@metamask/superstruct";
@@ -469,6 +469,15 @@ export type Snap = {
469
469
  export type SnapHandlerInterface = {
470
470
  content: JSXElement;
471
471
  } & SnapInterfaceActions;
472
+ export type TrackedSnapResponseData = {
473
+ errors: TrackableError[];
474
+ events: {
475
+ event: string;
476
+ properties?: Record<string, Json>;
477
+ sensitiveProperties?: Record<string, Json>;
478
+ }[];
479
+ traces: TraceRequest[];
480
+ };
472
481
  export type SnapResponseWithInterface = {
473
482
  id: string;
474
483
  response: {
@@ -487,6 +496,7 @@ export type SnapResponseWithInterface = {
487
496
  href: string;
488
497
  } | undefined;
489
498
  }[];
499
+ tracked: TrackedSnapResponseData;
490
500
  getInterface(): SnapHandlerInterface;
491
501
  };
492
502
  export type SnapResponseWithoutInterface = Omit<SnapResponseWithInterface, 'getInterface'>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,4BAA4B;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,gCAAgC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,8BAA8B;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AACnD,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EACJ,SAAS,EACT,aAAa,EACd,wBAAwB;AAEzB,OAAO,KAAK,EACV,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,EACzB,sBAAkB;AAEnB,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,EAAE,CAAC,EAAE,SAAS,CAAC;IAEf;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAExE;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC;AAE5C;;;;;;GAMG;AACH,MAA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