@metamask-previews/keyring-api 23.0.1-7275dbc → 23.1.0-862665d
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.
- package/CHANGELOG.md +23 -8
- package/dist/api/account-options.cjs +4 -0
- package/dist/api/account-options.cjs.map +1 -1
- package/dist/api/account-options.d.cts +4 -0
- package/dist/api/account-options.d.cts.map +1 -1
- package/dist/api/account-options.d.mts +4 -0
- package/dist/api/account-options.d.mts.map +1 -1
- package/dist/api/account-options.mjs +4 -0
- package/dist/api/account-options.mjs.map +1 -1
- package/dist/api/account.d.cts +2 -2
- package/dist/api/account.d.mts +2 -2
- package/dist/api/asset.d.cts +2 -2
- package/dist/api/asset.d.mts +2 -2
- package/dist/api/request.d.cts +3 -3
- package/dist/api/request.d.mts +3 -3
- package/dist/api/response.d.cts +1 -1
- package/dist/api/response.d.mts +1 -1
- package/dist/api/transaction.cjs +5 -0
- package/dist/api/transaction.cjs.map +1 -1
- package/dist/api/transaction.d.cts +77 -71
- package/dist/api/transaction.d.cts.map +1 -1
- package/dist/api/transaction.d.mts +77 -71
- package/dist/api/transaction.d.mts.map +1 -1
- package/dist/api/transaction.mjs +5 -0
- package/dist/api/transaction.mjs.map +1 -1
- package/dist/btc/types.d.cts +8 -8
- package/dist/btc/types.d.mts +8 -8
- package/dist/eth/erc4337/types.d.cts +3 -3
- package/dist/eth/erc4337/types.d.mts +3 -3
- package/dist/eth/rpc/params.d.cts +29 -29
- package/dist/eth/rpc/params.d.mts +29 -29
- package/dist/eth/types.d.cts +4 -4
- package/dist/eth/types.d.mts +4 -4
- package/dist/eth/utils.cjs +2 -1
- package/dist/eth/utils.cjs.map +1 -1
- package/dist/events.d.cts +56 -56
- package/dist/events.d.mts +56 -56
- package/dist/rpc.cjs +2 -2
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +132 -131
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +132 -131
- package/dist/rpc.d.mts.map +1 -1
- package/dist/sol/types.d.cts +2 -2
- package/dist/sol/types.d.mts +2 -2
- package/dist/trx/types.d.cts +2 -2
- package/dist/trx/types.d.mts +2 -2
- package/dist/v2/api/create-account/bip44.d.cts +1 -1
- package/dist/v2/api/create-account/bip44.d.mts +1 -1
- package/dist/v2/api/create-account/index.cjs +2 -2
- package/dist/v2/api/create-account/index.cjs.map +1 -1
- package/dist/v2/api/create-account/index.d.cts +1 -1
- package/dist/v2/api/create-account/index.d.mts +1 -1
- package/dist/v2/api/keyring-rpc.cjs +2 -2
- package/dist/v2/api/keyring-rpc.cjs.map +1 -1
- package/dist/v2/api/keyring-rpc.d.cts +28 -28
- package/dist/v2/api/keyring-rpc.d.mts +28 -28
- package/dist/xlm/types.cjs +1 -0
- package/dist/xlm/types.cjs.map +1 -1
- package/dist/xlm/types.d.cts +5 -3
- package/dist/xlm/types.d.cts.map +1 -1
- package/dist/xlm/types.d.mts +5 -3
- package/dist/xlm/types.d.mts.map +1 -1
- package/dist/xlm/types.mjs +1 -0
- package/dist/xlm/types.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -84,6 +84,10 @@ export declare enum TransactionType {
|
|
|
84
84
|
* Represents a stake withdrawal transaction.
|
|
85
85
|
*/
|
|
86
86
|
StakeWithdraw = "stake:withdraw",
|
|
87
|
+
/**
|
|
88
|
+
* Represents a token approval transaction.
|
|
89
|
+
*/
|
|
90
|
+
TokenApprove = "token:approve",
|
|
87
91
|
/**
|
|
88
92
|
* The transaction type is unknown. It's not possible to determine the
|
|
89
93
|
* transaction type based on the information available.
|
|
@@ -226,13 +230,17 @@ export declare const TransactionEventStruct: import("@metamask/superstruct").Str
|
|
|
226
230
|
* ```
|
|
227
231
|
*/
|
|
228
232
|
export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
229
|
-
type: "
|
|
233
|
+
type: "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "unknown";
|
|
230
234
|
id: string;
|
|
235
|
+
account: string;
|
|
236
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
237
|
+
timestamp: number | null;
|
|
238
|
+
chain: `${string}:${string}`;
|
|
231
239
|
from: {
|
|
232
240
|
address: string;
|
|
233
241
|
asset: {
|
|
234
|
-
unit: string;
|
|
235
242
|
type: `${string}:${string}/${string}:${string}`;
|
|
243
|
+
unit: string;
|
|
236
244
|
amount: string;
|
|
237
245
|
fungible: true;
|
|
238
246
|
} | {
|
|
@@ -240,19 +248,11 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
240
248
|
fungible: false;
|
|
241
249
|
} | null;
|
|
242
250
|
}[];
|
|
243
|
-
events: {
|
|
244
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
245
|
-
timestamp: number | null;
|
|
246
|
-
}[];
|
|
247
|
-
chain: `${string}:${string}`;
|
|
248
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
249
|
-
account: string;
|
|
250
|
-
timestamp: number | null;
|
|
251
251
|
to: {
|
|
252
252
|
address: string;
|
|
253
253
|
asset: {
|
|
254
|
-
unit: string;
|
|
255
254
|
type: `${string}:${string}/${string}:${string}`;
|
|
255
|
+
unit: string;
|
|
256
256
|
amount: string;
|
|
257
257
|
fungible: true;
|
|
258
258
|
} | {
|
|
@@ -263,8 +263,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
263
263
|
fees: {
|
|
264
264
|
type: "base" | "priority";
|
|
265
265
|
asset: {
|
|
266
|
-
unit: string;
|
|
267
266
|
type: `${string}:${string}/${string}:${string}`;
|
|
267
|
+
unit: string;
|
|
268
268
|
amount: string;
|
|
269
269
|
fungible: true;
|
|
270
270
|
} | {
|
|
@@ -272,6 +272,10 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
272
272
|
fungible: false;
|
|
273
273
|
};
|
|
274
274
|
}[];
|
|
275
|
+
events: {
|
|
276
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
277
|
+
timestamp: number | null;
|
|
278
|
+
}[];
|
|
275
279
|
details?: {
|
|
276
280
|
origin?: string;
|
|
277
281
|
securityAlertResponse?: "Benign" | "Warning" | "Malicious";
|
|
@@ -308,8 +312,7 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
308
312
|
* Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
|
|
309
313
|
* details on the UI.
|
|
310
314
|
*/
|
|
311
|
-
type: import("@metamask/superstruct").Struct<"
|
|
312
|
-
unknown: "unknown";
|
|
315
|
+
type: import("@metamask/superstruct").Struct<"send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "unknown", {
|
|
313
316
|
send: "send";
|
|
314
317
|
receive: "receive";
|
|
315
318
|
swap: "swap";
|
|
@@ -317,6 +320,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
317
320
|
"bridge:receive": "bridge:receive";
|
|
318
321
|
"stake:deposit": "stake:deposit";
|
|
319
322
|
"stake:withdraw": "stake:withdraw";
|
|
323
|
+
"token:approve": "token:approve";
|
|
324
|
+
unknown: "unknown";
|
|
320
325
|
}>;
|
|
321
326
|
/**
|
|
322
327
|
* Transaction sender addresses and amounts.
|
|
@@ -324,8 +329,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
324
329
|
from: import("@metamask/superstruct").Struct<{
|
|
325
330
|
address: string;
|
|
326
331
|
asset: {
|
|
327
|
-
unit: string;
|
|
328
332
|
type: `${string}:${string}/${string}:${string}`;
|
|
333
|
+
unit: string;
|
|
329
334
|
amount: string;
|
|
330
335
|
fungible: true;
|
|
331
336
|
} | {
|
|
@@ -335,8 +340,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
335
340
|
}[], import("@metamask/superstruct").Struct<{
|
|
336
341
|
address: string;
|
|
337
342
|
asset: {
|
|
338
|
-
unit: string;
|
|
339
343
|
type: `${string}:${string}/${string}:${string}`;
|
|
344
|
+
unit: string;
|
|
340
345
|
amount: string;
|
|
341
346
|
fungible: true;
|
|
342
347
|
} | {
|
|
@@ -352,8 +357,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
352
357
|
* Asset being transferred.
|
|
353
358
|
*/
|
|
354
359
|
asset: import("@metamask/superstruct").Struct<{
|
|
355
|
-
unit: string;
|
|
356
360
|
type: `${string}:${string}/${string}:${string}`;
|
|
361
|
+
unit: string;
|
|
357
362
|
amount: string;
|
|
358
363
|
fungible: true;
|
|
359
364
|
} | {
|
|
@@ -367,8 +372,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
367
372
|
to: import("@metamask/superstruct").Struct<{
|
|
368
373
|
address: string;
|
|
369
374
|
asset: {
|
|
370
|
-
unit: string;
|
|
371
375
|
type: `${string}:${string}/${string}:${string}`;
|
|
376
|
+
unit: string;
|
|
372
377
|
amount: string;
|
|
373
378
|
fungible: true;
|
|
374
379
|
} | {
|
|
@@ -378,8 +383,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
378
383
|
}[], import("@metamask/superstruct").Struct<{
|
|
379
384
|
address: string;
|
|
380
385
|
asset: {
|
|
381
|
-
unit: string;
|
|
382
386
|
type: `${string}:${string}/${string}:${string}`;
|
|
387
|
+
unit: string;
|
|
383
388
|
amount: string;
|
|
384
389
|
fungible: true;
|
|
385
390
|
} | {
|
|
@@ -395,8 +400,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
395
400
|
* Asset being transferred.
|
|
396
401
|
*/
|
|
397
402
|
asset: import("@metamask/superstruct").Struct<{
|
|
398
|
-
unit: string;
|
|
399
403
|
type: `${string}:${string}/${string}:${string}`;
|
|
404
|
+
unit: string;
|
|
400
405
|
amount: string;
|
|
401
406
|
fungible: true;
|
|
402
407
|
} | {
|
|
@@ -410,8 +415,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
410
415
|
fees: import("@metamask/superstruct").Struct<{
|
|
411
416
|
type: "base" | "priority";
|
|
412
417
|
asset: {
|
|
413
|
-
unit: string;
|
|
414
418
|
type: `${string}:${string}/${string}:${string}`;
|
|
419
|
+
unit: string;
|
|
415
420
|
amount: string;
|
|
416
421
|
fungible: true;
|
|
417
422
|
} | {
|
|
@@ -421,8 +426,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
421
426
|
}[], import("@metamask/superstruct").Struct<{
|
|
422
427
|
type: "base" | "priority";
|
|
423
428
|
asset: {
|
|
424
|
-
unit: string;
|
|
425
429
|
type: `${string}:${string}/${string}:${string}`;
|
|
430
|
+
unit: string;
|
|
426
431
|
amount: string;
|
|
427
432
|
fungible: true;
|
|
428
433
|
} | {
|
|
@@ -441,8 +446,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
441
446
|
* Asset used to pay for the fee.
|
|
442
447
|
*/
|
|
443
448
|
asset: import("@metamask/superstruct").Struct<{
|
|
444
|
-
unit: string;
|
|
445
449
|
type: `${string}:${string}/${string}:${string}`;
|
|
450
|
+
unit: string;
|
|
446
451
|
amount: string;
|
|
447
452
|
fungible: true;
|
|
448
453
|
} | {
|
|
@@ -546,14 +551,19 @@ export type Transaction = Infer<typeof TransactionStruct>;
|
|
|
546
551
|
* ```
|
|
547
552
|
*/
|
|
548
553
|
export declare const TransactionsPageStruct: import("@metamask/superstruct").Struct<{
|
|
554
|
+
next: string | null;
|
|
549
555
|
data: {
|
|
550
|
-
type: "
|
|
556
|
+
type: "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "unknown";
|
|
551
557
|
id: string;
|
|
558
|
+
account: string;
|
|
559
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
560
|
+
timestamp: number | null;
|
|
561
|
+
chain: `${string}:${string}`;
|
|
552
562
|
from: {
|
|
553
563
|
address: string;
|
|
554
564
|
asset: {
|
|
555
|
-
unit: string;
|
|
556
565
|
type: `${string}:${string}/${string}:${string}`;
|
|
566
|
+
unit: string;
|
|
557
567
|
amount: string;
|
|
558
568
|
fungible: true;
|
|
559
569
|
} | {
|
|
@@ -561,19 +571,11 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
561
571
|
fungible: false;
|
|
562
572
|
} | null;
|
|
563
573
|
}[];
|
|
564
|
-
events: {
|
|
565
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
566
|
-
timestamp: number | null;
|
|
567
|
-
}[];
|
|
568
|
-
chain: `${string}:${string}`;
|
|
569
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
570
|
-
account: string;
|
|
571
|
-
timestamp: number | null;
|
|
572
574
|
to: {
|
|
573
575
|
address: string;
|
|
574
576
|
asset: {
|
|
575
|
-
unit: string;
|
|
576
577
|
type: `${string}:${string}/${string}:${string}`;
|
|
578
|
+
unit: string;
|
|
577
579
|
amount: string;
|
|
578
580
|
fungible: true;
|
|
579
581
|
} | {
|
|
@@ -584,8 +586,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
584
586
|
fees: {
|
|
585
587
|
type: "base" | "priority";
|
|
586
588
|
asset: {
|
|
587
|
-
unit: string;
|
|
588
589
|
type: `${string}:${string}/${string}:${string}`;
|
|
590
|
+
unit: string;
|
|
589
591
|
amount: string;
|
|
590
592
|
fungible: true;
|
|
591
593
|
} | {
|
|
@@ -593,24 +595,31 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
593
595
|
fungible: false;
|
|
594
596
|
};
|
|
595
597
|
}[];
|
|
598
|
+
events: {
|
|
599
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
600
|
+
timestamp: number | null;
|
|
601
|
+
}[];
|
|
596
602
|
details?: {
|
|
597
603
|
origin?: string;
|
|
598
604
|
securityAlertResponse?: "Benign" | "Warning" | "Malicious";
|
|
599
605
|
};
|
|
600
606
|
}[];
|
|
601
|
-
next: string | null;
|
|
602
607
|
}, {
|
|
603
608
|
/**
|
|
604
609
|
* List of transactions.
|
|
605
610
|
*/
|
|
606
611
|
data: import("@metamask/superstruct").Struct<{
|
|
607
|
-
type: "
|
|
612
|
+
type: "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "unknown";
|
|
608
613
|
id: string;
|
|
614
|
+
account: string;
|
|
615
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
616
|
+
timestamp: number | null;
|
|
617
|
+
chain: `${string}:${string}`;
|
|
609
618
|
from: {
|
|
610
619
|
address: string;
|
|
611
620
|
asset: {
|
|
612
|
-
unit: string;
|
|
613
621
|
type: `${string}:${string}/${string}:${string}`;
|
|
622
|
+
unit: string;
|
|
614
623
|
amount: string;
|
|
615
624
|
fungible: true;
|
|
616
625
|
} | {
|
|
@@ -618,19 +627,11 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
618
627
|
fungible: false;
|
|
619
628
|
} | null;
|
|
620
629
|
}[];
|
|
621
|
-
events: {
|
|
622
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
623
|
-
timestamp: number | null;
|
|
624
|
-
}[];
|
|
625
|
-
chain: `${string}:${string}`;
|
|
626
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
627
|
-
account: string;
|
|
628
|
-
timestamp: number | null;
|
|
629
630
|
to: {
|
|
630
631
|
address: string;
|
|
631
632
|
asset: {
|
|
632
|
-
unit: string;
|
|
633
633
|
type: `${string}:${string}/${string}:${string}`;
|
|
634
|
+
unit: string;
|
|
634
635
|
amount: string;
|
|
635
636
|
fungible: true;
|
|
636
637
|
} | {
|
|
@@ -641,8 +642,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
641
642
|
fees: {
|
|
642
643
|
type: "base" | "priority";
|
|
643
644
|
asset: {
|
|
644
|
-
unit: string;
|
|
645
645
|
type: `${string}:${string}/${string}:${string}`;
|
|
646
|
+
unit: string;
|
|
646
647
|
amount: string;
|
|
647
648
|
fungible: true;
|
|
648
649
|
} | {
|
|
@@ -650,18 +651,26 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
650
651
|
fungible: false;
|
|
651
652
|
};
|
|
652
653
|
}[];
|
|
654
|
+
events: {
|
|
655
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
656
|
+
timestamp: number | null;
|
|
657
|
+
}[];
|
|
653
658
|
details?: {
|
|
654
659
|
origin?: string;
|
|
655
660
|
securityAlertResponse?: "Benign" | "Warning" | "Malicious";
|
|
656
661
|
};
|
|
657
662
|
}[], import("@metamask/superstruct").Struct<{
|
|
658
|
-
type: "
|
|
663
|
+
type: "send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "unknown";
|
|
659
664
|
id: string;
|
|
665
|
+
account: string;
|
|
666
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
667
|
+
timestamp: number | null;
|
|
668
|
+
chain: `${string}:${string}`;
|
|
660
669
|
from: {
|
|
661
670
|
address: string;
|
|
662
671
|
asset: {
|
|
663
|
-
unit: string;
|
|
664
672
|
type: `${string}:${string}/${string}:${string}`;
|
|
673
|
+
unit: string;
|
|
665
674
|
amount: string;
|
|
666
675
|
fungible: true;
|
|
667
676
|
} | {
|
|
@@ -669,19 +678,11 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
669
678
|
fungible: false;
|
|
670
679
|
} | null;
|
|
671
680
|
}[];
|
|
672
|
-
events: {
|
|
673
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
674
|
-
timestamp: number | null;
|
|
675
|
-
}[];
|
|
676
|
-
chain: `${string}:${string}`;
|
|
677
|
-
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
678
|
-
account: string;
|
|
679
|
-
timestamp: number | null;
|
|
680
681
|
to: {
|
|
681
682
|
address: string;
|
|
682
683
|
asset: {
|
|
683
|
-
unit: string;
|
|
684
684
|
type: `${string}:${string}/${string}:${string}`;
|
|
685
|
+
unit: string;
|
|
685
686
|
amount: string;
|
|
686
687
|
fungible: true;
|
|
687
688
|
} | {
|
|
@@ -692,8 +693,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
692
693
|
fees: {
|
|
693
694
|
type: "base" | "priority";
|
|
694
695
|
asset: {
|
|
695
|
-
unit: string;
|
|
696
696
|
type: `${string}:${string}/${string}:${string}`;
|
|
697
|
+
unit: string;
|
|
697
698
|
amount: string;
|
|
698
699
|
fungible: true;
|
|
699
700
|
} | {
|
|
@@ -701,6 +702,10 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
701
702
|
fungible: false;
|
|
702
703
|
};
|
|
703
704
|
}[];
|
|
705
|
+
events: {
|
|
706
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
707
|
+
timestamp: number | null;
|
|
708
|
+
}[];
|
|
704
709
|
details?: {
|
|
705
710
|
origin?: string;
|
|
706
711
|
securityAlertResponse?: "Benign" | "Warning" | "Malicious";
|
|
@@ -737,8 +742,7 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
737
742
|
* Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction
|
|
738
743
|
* details on the UI.
|
|
739
744
|
*/
|
|
740
|
-
type: import("@metamask/superstruct").Struct<"
|
|
741
|
-
unknown: "unknown";
|
|
745
|
+
type: import("@metamask/superstruct").Struct<"send" | "receive" | "swap" | "bridge:send" | "bridge:receive" | "stake:deposit" | "stake:withdraw" | "token:approve" | "unknown", {
|
|
742
746
|
send: "send";
|
|
743
747
|
receive: "receive";
|
|
744
748
|
swap: "swap";
|
|
@@ -746,6 +750,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
746
750
|
"bridge:receive": "bridge:receive";
|
|
747
751
|
"stake:deposit": "stake:deposit";
|
|
748
752
|
"stake:withdraw": "stake:withdraw";
|
|
753
|
+
"token:approve": "token:approve";
|
|
754
|
+
unknown: "unknown";
|
|
749
755
|
}>;
|
|
750
756
|
/**
|
|
751
757
|
* Transaction sender addresses and amounts.
|
|
@@ -753,8 +759,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
753
759
|
from: import("@metamask/superstruct").Struct<{
|
|
754
760
|
address: string;
|
|
755
761
|
asset: {
|
|
756
|
-
unit: string;
|
|
757
762
|
type: `${string}:${string}/${string}:${string}`;
|
|
763
|
+
unit: string;
|
|
758
764
|
amount: string;
|
|
759
765
|
fungible: true;
|
|
760
766
|
} | {
|
|
@@ -764,8 +770,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
764
770
|
}[], import("@metamask/superstruct").Struct<{
|
|
765
771
|
address: string;
|
|
766
772
|
asset: {
|
|
767
|
-
unit: string;
|
|
768
773
|
type: `${string}:${string}/${string}:${string}`;
|
|
774
|
+
unit: string;
|
|
769
775
|
amount: string;
|
|
770
776
|
fungible: true;
|
|
771
777
|
} | {
|
|
@@ -781,8 +787,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
781
787
|
* Asset being transferred.
|
|
782
788
|
*/
|
|
783
789
|
asset: import("@metamask/superstruct").Struct<{
|
|
784
|
-
unit: string;
|
|
785
790
|
type: `${string}:${string}/${string}:${string}`;
|
|
791
|
+
unit: string;
|
|
786
792
|
amount: string;
|
|
787
793
|
fungible: true;
|
|
788
794
|
} | {
|
|
@@ -796,8 +802,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
796
802
|
to: import("@metamask/superstruct").Struct<{
|
|
797
803
|
address: string;
|
|
798
804
|
asset: {
|
|
799
|
-
unit: string;
|
|
800
805
|
type: `${string}:${string}/${string}:${string}`;
|
|
806
|
+
unit: string;
|
|
801
807
|
amount: string;
|
|
802
808
|
fungible: true;
|
|
803
809
|
} | {
|
|
@@ -807,8 +813,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
807
813
|
}[], import("@metamask/superstruct").Struct<{
|
|
808
814
|
address: string;
|
|
809
815
|
asset: {
|
|
810
|
-
unit: string;
|
|
811
816
|
type: `${string}:${string}/${string}:${string}`;
|
|
817
|
+
unit: string;
|
|
812
818
|
amount: string;
|
|
813
819
|
fungible: true;
|
|
814
820
|
} | {
|
|
@@ -824,8 +830,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
824
830
|
* Asset being transferred.
|
|
825
831
|
*/
|
|
826
832
|
asset: import("@metamask/superstruct").Struct<{
|
|
827
|
-
unit: string;
|
|
828
833
|
type: `${string}:${string}/${string}:${string}`;
|
|
834
|
+
unit: string;
|
|
829
835
|
amount: string;
|
|
830
836
|
fungible: true;
|
|
831
837
|
} | {
|
|
@@ -839,8 +845,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
839
845
|
fees: import("@metamask/superstruct").Struct<{
|
|
840
846
|
type: "base" | "priority";
|
|
841
847
|
asset: {
|
|
842
|
-
unit: string;
|
|
843
848
|
type: `${string}:${string}/${string}:${string}`;
|
|
849
|
+
unit: string;
|
|
844
850
|
amount: string;
|
|
845
851
|
fungible: true;
|
|
846
852
|
} | {
|
|
@@ -850,8 +856,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
850
856
|
}[], import("@metamask/superstruct").Struct<{
|
|
851
857
|
type: "base" | "priority";
|
|
852
858
|
asset: {
|
|
853
|
-
unit: string;
|
|
854
859
|
type: `${string}:${string}/${string}:${string}`;
|
|
860
|
+
unit: string;
|
|
855
861
|
amount: string;
|
|
856
862
|
fungible: true;
|
|
857
863
|
} | {
|
|
@@ -870,8 +876,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
870
876
|
* Asset used to pay for the fee.
|
|
871
877
|
*/
|
|
872
878
|
asset: import("@metamask/superstruct").Struct<{
|
|
873
|
-
unit: string;
|
|
874
879
|
type: `${string}:${string}/${string}:${string}`;
|
|
880
|
+
unit: string;
|
|
875
881
|
amount: string;
|
|
876
882
|
fungible: true;
|
|
877
883
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.d.mts","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,gCAAgC;AAE3D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,OAAO,KAAK,EAAE,SAAS,EAAE,yBAAqB;AAiD9C;;GAEG;AACH,oBAAY,OAAO;IACjB;;;;;;OAMG;IACH,IAAI,SAAS;IAEb;;;;;OAKG;IACH,QAAQ,aAAa;CACtB;AAiBD;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;;OAGG;IACH,SAAS,cAAc;IAEvB;;;OAGG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,oBAAY,eAAe;IACzB;;;;OAIG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,OAAO,YAAY;IAEnB;;;;;OAKG;IACH,IAAI,SAAS;IAEb;;;OAGG;IACH,UAAU,gBAAgB;IAE1B;;;OAGG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,YAAY,kBAAkB;IAE9B;;OAEG;IACH,aAAa,mBAAmB;IAEhC;;;OAGG;IACH,OAAO,YAAY;CACpB;AAED;;GAEG;AACH,oBAAY,qBAAqB;IAC/B;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,SAAS,cAAc;CACxB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,wBA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eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IACjC;;OAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA7HH;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;QAGH;;WAEG;;;;;;;QAQH;;;;WAIG;;QAGH;;;WAGG;;;;;;;;;;;;QAaH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;YAnUH;;eAEG;;YAGH;;eAEG;;;;;;;;;;;QA+TH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;YAxUH;;eAEG;;YAGH;;eAEG;;;;;;;;;;;QAoUH;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;YAxSH;;eAEG;;;;;YAGH;;eAEG;;;;;;;;;;;QAoSH;;;;;WAKG;;;;;;;;YA9IH;;eAEG;;;;;;;YAQH;;eAEG;;;QAqIH;;;;;;WAMG;;;;;YAhLH;;;;;eAKG;;YAGH;;;eAGG;;;;;;;;IAwNH;;;OAGG;;EAEH,CAAC;AAEH;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG,WAAW,CACxC,OAAO,sBAAsB,EAC7B,SAAS,CAAC,WAAW,CAAC,CACvB,CAAC"}
|
package/dist/api/transaction.mjs
CHANGED
|
@@ -146,6 +146,10 @@ export var TransactionType;
|
|
|
146
146
|
* Represents a stake withdrawal transaction.
|
|
147
147
|
*/
|
|
148
148
|
TransactionType["StakeWithdraw"] = "stake:withdraw";
|
|
149
|
+
/**
|
|
150
|
+
* Represents a token approval transaction.
|
|
151
|
+
*/
|
|
152
|
+
TransactionType["TokenApprove"] = "token:approve";
|
|
149
153
|
/**
|
|
150
154
|
* The transaction type is unknown. It's not possible to determine the
|
|
151
155
|
* transaction type based on the information available.
|
|
@@ -322,6 +326,7 @@ export const TransactionStruct = object({
|
|
|
322
326
|
`${TransactionType.BridgeReceive}`,
|
|
323
327
|
`${TransactionType.StakeDeposit}`,
|
|
324
328
|
`${TransactionType.StakeWithdraw}`,
|
|
329
|
+
`${TransactionType.TokenApprove}`,
|
|
325
330
|
`${TransactionType.Unknown}`,
|
|
326
331
|
]),
|
|
327
332
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction.mjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE5E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAE/E,OAAO,EAAE,WAAW,EAAE,oBAAgB;AACtC,OAAO,EAAE,iBAAiB,EAAE,mBAAe;AAG3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,iBAAiB,GAAG,MAAM,CAAC;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,KAAK,EAAE,QAAQ,CAAC,WAAW,CAAC;CAC7B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,OAiBX;AAjBD,WAAY,OAAO;IACjB;;;;;;OAMG;IACH,wBAAa,CAAA;IAEb;;;;;OAKG;IACH,gCAAqB,CAAA;AACvB,CAAC,EAjBW,OAAO,KAAP,OAAO,QAiBlB;AAED;;GAEG;AACH,MAAM,SAAS,GAAG,MAAM,CAAC;IACvB;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;IAEvD;;OAEG;IACH,KAAK,EAAE,WAAW;CACnB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAN,IAAY,iBAsBX;AAtBD,WAAY,iBAAiB;IAC3B;;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IAE5B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC;IAErC;;;;;;OAMG;IACH,OAAO,EAAE,aAAa,CAAC,wBAAwB,CAAC;CACjD,CAAC,CAAC;AAgBH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAE9B;;;OAGG;IACH,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { InferEquals } from '@metamask/keyring-utils';\nimport { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, nullable, number, string } from '@metamask/superstruct';\n\nimport { AssetStruct } from './asset';\nimport { CaipChainIdStruct } from './caip';\nimport type { Paginated } from './pagination';\n\n/**\n * This struct represents a participant in a transaction.\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: null,\n * },\n * ```\n */\nconst ParticipantStruct = object({\n /**\n * Participant address.\n */\n address: string(),\n\n /**\n * Asset being transferred.\n */\n asset: nullable(AssetStruct),\n});\n\n/**\n * Fee types.\n */\nexport enum FeeType {\n /**\n * Base fee. It is the minimum fee required to include a transaction in the\n * blockchain.\n *\n * For non-confirmed transactions, it must be the maximum base fee. For\n * confirmed transactions, it must be the actual base fee paid.\n */\n Base = 'base',\n\n /**\n * Priority fee. It is an optional fee used to prioritize the transaction.\n *\n * For non-confirmed transactions, it must be the maximum priority fee. For\n * confirmed transactions, it must be the actual priority fee paid.\n */\n Priority = 'priority',\n}\n\n/**\n * This struct represents a transaction fee.\n */\nconst FeeStruct = object({\n /**\n * Fee type {@see FeeType}.\n */\n type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),\n\n /**\n * Asset used to pay for the fee.\n */\n asset: AssetStruct,\n});\n\n/**\n * Transaction statuses.\n */\nexport enum TransactionStatus {\n /**\n * The transaction has been submitted but is not yet in the\n * blockchain. For example, it can be in the mempool.\n */\n Submitted = 'submitted',\n\n /**\n * The transaction is in the blockchain but has not been\n * confirmed yet.\n */\n Unconfirmed = 'unconfirmed',\n\n /**\n * The transaction has been confirmed.\n */\n Confirmed = 'confirmed',\n\n /**\n * The transaction has failed. For example, it has been reverted.\n */\n Failed = 'failed',\n}\n\n/**\n * Transaction types.\n */\nexport enum TransactionType {\n /**\n * The transaction was originated by the account. If the transaction\n * has a change output that goes back to the same account, it must be tagged\n * as a send transaction.\n */\n Send = 'send',\n\n /**\n * The transaction was received by the account, but originated by\n * another account.\n */\n Receive = 'receive',\n\n /**\n * The transaction is a swap. It decreases the balance of one asset and\n * increases the balance of another asset in a single transaction.\n *\n * A swap transaction must be originated by the account.\n */\n Swap = 'swap',\n\n /**\n * Represents an outgoing bridge transaction, transferring assets from\n * the account to another blockchain.\n */\n BridgeSend = 'bridge:send',\n\n /**\n * Represents an incoming bridge transaction, transferring assets from\n * another blockchain to the account.\n */\n BridgeReceive = 'bridge:receive',\n\n /**\n * Represents a stake deposit transaction.\n */\n StakeDeposit = 'stake:deposit',\n\n /**\n * Represents a stake withdrawal transaction.\n */\n StakeWithdraw = 'stake:withdraw',\n\n /**\n * The transaction type is unknown. It's not possible to determine the\n * transaction type based on the information available.\n */\n Unknown = 'unknown',\n}\n\n/**\n * Security alert response values from the Security Alert API.\n */\nexport enum SecurityAlertResponse {\n /**\n * The transaction is considered safe with no detected security issues.\n */\n Benign = 'Benign',\n\n /**\n * The transaction has potential security concerns that warrant user attention.\n */\n Warning = 'Warning',\n\n /**\n * The transaction has been identified as malicious and should be avoided.\n */\n Malicious = 'Malicious',\n}\n\n/**\n * This struct represents additional transaction details.\n *\n * @example\n * ```ts\n * {\n * origin: 'https://dapp.example.com',\n * securityAlertResponse: 'Benign',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * origin: 'metamask',\n * securityAlertResponse: 'Warning',\n * }\n * ```\n */\nexport const TransactionDetailsStruct = object({\n /**\n * Origin of the original transaction request.\n *\n * This can be either 'metamask' for internally initiated transactions, or a URL\n * (e.g., 'https://dapp.example.com') for dapp-initiated transactions.\n */\n origin: exactOptional(string()),\n\n /**\n * Response from the Security Alert API indicating the security assessment of the\n * transaction.\n */\n securityAlertResponse: exactOptional(\n enums([\n `${SecurityAlertResponse.Benign}`,\n `${SecurityAlertResponse.Warning}`,\n `${SecurityAlertResponse.Malicious}`,\n ]),\n ),\n});\n\n/**\n * This struct represents a transaction event.\n */\nexport const TransactionEventStruct = object({\n /**\n * New status of the transaction.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the event occurred.\n */\n timestamp: nullable(number()),\n});\n\n/**\n * This struct represents a blockchain transaction.\n *\n * @example\n * ```ts\n * const tx = {\n * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',\n * chain: 'bip122:000000000019d6689c085ae165831e93',\n * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',\n * status: 'confirmed',\n * timestamp: 1716367781,\n * type: 'send',\n * from: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * to: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * {\n * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * fees: [\n * {\n * type: 'priority',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * };\n * ```\n */\nexport const TransactionStruct = object({\n /**\n * Chain-specific transaction ID.\n */\n id: string(),\n\n /**\n * Chain ID (CAIP-2).\n */\n chain: CaipChainIdStruct,\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Transaction status {@see TransactionStatus}.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the transaction was added to the blockchain. The\n * timestamp can be null if the transaction has not been included in the\n * blockchain yet.\n */\n timestamp: nullable(number()),\n\n /**\n * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction\n * details on the UI.\n */\n type: enums([\n `${TransactionType.Send}`,\n `${TransactionType.Receive}`,\n `${TransactionType.Swap}`,\n `${TransactionType.BridgeSend}`,\n `${TransactionType.BridgeReceive}`,\n `${TransactionType.StakeDeposit}`,\n `${TransactionType.StakeWithdraw}`,\n `${TransactionType.Unknown}`,\n ]),\n\n /**\n * Transaction sender addresses and amounts.\n */\n from: array(ParticipantStruct),\n\n /**\n * Transaction receiver addresses and amounts.\n */\n to: array(ParticipantStruct),\n\n /**\n * Total transaction fee.\n */\n fees: array(FeeStruct),\n\n /**\n * List of events related to the transaction {@see TransactionEventStruct}.\n *\n * The events are tracked in a best-effort basis and may not be available for\n * all transactions.\n */\n events: array(TransactionEventStruct),\n\n /**\n * Additional transaction details {@see TransactionDetailsStruct}.\n *\n * Contains contextual information about the transaction such as its origin and\n * security assessment. This field is optional and may not be present for all\n * transactions.\n */\n details: exactOptional(TransactionDetailsStruct),\n});\n\n/**\n * Transaction details object.\n *\n * See {@link TransactionDetailsStruct}.\n */\nexport type TransactionDetails = Infer<typeof TransactionDetailsStruct>;\n\n/**\n * Transaction object.\n *\n * See {@link TransactionStruct}.\n */\nexport type Transaction = Infer<typeof TransactionStruct>;\n\n/**\n * This struct represents a page of transactions.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: null, // No more results\n * }**\n * ```\n */\nexport const TransactionsPageStruct = object({\n /**\n * List of transactions.\n */\n data: array(TransactionStruct),\n\n /**\n * Next cursor to iterate over the results. If null, there are no more\n * results.\n */\n next: nullable(string()),\n});\n\n/**\n * Transactions page object.\n *\n * See {@link TransactionsPageStruct}.\n */\nexport type TransactionsPage = InferEquals<\n typeof TransactionsPageStruct,\n Paginated<Transaction>\n>;\n"]}
|
|
1
|
+
{"version":3,"file":"transaction.mjs","sourceRoot":"","sources":["../../src/api/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE5E,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAE/E,OAAO,EAAE,WAAW,EAAE,oBAAgB;AACtC,OAAO,EAAE,iBAAiB,EAAE,mBAAe;AAG3C;;;;;;;;;;;;;;;;;;;;;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AAC;QACZ,GAAG,iBAAiB,CAAC,SAAS,EAAE;QAChC,GAAG,iBAAiB,CAAC,WAAW,EAAE;QAClC,GAAG,iBAAiB,CAAC,SAAS,EAAE;QAChC,GAAG,iBAAiB,CAAC,MAAM,EAAE;KAC9B,CAAC;IAEF;;;;OAIG;IACH,SAAS,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAE7B;;;OAGG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,eAAe,CAAC,IAAI,EAAE;QACzB,GAAG,eAAe,CAAC,OAAO,EAAE;QAC5B,GAAG,eAAe,CAAC,IAAI,EAAE;QACzB,GAAG,eAAe,CAAC,UAAU,EAAE;QAC/B,GAAG,eAAe,CAAC,aAAa,EAAE;QAClC,GAAG,eAAe,CAAC,YAAY,EAAE;QACjC,GAAG,eAAe,CAAC,aAAa,EAAE;QAClC,GAAG,eAAe,CAAC,YAAY,EAAE;QACjC,GAAG,eAAe,CAAC,OAAO,EAAE;KAC7B,CAAC;IAEF;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAE9B;;OAEG;IACH,EAAE,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAE5B;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IAEtB;;;;;OAKG;IACH,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC;IAErC;;;;;;OAMG;IACH,OAAO,EAAE,aAAa,CAAC,wBAAwB,CAAC;CACjD,CAAC,CAAC;AAgBH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC;IAC3C;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,iBAAiB,CAAC;IAE9B;;;OAGG;IACH,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import type { InferEquals } from '@metamask/keyring-utils';\nimport { exactOptional, object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, nullable, number, string } from '@metamask/superstruct';\n\nimport { AssetStruct } from './asset';\nimport { CaipChainIdStruct } from './caip';\nimport type { Paginated } from './pagination';\n\n/**\n * This struct represents a participant in a transaction.\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: true,\n * type: 'eip155:1/slip44:60',\n * unit: 'ETH',\n * amount: '0.01',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: {\n * fungible: false,\n * id: 'eip155:1/erc721:0x06012c8cf97BEaD5deAe237070F9587f8E7A266d/771769',\n * },\n * },\n * ```\n *\n * @example\n * ```ts\n * {\n * address: '0x1234...',\n * asset: null,\n * },\n * ```\n */\nconst ParticipantStruct = object({\n /**\n * Participant address.\n */\n address: string(),\n\n /**\n * Asset being transferred.\n */\n asset: nullable(AssetStruct),\n});\n\n/**\n * Fee types.\n */\nexport enum FeeType {\n /**\n * Base fee. It is the minimum fee required to include a transaction in the\n * blockchain.\n *\n * For non-confirmed transactions, it must be the maximum base fee. For\n * confirmed transactions, it must be the actual base fee paid.\n */\n Base = 'base',\n\n /**\n * Priority fee. It is an optional fee used to prioritize the transaction.\n *\n * For non-confirmed transactions, it must be the maximum priority fee. For\n * confirmed transactions, it must be the actual priority fee paid.\n */\n Priority = 'priority',\n}\n\n/**\n * This struct represents a transaction fee.\n */\nconst FeeStruct = object({\n /**\n * Fee type {@see FeeType}.\n */\n type: enums([`${FeeType.Base}`, `${FeeType.Priority}`]),\n\n /**\n * Asset used to pay for the fee.\n */\n asset: AssetStruct,\n});\n\n/**\n * Transaction statuses.\n */\nexport enum TransactionStatus {\n /**\n * The transaction has been submitted but is not yet in the\n * blockchain. For example, it can be in the mempool.\n */\n Submitted = 'submitted',\n\n /**\n * The transaction is in the blockchain but has not been\n * confirmed yet.\n */\n Unconfirmed = 'unconfirmed',\n\n /**\n * The transaction has been confirmed.\n */\n Confirmed = 'confirmed',\n\n /**\n * The transaction has failed. For example, it has been reverted.\n */\n Failed = 'failed',\n}\n\n/**\n * Transaction types.\n */\nexport enum TransactionType {\n /**\n * The transaction was originated by the account. If the transaction\n * has a change output that goes back to the same account, it must be tagged\n * as a send transaction.\n */\n Send = 'send',\n\n /**\n * The transaction was received by the account, but originated by\n * another account.\n */\n Receive = 'receive',\n\n /**\n * The transaction is a swap. It decreases the balance of one asset and\n * increases the balance of another asset in a single transaction.\n *\n * A swap transaction must be originated by the account.\n */\n Swap = 'swap',\n\n /**\n * Represents an outgoing bridge transaction, transferring assets from\n * the account to another blockchain.\n */\n BridgeSend = 'bridge:send',\n\n /**\n * Represents an incoming bridge transaction, transferring assets from\n * another blockchain to the account.\n */\n BridgeReceive = 'bridge:receive',\n\n /**\n * Represents a stake deposit transaction.\n */\n StakeDeposit = 'stake:deposit',\n\n /**\n * Represents a stake withdrawal transaction.\n */\n StakeWithdraw = 'stake:withdraw',\n\n /**\n * Represents a token approval transaction.\n */\n TokenApprove = 'token:approve',\n\n /**\n * The transaction type is unknown. It's not possible to determine the\n * transaction type based on the information available.\n */\n Unknown = 'unknown',\n}\n\n/**\n * Security alert response values from the Security Alert API.\n */\nexport enum SecurityAlertResponse {\n /**\n * The transaction is considered safe with no detected security issues.\n */\n Benign = 'Benign',\n\n /**\n * The transaction has potential security concerns that warrant user attention.\n */\n Warning = 'Warning',\n\n /**\n * The transaction has been identified as malicious and should be avoided.\n */\n Malicious = 'Malicious',\n}\n\n/**\n * This struct represents additional transaction details.\n *\n * @example\n * ```ts\n * {\n * origin: 'https://dapp.example.com',\n * securityAlertResponse: 'Benign',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * origin: 'metamask',\n * securityAlertResponse: 'Warning',\n * }\n * ```\n */\nexport const TransactionDetailsStruct = object({\n /**\n * Origin of the original transaction request.\n *\n * This can be either 'metamask' for internally initiated transactions, or a URL\n * (e.g., 'https://dapp.example.com') for dapp-initiated transactions.\n */\n origin: exactOptional(string()),\n\n /**\n * Response from the Security Alert API indicating the security assessment of the\n * transaction.\n */\n securityAlertResponse: exactOptional(\n enums([\n `${SecurityAlertResponse.Benign}`,\n `${SecurityAlertResponse.Warning}`,\n `${SecurityAlertResponse.Malicious}`,\n ]),\n ),\n});\n\n/**\n * This struct represents a transaction event.\n */\nexport const TransactionEventStruct = object({\n /**\n * New status of the transaction.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the event occurred.\n */\n timestamp: nullable(number()),\n});\n\n/**\n * This struct represents a blockchain transaction.\n *\n * @example\n * ```ts\n * const tx = {\n * id: 'f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6',\n * chain: 'bip122:000000000019d6689c085ae165831e93',\n * account: 'b9beb861-9761-4b97-89ce-d992be5f34da',\n * status: 'confirmed',\n * timestamp: 1716367781,\n * type: 'send',\n * from: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * to: [\n * {\n * address: 'bc1qrp0yzgkf8rawkuvdlhnjfj2fnjwm0m8727kgah',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * {\n * address: 'bc1qwl8399fz829uqvqly9tcatgrgtwp3udnhxfq4k',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * fees: [\n * {\n * type: 'priority',\n * asset: {\n * fungible: true,\n * type: 'bip122:000000000019d6689c085ae165831e93/slip44:0',\n * unit: 'BTC',\n * amount: '0.1',\n * },\n * },\n * ],\n * };\n * ```\n */\nexport const TransactionStruct = object({\n /**\n * Chain-specific transaction ID.\n */\n id: string(),\n\n /**\n * Chain ID (CAIP-2).\n */\n chain: CaipChainIdStruct,\n\n /**\n * Account ID (UUIDv4).\n */\n account: UuidStruct,\n\n /**\n * Transaction status {@see TransactionStatus}.\n */\n status: enums([\n `${TransactionStatus.Submitted}`,\n `${TransactionStatus.Unconfirmed}`,\n `${TransactionStatus.Confirmed}`,\n `${TransactionStatus.Failed}`,\n ]),\n\n /**\n * UNIX timestamp of when the transaction was added to the blockchain. The\n * timestamp can be null if the transaction has not been included in the\n * blockchain yet.\n */\n timestamp: nullable(number()),\n\n /**\n * Transaction type {@see TransactionType}. This will be used by MetaMask to enrich the transaction\n * details on the UI.\n */\n type: enums([\n `${TransactionType.Send}`,\n `${TransactionType.Receive}`,\n `${TransactionType.Swap}`,\n `${TransactionType.BridgeSend}`,\n `${TransactionType.BridgeReceive}`,\n `${TransactionType.StakeDeposit}`,\n `${TransactionType.StakeWithdraw}`,\n `${TransactionType.TokenApprove}`,\n `${TransactionType.Unknown}`,\n ]),\n\n /**\n * Transaction sender addresses and amounts.\n */\n from: array(ParticipantStruct),\n\n /**\n * Transaction receiver addresses and amounts.\n */\n to: array(ParticipantStruct),\n\n /**\n * Total transaction fee.\n */\n fees: array(FeeStruct),\n\n /**\n * List of events related to the transaction {@see TransactionEventStruct}.\n *\n * The events are tracked in a best-effort basis and may not be available for\n * all transactions.\n */\n events: array(TransactionEventStruct),\n\n /**\n * Additional transaction details {@see TransactionDetailsStruct}.\n *\n * Contains contextual information about the transaction such as its origin and\n * security assessment. This field is optional and may not be present for all\n * transactions.\n */\n details: exactOptional(TransactionDetailsStruct),\n});\n\n/**\n * Transaction details object.\n *\n * See {@link TransactionDetailsStruct}.\n */\nexport type TransactionDetails = Infer<typeof TransactionDetailsStruct>;\n\n/**\n * Transaction object.\n *\n * See {@link TransactionStruct}.\n */\nexport type Transaction = Infer<typeof TransactionStruct>;\n\n/**\n * This struct represents a page of transactions.\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: 'c3y1Q6QtqtstbxKX+oqVdEW6',\n * }\n * ```\n *\n * @example\n * ```ts\n * {\n * data: [\n * {\n * // Transaction object\n * }\n * ],\n * next: null, // No more results\n * }**\n * ```\n */\nexport const TransactionsPageStruct = object({\n /**\n * List of transactions.\n */\n data: array(TransactionStruct),\n\n /**\n * Next cursor to iterate over the results. If null, there are no more\n * results.\n */\n next: nullable(string()),\n});\n\n/**\n * Transactions page object.\n *\n * See {@link TransactionsPageStruct}.\n */\nexport type TransactionsPage = InferEquals<\n typeof TransactionsPageStruct,\n Paginated<Transaction>\n>;\n"]}
|
package/dist/btc/types.d.cts
CHANGED
|
@@ -20,6 +20,8 @@ export declare enum BtcMethod {
|
|
|
20
20
|
export declare const BtcP2pkhAccountStruct: import("@metamask/superstruct").Struct<{
|
|
21
21
|
type: "bip122:p2pkh";
|
|
22
22
|
id: string;
|
|
23
|
+
address: string;
|
|
24
|
+
scopes: `${string}:${string}`[];
|
|
23
25
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
24
26
|
entropy?: {
|
|
25
27
|
type: "mnemonic";
|
|
@@ -33,8 +35,6 @@ export declare const BtcP2pkhAccountStruct: import("@metamask/superstruct").Stru
|
|
|
33
35
|
};
|
|
34
36
|
exportable?: boolean;
|
|
35
37
|
};
|
|
36
|
-
address: string;
|
|
37
|
-
scopes: `${string}:${string}`[];
|
|
38
38
|
methods: BtcMethod[];
|
|
39
39
|
}, {
|
|
40
40
|
/**
|
|
@@ -81,6 +81,8 @@ export declare const BtcP2pkhAccountStruct: import("@metamask/superstruct").Stru
|
|
|
81
81
|
export declare const BtcP2shAccountStruct: import("@metamask/superstruct").Struct<{
|
|
82
82
|
type: "bip122:p2sh";
|
|
83
83
|
id: string;
|
|
84
|
+
address: string;
|
|
85
|
+
scopes: `${string}:${string}`[];
|
|
84
86
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
85
87
|
entropy?: {
|
|
86
88
|
type: "mnemonic";
|
|
@@ -94,8 +96,6 @@ export declare const BtcP2shAccountStruct: import("@metamask/superstruct").Struc
|
|
|
94
96
|
};
|
|
95
97
|
exportable?: boolean;
|
|
96
98
|
};
|
|
97
|
-
address: string;
|
|
98
|
-
scopes: `${string}:${string}`[];
|
|
99
99
|
methods: BtcMethod[];
|
|
100
100
|
}, {
|
|
101
101
|
/**
|
|
@@ -142,6 +142,8 @@ export declare const BtcP2shAccountStruct: import("@metamask/superstruct").Struc
|
|
|
142
142
|
export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Struct<{
|
|
143
143
|
type: "bip122:p2wpkh";
|
|
144
144
|
id: string;
|
|
145
|
+
address: string;
|
|
146
|
+
scopes: `${string}:${string}`[];
|
|
145
147
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
146
148
|
entropy?: {
|
|
147
149
|
type: "mnemonic";
|
|
@@ -155,8 +157,6 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
|
|
|
155
157
|
};
|
|
156
158
|
exportable?: boolean;
|
|
157
159
|
};
|
|
158
|
-
address: string;
|
|
159
|
-
scopes: `${string}:${string}`[];
|
|
160
160
|
methods: BtcMethod[];
|
|
161
161
|
}, {
|
|
162
162
|
/**
|
|
@@ -203,6 +203,8 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
|
|
|
203
203
|
export declare const BtcP2trAccountStruct: import("@metamask/superstruct").Struct<{
|
|
204
204
|
type: "bip122:p2tr";
|
|
205
205
|
id: string;
|
|
206
|
+
address: string;
|
|
207
|
+
scopes: `${string}:${string}`[];
|
|
206
208
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
207
209
|
entropy?: {
|
|
208
210
|
type: "mnemonic";
|
|
@@ -216,8 +218,6 @@ export declare const BtcP2trAccountStruct: import("@metamask/superstruct").Struc
|
|
|
216
218
|
};
|
|
217
219
|
exportable?: boolean;
|
|
218
220
|
};
|
|
219
|
-
address: string;
|
|
220
|
-
scopes: `${string}:${string}`[];
|
|
221
221
|
methods: BtcMethod[];
|
|
222
222
|
}, {
|
|
223
223
|
/**
|