@metamask/keyring-api 11.0.0 → 11.1.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 (96) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/dist/KeyringClient.cjs +6 -0
  3. package/dist/KeyringClient.cjs.map +1 -1
  4. package/dist/KeyringClient.d.cts +3 -1
  5. package/dist/KeyringClient.d.cts.map +1 -1
  6. package/dist/KeyringClient.d.mts +3 -1
  7. package/dist/KeyringClient.d.mts.map +1 -1
  8. package/dist/KeyringClient.mjs +7 -1
  9. package/dist/KeyringClient.mjs.map +1 -1
  10. package/dist/api/asset.cjs +83 -0
  11. package/dist/api/asset.cjs.map +1 -0
  12. package/dist/api/asset.d.cts +93 -0
  13. package/dist/api/asset.d.cts.map +1 -0
  14. package/dist/api/asset.d.mts +93 -0
  15. package/dist/api/asset.d.mts.map +1 -0
  16. package/dist/api/asset.mjs +80 -0
  17. package/dist/api/asset.mjs.map +1 -0
  18. package/dist/api/balance.d.cts +1 -1
  19. package/dist/api/balance.d.mts +1 -1
  20. package/dist/api/index.cjs +2 -0
  21. package/dist/api/index.cjs.map +1 -1
  22. package/dist/api/index.d.cts +3 -1
  23. package/dist/api/index.d.cts.map +1 -1
  24. package/dist/api/index.d.mts +3 -1
  25. package/dist/api/index.d.mts.map +1 -1
  26. package/dist/api/index.mjs +2 -0
  27. package/dist/api/index.mjs.map +1 -1
  28. package/dist/api/keyring.cjs.map +1 -1
  29. package/dist/api/keyring.d.cts +14 -0
  30. package/dist/api/keyring.d.cts.map +1 -1
  31. package/dist/api/keyring.d.mts +14 -0
  32. package/dist/api/keyring.d.mts.map +1 -1
  33. package/dist/api/keyring.mjs.map +1 -1
  34. package/dist/api/transaction.cjs +295 -0
  35. package/dist/api/transaction.cjs.map +1 -0
  36. package/dist/api/transaction.d.cts +773 -0
  37. package/dist/api/transaction.d.cts.map +1 -0
  38. package/dist/api/transaction.d.mts +773 -0
  39. package/dist/api/transaction.d.mts.map +1 -0
  40. package/dist/api/transaction.mjs +292 -0
  41. package/dist/api/transaction.mjs.map +1 -0
  42. package/dist/eth/erc4337/types.d.cts +1 -1
  43. package/dist/eth/erc4337/types.d.mts +1 -1
  44. package/dist/internal/api.cjs +12 -1
  45. package/dist/internal/api.cjs.map +1 -1
  46. package/dist/internal/api.d.cts +318 -1
  47. package/dist/internal/api.d.cts.map +1 -1
  48. package/dist/internal/api.d.mts +318 -1
  49. package/dist/internal/api.d.mts.map +1 -1
  50. package/dist/internal/api.mjs +13 -2
  51. package/dist/internal/api.mjs.map +1 -1
  52. package/dist/internal/rpc.cjs +1 -0
  53. package/dist/internal/rpc.cjs.map +1 -1
  54. package/dist/internal/rpc.d.cts +1 -0
  55. package/dist/internal/rpc.d.cts.map +1 -1
  56. package/dist/internal/rpc.d.mts +1 -0
  57. package/dist/internal/rpc.d.mts.map +1 -1
  58. package/dist/internal/rpc.mjs +1 -0
  59. package/dist/internal/rpc.mjs.map +1 -1
  60. package/dist/rpc-handler.cjs +7 -0
  61. package/dist/rpc-handler.cjs.map +1 -1
  62. package/dist/rpc-handler.d.cts.map +1 -1
  63. package/dist/rpc-handler.d.mts.map +1 -1
  64. package/dist/rpc-handler.mjs +8 -1
  65. package/dist/rpc-handler.mjs.map +1 -1
  66. package/dist/superstruct.cjs +29 -0
  67. package/dist/superstruct.cjs.map +1 -1
  68. package/dist/superstruct.d.cts +19 -1
  69. package/dist/superstruct.d.cts.map +1 -1
  70. package/dist/superstruct.d.mts +19 -1
  71. package/dist/superstruct.d.mts.map +1 -1
  72. package/dist/superstruct.mjs +28 -0
  73. package/dist/superstruct.mjs.map +1 -1
  74. package/dist/utils/index.cjs +1 -0
  75. package/dist/utils/index.cjs.map +1 -1
  76. package/dist/utils/index.d.cts +1 -0
  77. package/dist/utils/index.d.cts.map +1 -1
  78. package/dist/utils/index.d.mts +1 -0
  79. package/dist/utils/index.d.mts.map +1 -1
  80. package/dist/utils/index.mjs +1 -0
  81. package/dist/utils/index.mjs.map +1 -1
  82. package/dist/utils/pagination.cjs +28 -0
  83. package/dist/utils/pagination.cjs.map +1 -0
  84. package/dist/utils/pagination.d.cts +59 -0
  85. package/dist/utils/pagination.d.cts.map +1 -0
  86. package/dist/utils/pagination.d.mts +59 -0
  87. package/dist/utils/pagination.d.mts.map +1 -0
  88. package/dist/utils/pagination.mjs +25 -0
  89. package/dist/utils/pagination.mjs.map +1 -0
  90. package/dist/utils/types.cjs.map +1 -1
  91. package/dist/utils/types.d.cts +24 -0
  92. package/dist/utils/types.d.cts.map +1 -1
  93. package/dist/utils/types.d.mts +24 -0
  94. package/dist/utils/types.d.mts.map +1 -1
  95. package/dist/utils/types.mjs.map +1 -1
  96. package/package.json +2 -2
@@ -0,0 +1,773 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ import type { InferEquals } from "../superstruct.cjs";
3
+ import type { Paginated } from "../utils/index.cjs";
4
+ /**
5
+ * Fee types.
6
+ */
7
+ export declare enum FeeType {
8
+ /**
9
+ * Base fee. It is the minimum fee required to include a transaction in the
10
+ * blockchain.
11
+ *
12
+ * For non-confirmed transactions, it must be the maximum base fee. For
13
+ * confirmed transactions, it must be the actual base fee paid.
14
+ */
15
+ Base = "base",
16
+ /**
17
+ * Priority fee. It is an optional fee used to prioritize the transaction.
18
+ *
19
+ * For non-confirmed transactions, it must be the maximum priority fee. For
20
+ * confirmed transactions, it must be the actual priority fee paid.
21
+ */
22
+ Priority = "priority"
23
+ }
24
+ /**
25
+ * Transaction statuses.
26
+ */
27
+ export declare enum TransactionStatus {
28
+ /**
29
+ * The transaction has been submitted but is not yet in the
30
+ * blockchain. For example, it can be in the mempool.
31
+ */
32
+ Submitted = "submitted",
33
+ /**
34
+ * The transaction is in the blockchain but has not been
35
+ * confirmed yet.
36
+ */
37
+ Unconfirmed = "unconfirmed",
38
+ /**
39
+ * The transaction has been confirmed.
40
+ */
41
+ Confirmed = "confirmed",
42
+ /**
43
+ * The transaction has failed. For example, it has been reverted.
44
+ */
45
+ Failed = "failed"
46
+ }
47
+ /**
48
+ * Transaction types.
49
+ */
50
+ export declare enum TransactionType {
51
+ /**
52
+ * The transaction was originated by the account. If the transaction
53
+ * has a change output that goes back to the same account, it must be tagged
54
+ * as a send transaction.
55
+ */
56
+ Send = "send",
57
+ /**
58
+ * The transaction was received by the account, but originated by
59
+ * another account.
60
+ */
61
+ Receive = "receive"
62
+ }
63
+ /**
64
+ * This struct represents a transaction event.
65
+ */
66
+ export declare const TransactionEventStruct: import("@metamask/superstruct").Struct<{
67
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
68
+ timestamp: number | null;
69
+ }, {
70
+ /**
71
+ * New status of the transaction.
72
+ */
73
+ status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
74
+ submitted: "submitted";
75
+ unconfirmed: "unconfirmed";
76
+ confirmed: "confirmed";
77
+ failed: "failed";
78
+ }>;
79
+ /**
80
+ * UNIX timestamp of when the event occurred.
81
+ */
82
+ timestamp: import("@metamask/superstruct").Struct<number | null, null>;
83
+ }>;
84
+ /**
85
+ * This struct represents a blockchain transaction.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * const tx = {
90
+ * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',
91
+ * chain: 'bip122:000000000019d6689c085ae165831e93',
92
+ * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',
93
+ * status: 'confirmed',
94
+ * timestamp: 1716367781,
95
+ * type: 'send',
96
+ * from: [
97
+ * {
98
+ * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',
99
+ * asset: {
100
+ * fungible: true,
101
+ * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
102
+ * unit: 'BTC',
103
+ * amount: '0.1',
104
+ * },
105
+ * },
106
+ * ],
107
+ * to: [
108
+ * {
109
+ * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',
110
+ * asset: {
111
+ * fungible: true,
112
+ * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
113
+ * unit: 'BTC',
114
+ * amount: '0.1',
115
+ * },
116
+ * },
117
+ * {
118
+ * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',
119
+ * asset: {
120
+ * fungible: true,
121
+ * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
122
+ * unit: 'BTC',
123
+ * amount: '0.1',
124
+ * },
125
+ * },
126
+ * ],
127
+ * fees: [
128
+ * {
129
+ * type: 'priority',
130
+ * asset: {
131
+ * fungible: true,
132
+ * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',
133
+ * unit: 'BTC',
134
+ * amount: '0.1',
135
+ * },
136
+ * },
137
+ * ],
138
+ * };
139
+ * ```
140
+ */
141
+ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
142
+ type: "send" | "receive";
143
+ id: string;
144
+ account: string;
145
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
146
+ timestamp: number | null;
147
+ chain: `${string}:${string}`;
148
+ from: {
149
+ address: string;
150
+ asset: {
151
+ type: `${string}:${string}/${string}:${string}`;
152
+ fungible: true;
153
+ unit: string;
154
+ amount: string;
155
+ } | {
156
+ id: `${string}:${string}/${string}:${string}/${string}`;
157
+ fungible: false;
158
+ } | null;
159
+ }[];
160
+ to: {
161
+ address: string;
162
+ asset: {
163
+ type: `${string}:${string}/${string}:${string}`;
164
+ fungible: true;
165
+ unit: string;
166
+ amount: string;
167
+ } | {
168
+ id: `${string}:${string}/${string}:${string}/${string}`;
169
+ fungible: false;
170
+ } | null;
171
+ }[];
172
+ fees: {
173
+ type: "base" | "priority";
174
+ asset: {
175
+ type: `${string}:${string}/${string}:${string}`;
176
+ fungible: true;
177
+ unit: string;
178
+ amount: string;
179
+ } | {
180
+ id: `${string}:${string}/${string}:${string}/${string}`;
181
+ fungible: false;
182
+ };
183
+ }[];
184
+ events: {
185
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
186
+ timestamp: number | null;
187
+ }[];
188
+ }, {
189
+ /**
190
+ * Chain-specific transaction ID.
191
+ */
192
+ id: import("@metamask/superstruct").Struct<string, null>;
193
+ /**
194
+ * Chain ID (CAIP-2).
195
+ */
196
+ chain: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
197
+ /**
198
+ * Account ID (UUIDv4).
199
+ */
200
+ account: import("@metamask/superstruct").Struct<string, null>;
201
+ /**
202
+ * Transaction status {@see TransactionStatus}.
203
+ */
204
+ status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
205
+ submitted: "submitted";
206
+ unconfirmed: "unconfirmed";
207
+ confirmed: "confirmed";
208
+ failed: "failed";
209
+ }>;
210
+ /**
211
+ * UNIX timestamp of when the transaction was added to the blockchain. The
212
+ * timestamp can be null if the transaction has not been included in the
213
+ * blockchain yet.
214
+ */
215
+ timestamp: import("@metamask/superstruct").Struct<number | null, null>;
216
+ /**
217
+ * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
218
+ * details on the UI.
219
+ */
220
+ type: import("@metamask/superstruct").Struct<"send" | "receive", {
221
+ send: "send";
222
+ receive: "receive";
223
+ }>;
224
+ /**
225
+ * Transaction sender addresses and amounts.
226
+ */
227
+ from: import("@metamask/superstruct").Struct<{
228
+ address: string;
229
+ asset: {
230
+ type: `${string}:${string}/${string}:${string}`;
231
+ fungible: true;
232
+ unit: string;
233
+ amount: string;
234
+ } | {
235
+ id: `${string}:${string}/${string}:${string}/${string}`;
236
+ fungible: false;
237
+ } | null;
238
+ }[], import("@metamask/superstruct").Struct<{
239
+ address: string;
240
+ asset: {
241
+ type: `${string}:${string}/${string}:${string}`;
242
+ fungible: true;
243
+ unit: string;
244
+ amount: string;
245
+ } | {
246
+ id: `${string}:${string}/${string}:${string}/${string}`;
247
+ fungible: false;
248
+ } | null;
249
+ }, {
250
+ /**
251
+ * Participant address.
252
+ */
253
+ address: import("@metamask/superstruct").Struct<string, null>;
254
+ /**
255
+ * Asset being transferred.
256
+ */
257
+ asset: import("@metamask/superstruct").Struct<{
258
+ type: `${string}:${string}/${string}:${string}`;
259
+ fungible: true;
260
+ unit: string;
261
+ amount: string;
262
+ } | {
263
+ id: `${string}:${string}/${string}:${string}/${string}`;
264
+ fungible: false;
265
+ } | null, null>;
266
+ }>>;
267
+ /**
268
+ * Transaction receiver addresses and amounts.
269
+ */
270
+ to: import("@metamask/superstruct").Struct<{
271
+ address: string;
272
+ asset: {
273
+ type: `${string}:${string}/${string}:${string}`;
274
+ fungible: true;
275
+ unit: string;
276
+ amount: string;
277
+ } | {
278
+ id: `${string}:${string}/${string}:${string}/${string}`;
279
+ fungible: false;
280
+ } | null;
281
+ }[], import("@metamask/superstruct").Struct<{
282
+ address: string;
283
+ asset: {
284
+ type: `${string}:${string}/${string}:${string}`;
285
+ fungible: true;
286
+ unit: string;
287
+ amount: string;
288
+ } | {
289
+ id: `${string}:${string}/${string}:${string}/${string}`;
290
+ fungible: false;
291
+ } | null;
292
+ }, {
293
+ /**
294
+ * Participant address.
295
+ */
296
+ address: import("@metamask/superstruct").Struct<string, null>;
297
+ /**
298
+ * Asset being transferred.
299
+ */
300
+ asset: import("@metamask/superstruct").Struct<{
301
+ type: `${string}:${string}/${string}:${string}`;
302
+ fungible: true;
303
+ unit: string;
304
+ amount: string;
305
+ } | {
306
+ id: `${string}:${string}/${string}:${string}/${string}`;
307
+ fungible: false;
308
+ } | null, null>;
309
+ }>>;
310
+ /**
311
+ * Total transaction fee.
312
+ */
313
+ fees: import("@metamask/superstruct").Struct<{
314
+ type: "base" | "priority";
315
+ asset: {
316
+ type: `${string}:${string}/${string}:${string}`;
317
+ fungible: true;
318
+ unit: string;
319
+ amount: string;
320
+ } | {
321
+ id: `${string}:${string}/${string}:${string}/${string}`;
322
+ fungible: false;
323
+ };
324
+ }[], import("@metamask/superstruct").Struct<{
325
+ type: "base" | "priority";
326
+ asset: {
327
+ type: `${string}:${string}/${string}:${string}`;
328
+ fungible: true;
329
+ unit: string;
330
+ amount: string;
331
+ } | {
332
+ id: `${string}:${string}/${string}:${string}/${string}`;
333
+ fungible: false;
334
+ };
335
+ }, {
336
+ /**
337
+ * Fee type {@see FeeType}.
338
+ */
339
+ type: import("@metamask/superstruct").Struct<"base" | "priority", {
340
+ base: "base";
341
+ priority: "priority";
342
+ }>;
343
+ /**
344
+ * Asset used to pay for the fee.
345
+ */
346
+ asset: import("@metamask/superstruct").Struct<{
347
+ type: `${string}:${string}/${string}:${string}`;
348
+ fungible: true;
349
+ unit: string;
350
+ amount: string;
351
+ } | {
352
+ id: `${string}:${string}/${string}:${string}/${string}`;
353
+ fungible: false;
354
+ }, null>;
355
+ }>>;
356
+ /**
357
+ * List of events related to the transaction {@see TransactionEventStruct}.
358
+ *
359
+ * The events are tracked in a best-effort basis and may not be available for
360
+ * all transactions.
361
+ */
362
+ events: import("@metamask/superstruct").Struct<{
363
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
364
+ timestamp: number | null;
365
+ }[], import("@metamask/superstruct").Struct<{
366
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
367
+ timestamp: number | null;
368
+ }, {
369
+ /**
370
+ * New status of the transaction.
371
+ */
372
+ status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
373
+ submitted: "submitted";
374
+ unconfirmed: "unconfirmed";
375
+ confirmed: "confirmed";
376
+ failed: "failed";
377
+ }>;
378
+ /**
379
+ * UNIX timestamp of when the event occurred.
380
+ */
381
+ timestamp: import("@metamask/superstruct").Struct<number | null, null>;
382
+ }>>;
383
+ }>;
384
+ /**
385
+ * Transaction object.
386
+ *
387
+ * See {@link TransactionStruct}.
388
+ */
389
+ export type Transaction = Infer<typeof TransactionStruct>;
390
+ /**
391
+ * This struct represents a page of transactions.
392
+ *
393
+ * @example
394
+ * ```ts
395
+ * {
396
+ * data: [
397
+ * {
398
+ * // Transaction object
399
+ * }
400
+ * ],
401
+ * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',
402
+ * }
403
+ * ```
404
+ *
405
+ * @example
406
+ * ```ts
407
+ * {
408
+ * data: [
409
+ * {
410
+ * // Transaction object
411
+ * }
412
+ * ],
413
+ * next: null, // No more results
414
+ * }**
415
+ * ```
416
+ */
417
+ export declare const TransactionsPageStruct: import("@metamask/superstruct").Struct<{
418
+ next: string | null;
419
+ data: {
420
+ type: "send" | "receive";
421
+ id: string;
422
+ account: string;
423
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
424
+ timestamp: number | null;
425
+ chain: `${string}:${string}`;
426
+ from: {
427
+ address: string;
428
+ asset: {
429
+ type: `${string}:${string}/${string}:${string}`;
430
+ fungible: true;
431
+ unit: string;
432
+ amount: string;
433
+ } | {
434
+ id: `${string}:${string}/${string}:${string}/${string}`;
435
+ fungible: false;
436
+ } | null;
437
+ }[];
438
+ to: {
439
+ address: string;
440
+ asset: {
441
+ type: `${string}:${string}/${string}:${string}`;
442
+ fungible: true;
443
+ unit: string;
444
+ amount: string;
445
+ } | {
446
+ id: `${string}:${string}/${string}:${string}/${string}`;
447
+ fungible: false;
448
+ } | null;
449
+ }[];
450
+ fees: {
451
+ type: "base" | "priority";
452
+ asset: {
453
+ type: `${string}:${string}/${string}:${string}`;
454
+ fungible: true;
455
+ unit: string;
456
+ amount: string;
457
+ } | {
458
+ id: `${string}:${string}/${string}:${string}/${string}`;
459
+ fungible: false;
460
+ };
461
+ }[];
462
+ events: {
463
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
464
+ timestamp: number | null;
465
+ }[];
466
+ }[];
467
+ }, {
468
+ /**
469
+ * List of transactions.
470
+ */
471
+ data: import("@metamask/superstruct").Struct<{
472
+ type: "send" | "receive";
473
+ id: string;
474
+ account: string;
475
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
476
+ timestamp: number | null;
477
+ chain: `${string}:${string}`;
478
+ from: {
479
+ address: string;
480
+ asset: {
481
+ type: `${string}:${string}/${string}:${string}`;
482
+ fungible: true;
483
+ unit: string;
484
+ amount: string;
485
+ } | {
486
+ id: `${string}:${string}/${string}:${string}/${string}`;
487
+ fungible: false;
488
+ } | null;
489
+ }[];
490
+ to: {
491
+ address: string;
492
+ asset: {
493
+ type: `${string}:${string}/${string}:${string}`;
494
+ fungible: true;
495
+ unit: string;
496
+ amount: string;
497
+ } | {
498
+ id: `${string}:${string}/${string}:${string}/${string}`;
499
+ fungible: false;
500
+ } | null;
501
+ }[];
502
+ fees: {
503
+ type: "base" | "priority";
504
+ asset: {
505
+ type: `${string}:${string}/${string}:${string}`;
506
+ fungible: true;
507
+ unit: string;
508
+ amount: string;
509
+ } | {
510
+ id: `${string}:${string}/${string}:${string}/${string}`;
511
+ fungible: false;
512
+ };
513
+ }[];
514
+ events: {
515
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
516
+ timestamp: number | null;
517
+ }[];
518
+ }[], import("@metamask/superstruct").Struct<{
519
+ type: "send" | "receive";
520
+ id: string;
521
+ account: string;
522
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
523
+ timestamp: number | null;
524
+ chain: `${string}:${string}`;
525
+ from: {
526
+ address: string;
527
+ asset: {
528
+ type: `${string}:${string}/${string}:${string}`;
529
+ fungible: true;
530
+ unit: string;
531
+ amount: string;
532
+ } | {
533
+ id: `${string}:${string}/${string}:${string}/${string}`;
534
+ fungible: false;
535
+ } | null;
536
+ }[];
537
+ to: {
538
+ address: string;
539
+ asset: {
540
+ type: `${string}:${string}/${string}:${string}`;
541
+ fungible: true;
542
+ unit: string;
543
+ amount: string;
544
+ } | {
545
+ id: `${string}:${string}/${string}:${string}/${string}`;
546
+ fungible: false;
547
+ } | null;
548
+ }[];
549
+ fees: {
550
+ type: "base" | "priority";
551
+ asset: {
552
+ type: `${string}:${string}/${string}:${string}`;
553
+ fungible: true;
554
+ unit: string;
555
+ amount: string;
556
+ } | {
557
+ id: `${string}:${string}/${string}:${string}/${string}`;
558
+ fungible: false;
559
+ };
560
+ }[];
561
+ events: {
562
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
563
+ timestamp: number | null;
564
+ }[];
565
+ }, {
566
+ /**
567
+ * Chain-specific transaction ID.
568
+ */
569
+ id: import("@metamask/superstruct").Struct<string, null>;
570
+ /**
571
+ * Chain ID (CAIP-2).
572
+ */
573
+ chain: import("@metamask/superstruct").Struct<`${string}:${string}`, null>;
574
+ /**
575
+ * Account ID (UUIDv4).
576
+ */
577
+ account: import("@metamask/superstruct").Struct<string, null>;
578
+ /**
579
+ * Transaction status {@see TransactionStatus}.
580
+ */
581
+ status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
582
+ submitted: "submitted";
583
+ unconfirmed: "unconfirmed";
584
+ confirmed: "confirmed";
585
+ failed: "failed";
586
+ }>;
587
+ /**
588
+ * UNIX timestamp of when the transaction was added to the blockchain. The
589
+ * timestamp can be null if the transaction has not been included in the
590
+ * blockchain yet.
591
+ */
592
+ timestamp: import("@metamask/superstruct").Struct<number | null, null>;
593
+ /**
594
+ * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
595
+ * details on the UI.
596
+ */
597
+ type: import("@metamask/superstruct").Struct<"send" | "receive", {
598
+ send: "send";
599
+ receive: "receive";
600
+ }>;
601
+ /**
602
+ * Transaction sender addresses and amounts.
603
+ */
604
+ from: import("@metamask/superstruct").Struct<{
605
+ address: string;
606
+ asset: {
607
+ type: `${string}:${string}/${string}:${string}`;
608
+ fungible: true;
609
+ unit: string;
610
+ amount: string;
611
+ } | {
612
+ id: `${string}:${string}/${string}:${string}/${string}`;
613
+ fungible: false;
614
+ } | null;
615
+ }[], import("@metamask/superstruct").Struct<{
616
+ address: string;
617
+ asset: {
618
+ type: `${string}:${string}/${string}:${string}`;
619
+ fungible: true;
620
+ unit: string;
621
+ amount: string;
622
+ } | {
623
+ id: `${string}:${string}/${string}:${string}/${string}`;
624
+ fungible: false;
625
+ } | null;
626
+ }, {
627
+ /**
628
+ * Participant address.
629
+ */
630
+ address: import("@metamask/superstruct").Struct<string, null>;
631
+ /**
632
+ * Asset being transferred.
633
+ */
634
+ asset: import("@metamask/superstruct").Struct<{
635
+ type: `${string}:${string}/${string}:${string}`;
636
+ fungible: true;
637
+ unit: string;
638
+ amount: string;
639
+ } | {
640
+ id: `${string}:${string}/${string}:${string}/${string}`;
641
+ fungible: false;
642
+ } | null, null>;
643
+ }>>;
644
+ /**
645
+ * Transaction receiver addresses and amounts.
646
+ */
647
+ to: import("@metamask/superstruct").Struct<{
648
+ address: string;
649
+ asset: {
650
+ type: `${string}:${string}/${string}:${string}`;
651
+ fungible: true;
652
+ unit: string;
653
+ amount: string;
654
+ } | {
655
+ id: `${string}:${string}/${string}:${string}/${string}`;
656
+ fungible: false;
657
+ } | null;
658
+ }[], import("@metamask/superstruct").Struct<{
659
+ address: string;
660
+ asset: {
661
+ type: `${string}:${string}/${string}:${string}`;
662
+ fungible: true;
663
+ unit: string;
664
+ amount: string;
665
+ } | {
666
+ id: `${string}:${string}/${string}:${string}/${string}`;
667
+ fungible: false;
668
+ } | null;
669
+ }, {
670
+ /**
671
+ * Participant address.
672
+ */
673
+ address: import("@metamask/superstruct").Struct<string, null>;
674
+ /**
675
+ * Asset being transferred.
676
+ */
677
+ asset: import("@metamask/superstruct").Struct<{
678
+ type: `${string}:${string}/${string}:${string}`;
679
+ fungible: true;
680
+ unit: string;
681
+ amount: string;
682
+ } | {
683
+ id: `${string}:${string}/${string}:${string}/${string}`;
684
+ fungible: false;
685
+ } | null, null>;
686
+ }>>;
687
+ /**
688
+ * Total transaction fee.
689
+ */
690
+ fees: import("@metamask/superstruct").Struct<{
691
+ type: "base" | "priority";
692
+ asset: {
693
+ type: `${string}:${string}/${string}:${string}`;
694
+ fungible: true;
695
+ unit: string;
696
+ amount: string;
697
+ } | {
698
+ id: `${string}:${string}/${string}:${string}/${string}`;
699
+ fungible: false;
700
+ };
701
+ }[], import("@metamask/superstruct").Struct<{
702
+ type: "base" | "priority";
703
+ asset: {
704
+ type: `${string}:${string}/${string}:${string}`;
705
+ fungible: true;
706
+ unit: string;
707
+ amount: string;
708
+ } | {
709
+ id: `${string}:${string}/${string}:${string}/${string}`;
710
+ fungible: false;
711
+ };
712
+ }, {
713
+ /**
714
+ * Fee type {@see FeeType}.
715
+ */
716
+ type: import("@metamask/superstruct").Struct<"base" | "priority", {
717
+ base: "base";
718
+ priority: "priority";
719
+ }>;
720
+ /**
721
+ * Asset used to pay for the fee.
722
+ */
723
+ asset: import("@metamask/superstruct").Struct<{
724
+ type: `${string}:${string}/${string}:${string}`;
725
+ fungible: true;
726
+ unit: string;
727
+ amount: string;
728
+ } | {
729
+ id: `${string}:${string}/${string}:${string}/${string}`;
730
+ fungible: false;
731
+ }, null>;
732
+ }>>;
733
+ /**
734
+ * List of events related to the transaction {@see TransactionEventStruct}.
735
+ *
736
+ * The events are tracked in a best-effort basis and may not be available for
737
+ * all transactions.
738
+ */
739
+ events: import("@metamask/superstruct").Struct<{
740
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
741
+ timestamp: number | null;
742
+ }[], import("@metamask/superstruct").Struct<{
743
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
744
+ timestamp: number | null;
745
+ }, {
746
+ /**
747
+ * New status of the transaction.
748
+ */
749
+ status: import("@metamask/superstruct").Struct<"submitted" | "unconfirmed" | "confirmed" | "failed", {
750
+ submitted: "submitted";
751
+ unconfirmed: "unconfirmed";
752
+ confirmed: "confirmed";
753
+ failed: "failed";
754
+ }>;
755
+ /**
756
+ * UNIX timestamp of when the event occurred.
757
+ */
758
+ timestamp: import("@metamask/superstruct").Struct<number | null, null>;
759
+ }>>;
760
+ }>>;
761
+ /**
762
+ * Next cursor to iterate over the results. If null, there are no more
763
+ * results.
764
+ */
765
+ next: import("@metamask/superstruct").Struct<string | null, null>;
766
+ }>;
767
+ /**
768
+ * Transactions page object.
769
+ *
770
+ * See {@link TransactionsPageStruct}.
771
+ */
772
+ export type TransactionsPage = InferEquals<typeof TransactionsPageStruct, Paginated<Transaction>>;
773
+ //# sourceMappingURL=transaction.d.cts.map