@metamask-previews/keyring-api 13.0.0-515dc3a → 14.0.0-0b22ddc
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 +13 -1
- package/dist/api/account.cjs +1 -1
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.mjs +2 -2
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/asset.cjs +15 -9
- package/dist/api/asset.cjs.map +1 -1
- package/dist/api/asset.d.cts +25 -9
- package/dist/api/asset.d.cts.map +1 -1
- package/dist/api/asset.d.mts +25 -9
- package/dist/api/asset.d.mts.map +1 -1
- package/dist/api/asset.mjs +14 -8
- package/dist/api/asset.mjs.map +1 -1
- package/dist/api/caip.cjs +9 -36
- package/dist/api/caip.cjs.map +1 -1
- package/dist/api/caip.d.cts +11 -28
- package/dist/api/caip.d.cts.map +1 -1
- package/dist/api/caip.d.mts +11 -28
- package/dist/api/caip.d.mts.map +1 -1
- package/dist/api/caip.mjs +6 -31
- package/dist/api/caip.mjs.map +1 -1
- package/dist/api/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +11 -1
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +11 -1
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/api/transaction.d.cts +30 -30
- package/dist/api/transaction.d.mts +30 -30
- package/dist/events.cjs +75 -1
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +240 -1
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +240 -1
- package/dist/events.d.mts.map +1 -1
- package/dist/events.mjs +78 -4
- package/dist/events.mjs.map +1 -1
- package/dist/rpc.cjs +12 -1
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +43 -22
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +43 -22
- package/dist/rpc.d.mts.map +1 -1
- package/dist/rpc.mjs +12 -1
- package/dist/rpc.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -146,8 +146,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
146
146
|
asset: {
|
|
147
147
|
unit: string;
|
|
148
148
|
type: `${string}:${string}/${string}:${string}`;
|
|
149
|
-
fungible: true;
|
|
150
149
|
amount: string;
|
|
150
|
+
fungible: true;
|
|
151
151
|
} | {
|
|
152
152
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
153
153
|
fungible: false;
|
|
@@ -166,8 +166,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
166
166
|
asset: {
|
|
167
167
|
unit: string;
|
|
168
168
|
type: `${string}:${string}/${string}:${string}`;
|
|
169
|
-
fungible: true;
|
|
170
169
|
amount: string;
|
|
170
|
+
fungible: true;
|
|
171
171
|
} | {
|
|
172
172
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
173
173
|
fungible: false;
|
|
@@ -178,8 +178,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
178
178
|
asset: {
|
|
179
179
|
unit: string;
|
|
180
180
|
type: `${string}:${string}/${string}:${string}`;
|
|
181
|
-
fungible: true;
|
|
182
181
|
amount: string;
|
|
182
|
+
fungible: true;
|
|
183
183
|
} | {
|
|
184
184
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
185
185
|
fungible: false;
|
|
@@ -229,8 +229,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
229
229
|
asset: {
|
|
230
230
|
unit: string;
|
|
231
231
|
type: `${string}:${string}/${string}:${string}`;
|
|
232
|
-
fungible: true;
|
|
233
232
|
amount: string;
|
|
233
|
+
fungible: true;
|
|
234
234
|
} | {
|
|
235
235
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
236
236
|
fungible: false;
|
|
@@ -240,8 +240,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
240
240
|
asset: {
|
|
241
241
|
unit: string;
|
|
242
242
|
type: `${string}:${string}/${string}:${string}`;
|
|
243
|
-
fungible: true;
|
|
244
243
|
amount: string;
|
|
244
|
+
fungible: true;
|
|
245
245
|
} | {
|
|
246
246
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
247
247
|
fungible: false;
|
|
@@ -257,8 +257,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
257
257
|
asset: import("@metamask/superstruct").Struct<{
|
|
258
258
|
unit: string;
|
|
259
259
|
type: `${string}:${string}/${string}:${string}`;
|
|
260
|
-
fungible: true;
|
|
261
260
|
amount: string;
|
|
261
|
+
fungible: true;
|
|
262
262
|
} | {
|
|
263
263
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
264
264
|
fungible: false;
|
|
@@ -272,8 +272,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
272
272
|
asset: {
|
|
273
273
|
unit: string;
|
|
274
274
|
type: `${string}:${string}/${string}:${string}`;
|
|
275
|
-
fungible: true;
|
|
276
275
|
amount: string;
|
|
276
|
+
fungible: true;
|
|
277
277
|
} | {
|
|
278
278
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
279
279
|
fungible: false;
|
|
@@ -283,8 +283,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
283
283
|
asset: {
|
|
284
284
|
unit: string;
|
|
285
285
|
type: `${string}:${string}/${string}:${string}`;
|
|
286
|
-
fungible: true;
|
|
287
286
|
amount: string;
|
|
287
|
+
fungible: true;
|
|
288
288
|
} | {
|
|
289
289
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
290
290
|
fungible: false;
|
|
@@ -300,8 +300,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
300
300
|
asset: import("@metamask/superstruct").Struct<{
|
|
301
301
|
unit: string;
|
|
302
302
|
type: `${string}:${string}/${string}:${string}`;
|
|
303
|
-
fungible: true;
|
|
304
303
|
amount: string;
|
|
304
|
+
fungible: true;
|
|
305
305
|
} | {
|
|
306
306
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
307
307
|
fungible: false;
|
|
@@ -315,8 +315,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
315
315
|
asset: {
|
|
316
316
|
unit: string;
|
|
317
317
|
type: `${string}:${string}/${string}:${string}`;
|
|
318
|
-
fungible: true;
|
|
319
318
|
amount: string;
|
|
319
|
+
fungible: true;
|
|
320
320
|
} | {
|
|
321
321
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
322
322
|
fungible: false;
|
|
@@ -326,8 +326,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
326
326
|
asset: {
|
|
327
327
|
unit: string;
|
|
328
328
|
type: `${string}:${string}/${string}:${string}`;
|
|
329
|
-
fungible: true;
|
|
330
329
|
amount: string;
|
|
330
|
+
fungible: true;
|
|
331
331
|
} | {
|
|
332
332
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
333
333
|
fungible: false;
|
|
@@ -346,8 +346,8 @@ export declare const TransactionStruct: import("@metamask/superstruct").Struct<{
|
|
|
346
346
|
asset: import("@metamask/superstruct").Struct<{
|
|
347
347
|
unit: string;
|
|
348
348
|
type: `${string}:${string}/${string}:${string}`;
|
|
349
|
-
fungible: true;
|
|
350
349
|
amount: string;
|
|
350
|
+
fungible: true;
|
|
351
351
|
} | {
|
|
352
352
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
353
353
|
fungible: false;
|
|
@@ -423,8 +423,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
423
423
|
asset: {
|
|
424
424
|
unit: string;
|
|
425
425
|
type: `${string}:${string}/${string}:${string}`;
|
|
426
|
-
fungible: true;
|
|
427
426
|
amount: string;
|
|
427
|
+
fungible: true;
|
|
428
428
|
} | {
|
|
429
429
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
430
430
|
fungible: false;
|
|
@@ -443,8 +443,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
443
443
|
asset: {
|
|
444
444
|
unit: string;
|
|
445
445
|
type: `${string}:${string}/${string}:${string}`;
|
|
446
|
-
fungible: true;
|
|
447
446
|
amount: string;
|
|
447
|
+
fungible: true;
|
|
448
448
|
} | {
|
|
449
449
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
450
450
|
fungible: false;
|
|
@@ -455,8 +455,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
455
455
|
asset: {
|
|
456
456
|
unit: string;
|
|
457
457
|
type: `${string}:${string}/${string}:${string}`;
|
|
458
|
-
fungible: true;
|
|
459
458
|
amount: string;
|
|
459
|
+
fungible: true;
|
|
460
460
|
} | {
|
|
461
461
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
462
462
|
fungible: false;
|
|
@@ -476,8 +476,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
476
476
|
asset: {
|
|
477
477
|
unit: string;
|
|
478
478
|
type: `${string}:${string}/${string}:${string}`;
|
|
479
|
-
fungible: true;
|
|
480
479
|
amount: string;
|
|
480
|
+
fungible: true;
|
|
481
481
|
} | {
|
|
482
482
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
483
483
|
fungible: false;
|
|
@@ -496,8 +496,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
496
496
|
asset: {
|
|
497
497
|
unit: string;
|
|
498
498
|
type: `${string}:${string}/${string}:${string}`;
|
|
499
|
-
fungible: true;
|
|
500
499
|
amount: string;
|
|
500
|
+
fungible: true;
|
|
501
501
|
} | {
|
|
502
502
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
503
503
|
fungible: false;
|
|
@@ -508,8 +508,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
508
508
|
asset: {
|
|
509
509
|
unit: string;
|
|
510
510
|
type: `${string}:${string}/${string}:${string}`;
|
|
511
|
-
fungible: true;
|
|
512
511
|
amount: string;
|
|
512
|
+
fungible: true;
|
|
513
513
|
} | {
|
|
514
514
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
515
515
|
fungible: false;
|
|
@@ -523,8 +523,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
523
523
|
asset: {
|
|
524
524
|
unit: string;
|
|
525
525
|
type: `${string}:${string}/${string}:${string}`;
|
|
526
|
-
fungible: true;
|
|
527
526
|
amount: string;
|
|
527
|
+
fungible: true;
|
|
528
528
|
} | {
|
|
529
529
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
530
530
|
fungible: false;
|
|
@@ -543,8 +543,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
543
543
|
asset: {
|
|
544
544
|
unit: string;
|
|
545
545
|
type: `${string}:${string}/${string}:${string}`;
|
|
546
|
-
fungible: true;
|
|
547
546
|
amount: string;
|
|
547
|
+
fungible: true;
|
|
548
548
|
} | {
|
|
549
549
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
550
550
|
fungible: false;
|
|
@@ -555,8 +555,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
555
555
|
asset: {
|
|
556
556
|
unit: string;
|
|
557
557
|
type: `${string}:${string}/${string}:${string}`;
|
|
558
|
-
fungible: true;
|
|
559
558
|
amount: string;
|
|
559
|
+
fungible: true;
|
|
560
560
|
} | {
|
|
561
561
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
562
562
|
fungible: false;
|
|
@@ -606,8 +606,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
606
606
|
asset: {
|
|
607
607
|
unit: string;
|
|
608
608
|
type: `${string}:${string}/${string}:${string}`;
|
|
609
|
-
fungible: true;
|
|
610
609
|
amount: string;
|
|
610
|
+
fungible: true;
|
|
611
611
|
} | {
|
|
612
612
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
613
613
|
fungible: false;
|
|
@@ -617,8 +617,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
617
617
|
asset: {
|
|
618
618
|
unit: string;
|
|
619
619
|
type: `${string}:${string}/${string}:${string}`;
|
|
620
|
-
fungible: true;
|
|
621
620
|
amount: string;
|
|
621
|
+
fungible: true;
|
|
622
622
|
} | {
|
|
623
623
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
624
624
|
fungible: false;
|
|
@@ -634,8 +634,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
634
634
|
asset: import("@metamask/superstruct").Struct<{
|
|
635
635
|
unit: string;
|
|
636
636
|
type: `${string}:${string}/${string}:${string}`;
|
|
637
|
-
fungible: true;
|
|
638
637
|
amount: string;
|
|
638
|
+
fungible: true;
|
|
639
639
|
} | {
|
|
640
640
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
641
641
|
fungible: false;
|
|
@@ -649,8 +649,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
649
649
|
asset: {
|
|
650
650
|
unit: string;
|
|
651
651
|
type: `${string}:${string}/${string}:${string}`;
|
|
652
|
-
fungible: true;
|
|
653
652
|
amount: string;
|
|
653
|
+
fungible: true;
|
|
654
654
|
} | {
|
|
655
655
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
656
656
|
fungible: false;
|
|
@@ -660,8 +660,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
660
660
|
asset: {
|
|
661
661
|
unit: string;
|
|
662
662
|
type: `${string}:${string}/${string}:${string}`;
|
|
663
|
-
fungible: true;
|
|
664
663
|
amount: string;
|
|
664
|
+
fungible: true;
|
|
665
665
|
} | {
|
|
666
666
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
667
667
|
fungible: false;
|
|
@@ -677,8 +677,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
677
677
|
asset: import("@metamask/superstruct").Struct<{
|
|
678
678
|
unit: string;
|
|
679
679
|
type: `${string}:${string}/${string}:${string}`;
|
|
680
|
-
fungible: true;
|
|
681
680
|
amount: string;
|
|
681
|
+
fungible: true;
|
|
682
682
|
} | {
|
|
683
683
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
684
684
|
fungible: false;
|
|
@@ -692,8 +692,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
692
692
|
asset: {
|
|
693
693
|
unit: string;
|
|
694
694
|
type: `${string}:${string}/${string}:${string}`;
|
|
695
|
-
fungible: true;
|
|
696
695
|
amount: string;
|
|
696
|
+
fungible: true;
|
|
697
697
|
} | {
|
|
698
698
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
699
699
|
fungible: false;
|
|
@@ -703,8 +703,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
703
703
|
asset: {
|
|
704
704
|
unit: string;
|
|
705
705
|
type: `${string}:${string}/${string}:${string}`;
|
|
706
|
-
fungible: true;
|
|
707
706
|
amount: string;
|
|
707
|
+
fungible: true;
|
|
708
708
|
} | {
|
|
709
709
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
710
710
|
fungible: false;
|
|
@@ -723,8 +723,8 @@ export declare const TransactionsPageStruct: import("@metamask/superstruct").Str
|
|
|
723
723
|
asset: import("@metamask/superstruct").Struct<{
|
|
724
724
|
unit: string;
|
|
725
725
|
type: `${string}:${string}/${string}:${string}`;
|
|
726
|
-
fungible: true;
|
|
727
726
|
amount: string;
|
|
727
|
+
fungible: true;
|
|
728
728
|
} | {
|
|
729
729
|
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
730
730
|
fungible: false;
|
package/dist/events.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RequestRejectedEventStruct = exports.RequestApprovedEventStruct = exports.AccountDeletedEventStruct = exports.AccountUpdatedEventStruct = exports.AccountCreatedEventStruct = exports.KeyringEvent = void 0;
|
|
3
|
+
exports.AccountAssetListUpdatedEventStruct = exports.AccountTransactionsUpdatedEventStruct = exports.AccountBalancesUpdatedEventStruct = exports.RequestRejectedEventStruct = exports.RequestApprovedEventStruct = exports.AccountDeletedEventStruct = exports.AccountUpdatedEventStruct = exports.AccountCreatedEventStruct = exports.KeyringEvent = void 0;
|
|
4
4
|
const keyring_utils_1 = require("@metamask/keyring-utils");
|
|
5
5
|
const superstruct_1 = require("@metamask/superstruct");
|
|
6
6
|
const utils_1 = require("@metamask/utils");
|
|
@@ -17,6 +17,10 @@ var KeyringEvent;
|
|
|
17
17
|
// Request events
|
|
18
18
|
KeyringEvent["RequestApproved"] = "notify:requestApproved";
|
|
19
19
|
KeyringEvent["RequestRejected"] = "notify:requestRejected";
|
|
20
|
+
// Assets related events
|
|
21
|
+
KeyringEvent["AccountBalancesUpdated"] = "notify:accountBalancesUpdated";
|
|
22
|
+
KeyringEvent["AccountAssetListUpdated"] = "notify:accountAssetListUpdated";
|
|
23
|
+
KeyringEvent["AccountTransactionsUpdated"] = "notify:accountTransactionsUpdated";
|
|
20
24
|
})(KeyringEvent || (exports.KeyringEvent = KeyringEvent = {}));
|
|
21
25
|
exports.AccountCreatedEventStruct = (0, keyring_utils_1.object)({
|
|
22
26
|
method: (0, superstruct_1.literal)(`${KeyringEvent.AccountCreated}`),
|
|
@@ -80,4 +84,74 @@ exports.RequestRejectedEventStruct = (0, keyring_utils_1.object)({
|
|
|
80
84
|
id: keyring_utils_1.UuidStruct,
|
|
81
85
|
}),
|
|
82
86
|
});
|
|
87
|
+
// Assets related events:
|
|
88
|
+
// -----------------------------------------------------------------------------------------------
|
|
89
|
+
exports.AccountBalancesUpdatedEventStruct = (0, keyring_utils_1.object)({
|
|
90
|
+
method: (0, superstruct_1.literal)(`${KeyringEvent.AccountBalancesUpdated}`),
|
|
91
|
+
params: (0, keyring_utils_1.object)({
|
|
92
|
+
/**
|
|
93
|
+
* Balances updates of accounts owned by the Snap.
|
|
94
|
+
*/
|
|
95
|
+
balances: (0, superstruct_1.record)(
|
|
96
|
+
/**
|
|
97
|
+
* Account ID.
|
|
98
|
+
*/
|
|
99
|
+
keyring_utils_1.AccountIdStruct,
|
|
100
|
+
/**
|
|
101
|
+
* Mapping of each owned assets and their respective balances for that account.
|
|
102
|
+
*/
|
|
103
|
+
(0, superstruct_1.record)(
|
|
104
|
+
/**
|
|
105
|
+
* Asset type (CAIP-19).
|
|
106
|
+
*/
|
|
107
|
+
utils_1.CaipAssetTypeStruct,
|
|
108
|
+
/**
|
|
109
|
+
* Balance information for a given asset.
|
|
110
|
+
*/
|
|
111
|
+
api_1.FungibleAssetAmountStruct)),
|
|
112
|
+
}),
|
|
113
|
+
});
|
|
114
|
+
exports.AccountTransactionsUpdatedEventStruct = (0, keyring_utils_1.object)({
|
|
115
|
+
method: (0, superstruct_1.literal)(`${KeyringEvent.AccountTransactionsUpdated}`),
|
|
116
|
+
params: (0, keyring_utils_1.object)({
|
|
117
|
+
/**
|
|
118
|
+
* Transactions updates of accounts owned by the Snap.
|
|
119
|
+
*/
|
|
120
|
+
transactions: (0, superstruct_1.record)(
|
|
121
|
+
/**
|
|
122
|
+
* Account ID.
|
|
123
|
+
*/
|
|
124
|
+
keyring_utils_1.AccountIdStruct,
|
|
125
|
+
/**
|
|
126
|
+
* List of updated transactions for that account.
|
|
127
|
+
*/
|
|
128
|
+
(0, superstruct_1.array)(api_1.TransactionStruct)),
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
exports.AccountAssetListUpdatedEventStruct = (0, keyring_utils_1.object)({
|
|
132
|
+
method: (0, superstruct_1.literal)(`${KeyringEvent.AccountAssetListUpdated}`),
|
|
133
|
+
params: (0, keyring_utils_1.object)({
|
|
134
|
+
/**
|
|
135
|
+
* Asset list update of accounts owned by the Snap.
|
|
136
|
+
*/
|
|
137
|
+
assets: (0, superstruct_1.record)(
|
|
138
|
+
/**
|
|
139
|
+
* Account ID.
|
|
140
|
+
*/
|
|
141
|
+
keyring_utils_1.AccountIdStruct,
|
|
142
|
+
/**
|
|
143
|
+
* Asset list changes for that account.
|
|
144
|
+
*/
|
|
145
|
+
(0, keyring_utils_1.object)({
|
|
146
|
+
/**
|
|
147
|
+
* New assets detected.
|
|
148
|
+
*/
|
|
149
|
+
added: (0, superstruct_1.array)(api_1.CaipAssetTypeOrIdStruct),
|
|
150
|
+
/**
|
|
151
|
+
* Assets no longer available on that account.
|
|
152
|
+
*/
|
|
153
|
+
removed: (0, superstruct_1.array)(api_1.CaipAssetTypeOrIdStruct),
|
|
154
|
+
})),
|
|
155
|
+
}),
|
|
156
|
+
});
|
|
83
157
|
//# sourceMappingURL=events.cjs.map
|
package/dist/events.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.cjs","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"events.cjs","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":";;;AAAA,2DAKiC;AAEjC,uDAAgF;AAChF,2CAAkE;AAElE,yCAKe;AAEf;;GAEG;AACH,IAAY,YAcX;AAdD,WAAY,YAAY;IACtB,iBAAiB;IACjB,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IACxC,wDAAwC,CAAA;IAExC,iBAAiB;IACjB,0DAA0C,CAAA;IAC1C,0DAA0C,CAAA;IAE1C,wBAAwB;IACxB,wEAAwD,CAAA;IACxD,0EAA0D,CAAA;IAC1D,gFAAgE,CAAA;AAClE,CAAC,EAdW,YAAY,4BAAZ,YAAY,QAcvB;AAEY,QAAA,yBAAyB,GAAG,IAAA,sBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,YAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,OAAO,EAAE,0BAAoB;Q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AAG,YAAY,CAAC,sBAAsB,EAAE,CAAC;IACzD,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,QAAQ,EAAE,IAAA,oBAAM;QACd;;WAEG;QACH,+BAAe;QAEf;;WAEG;QACH,IAAA,oBAAM;QACJ;;WAEG;QACH,2BAAmB;QAEnB;;WAEG;QACH,+BAAyB,CAC1B,CACF;KACF,CAAC;CACH,CAAC,CAAC;AAeU,QAAA,qCAAqC,GAAG,IAAA,sBAAM,EAAC;IAC1D,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,YAAY,CAAC,0BAA0B,EAAE,CAAC;IAC7D,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,YAAY,EAAE,IAAA,oBAAM;QAClB;;WAEG;QACH,+BAAe;QAEf;;WAEG;QACH,IAAA,mBAAK,EAAC,uBAAiB,CAAC,CACzB;KACF,CAAC;CACH,CAAC,CAAC;AAgBU,QAAA,kCAAkC,GAAG,IAAA,sBAAM,EAAC;IACvD,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,YAAY,CAAC,uBAAuB,EAAE,CAAC;IAC1D,MAAM,EAAE,IAAA,sBAAM,EAAC;QACb;;WAEG;QACH,MAAM,EAAE,IAAA,oBAAM;QACZ;;WAEG;QACH,+BAAe;QAEf;;WAEG;QACH,IAAA,sBAAM,EAAC;YACL;;eAEG;YACH,KAAK,EAAE,IAAA,mBAAK,EAAC,6BAAuB,CAAC;YAErC;;eAEG;YACH,OAAO,EAAE,IAAA,mBAAK,EAAC,6BAAuB,CAAC;SACxC,CAAC,CACH;KACF,CAAC;CACH,CAAC,CAAC","sourcesContent":["import {\n exactOptional,\n object,\n UuidStruct,\n AccountIdStruct,\n} from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, boolean, literal, record, string } from '@metamask/superstruct';\nimport { CaipAssetTypeStruct, JsonStruct } from '@metamask/utils';\n\nimport {\n CaipAssetTypeOrIdStruct,\n FungibleAssetAmountStruct,\n KeyringAccountStruct,\n TransactionStruct,\n} from './api';\n\n/**\n * Supported keyring events.\n */\nexport enum KeyringEvent {\n // Account events\n AccountCreated = 'notify:accountCreated',\n AccountUpdated = 'notify:accountUpdated',\n AccountDeleted = 'notify:accountDeleted',\n\n // Request events\n RequestApproved = 'notify:requestApproved',\n RequestRejected = 'notify:requestRejected',\n\n // Assets related events\n AccountBalancesUpdated = 'notify:accountBalancesUpdated',\n AccountAssetListUpdated = 'notify:accountAssetListUpdated',\n AccountTransactionsUpdated = 'notify:accountTransactionsUpdated',\n}\n\nexport const AccountCreatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountCreated}`),\n params: object({\n /**\n * New account object.\n */\n account: KeyringAccountStruct,\n\n /**\n * Account name suggestion provided to the MetaMask client.\n *\n * The keyring can suggest a name for the account, but it's up to the\n * client to decide whether to use it. The keyring won't be informed if the\n * client decides to use a different name.\n */\n accountNameSuggestion: exactOptional(string()),\n\n /**\n * Instructs MetaMask to display the add account confirmation dialog in the UI.\n * **Note:** This is not guaranteed to be honored by the MetaMask client.\n */\n displayConfirmation: exactOptional(boolean()),\n }),\n});\n\nexport const AccountUpdatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountUpdated}`),\n params: object({\n /**\n * Updated account object.\n */\n account: KeyringAccountStruct,\n }),\n});\n\nexport const AccountDeletedEventStruct = object({\n method: literal(`${KeyringEvent.AccountDeleted}`),\n params: object({\n /**\n * Deleted account ID.\n */\n id: UuidStruct,\n }),\n});\n\nexport const RequestApprovedEventStruct = object({\n method: literal(`${KeyringEvent.RequestApproved}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n});\n\nexport const RequestRejectedEventStruct = object({\n method: literal(`${KeyringEvent.RequestRejected}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n }),\n});\n\n// Assets related events:\n// -----------------------------------------------------------------------------------------------\n\nexport const AccountBalancesUpdatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountBalancesUpdated}`),\n params: object({\n /**\n * Balances updates of accounts owned by the Snap.\n */\n balances: record(\n /**\n * Account ID.\n */\n AccountIdStruct,\n\n /**\n * Mapping of each owned assets and their respective balances for that account.\n */\n record(\n /**\n * Asset type (CAIP-19).\n */\n CaipAssetTypeStruct,\n\n /**\n * Balance information for a given asset.\n */\n FungibleAssetAmountStruct,\n ),\n ),\n }),\n});\n\n/**\n * Event emitted when the balances of an account are updated.\n *\n * Only changes are reported.\n *\n * The Snap can choose to emit this event for multiple accounts at once.\n */\nexport type AccountBalancesUpdatedEvent = Infer<\n typeof AccountBalancesUpdatedEventStruct\n>;\nexport type AccountBalancesUpdatedEventPayload =\n AccountBalancesUpdatedEvent['params'];\n\nexport const AccountTransactionsUpdatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountTransactionsUpdated}`),\n params: object({\n /**\n * Transactions updates of accounts owned by the Snap.\n */\n transactions: record(\n /**\n * Account ID.\n */\n AccountIdStruct,\n\n /**\n * List of updated transactions for that account.\n */\n array(TransactionStruct),\n ),\n }),\n});\n\n/**\n * Event emitted when the transactions of an account are updated (added or\n * changed).\n *\n * Only changes are reported.\n *\n * The Snap can choose to emit this event for multiple accounts at once.\n */\nexport type AccountTransactionsUpdatedEvent = Infer<\n typeof AccountTransactionsUpdatedEventStruct\n>;\nexport type AccountTransactionsUpdatedEventPayload =\n AccountTransactionsUpdatedEvent['params'];\n\nexport const AccountAssetListUpdatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountAssetListUpdated}`),\n params: object({\n /**\n * Asset list update of accounts owned by the Snap.\n */\n assets: record(\n /**\n * Account ID.\n */\n AccountIdStruct,\n\n /**\n * Asset list changes for that account.\n */\n object({\n /**\n * New assets detected.\n */\n added: array(CaipAssetTypeOrIdStruct),\n\n /**\n * Assets no longer available on that account.\n */\n removed: array(CaipAssetTypeOrIdStruct),\n }),\n ),\n }),\n});\n\n/**\n * Event emitted when the assets of an account are updated.\n *\n * Only changes are reported.\n *\n * The Snap can choose to emit this event for multiple accounts at once.\n */\nexport type AccountAssetListUpdatedEvent = Infer<\n typeof AccountAssetListUpdatedEventStruct\n>;\nexport type AccountAssetListUpdatedEventPayload =\n AccountAssetListUpdatedEvent['params'];\n"]}
|
package/dist/events.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
|
1
2
|
/**
|
|
2
3
|
* Supported keyring events.
|
|
3
4
|
*/
|
|
@@ -6,7 +7,10 @@ export declare enum KeyringEvent {
|
|
|
6
7
|
AccountUpdated = "notify:accountUpdated",
|
|
7
8
|
AccountDeleted = "notify:accountDeleted",
|
|
8
9
|
RequestApproved = "notify:requestApproved",
|
|
9
|
-
RequestRejected = "notify:requestRejected"
|
|
10
|
+
RequestRejected = "notify:requestRejected",
|
|
11
|
+
AccountBalancesUpdated = "notify:accountBalancesUpdated",
|
|
12
|
+
AccountAssetListUpdated = "notify:accountAssetListUpdated",
|
|
13
|
+
AccountTransactionsUpdated = "notify:accountTransactionsUpdated"
|
|
10
14
|
}
|
|
11
15
|
export declare const AccountCreatedEventStruct: import("@metamask/superstruct").Struct<{
|
|
12
16
|
method: "notify:accountCreated";
|
|
@@ -177,4 +181,239 @@ export declare const RequestRejectedEventStruct: import("@metamask/superstruct")
|
|
|
177
181
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
178
182
|
}>;
|
|
179
183
|
}>;
|
|
184
|
+
export declare const AccountBalancesUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
|
185
|
+
method: "notify:accountBalancesUpdated";
|
|
186
|
+
params: {
|
|
187
|
+
balances: Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
|
188
|
+
unit: string;
|
|
189
|
+
amount: string;
|
|
190
|
+
}>>;
|
|
191
|
+
};
|
|
192
|
+
}, {
|
|
193
|
+
method: import("@metamask/superstruct").Struct<"notify:accountBalancesUpdated", "notify:accountBalancesUpdated">;
|
|
194
|
+
params: import("@metamask/superstruct").Struct<{
|
|
195
|
+
balances: Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
|
196
|
+
unit: string;
|
|
197
|
+
amount: string;
|
|
198
|
+
}>>;
|
|
199
|
+
}, {
|
|
200
|
+
/**
|
|
201
|
+
* Balances updates of accounts owned by the Snap.
|
|
202
|
+
*/
|
|
203
|
+
balances: import("@metamask/superstruct").Struct<Record<string, Record<`${string}:${string}/${string}:${string}`, {
|
|
204
|
+
unit: string;
|
|
205
|
+
amount: string;
|
|
206
|
+
}>>, null>;
|
|
207
|
+
}>;
|
|
208
|
+
}>;
|
|
209
|
+
/**
|
|
210
|
+
* Event emitted when the balances of an account are updated.
|
|
211
|
+
*
|
|
212
|
+
* Only changes are reported.
|
|
213
|
+
*
|
|
214
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
|
215
|
+
*/
|
|
216
|
+
export type AccountBalancesUpdatedEvent = Infer<typeof AccountBalancesUpdatedEventStruct>;
|
|
217
|
+
export type AccountBalancesUpdatedEventPayload = AccountBalancesUpdatedEvent['params'];
|
|
218
|
+
export declare const AccountTransactionsUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
|
219
|
+
method: "notify:accountTransactionsUpdated";
|
|
220
|
+
params: {
|
|
221
|
+
transactions: Record<string, {
|
|
222
|
+
type: "send" | "receive";
|
|
223
|
+
id: string;
|
|
224
|
+
from: {
|
|
225
|
+
address: string;
|
|
226
|
+
asset: {
|
|
227
|
+
unit: string;
|
|
228
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
229
|
+
amount: string;
|
|
230
|
+
fungible: true;
|
|
231
|
+
} | {
|
|
232
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
233
|
+
fungible: false;
|
|
234
|
+
} | null;
|
|
235
|
+
}[];
|
|
236
|
+
events: {
|
|
237
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
238
|
+
timestamp: number | null;
|
|
239
|
+
}[];
|
|
240
|
+
chain: `${string}:${string}`;
|
|
241
|
+
account: string;
|
|
242
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
243
|
+
timestamp: number | null;
|
|
244
|
+
to: {
|
|
245
|
+
address: string;
|
|
246
|
+
asset: {
|
|
247
|
+
unit: string;
|
|
248
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
249
|
+
amount: string;
|
|
250
|
+
fungible: true;
|
|
251
|
+
} | {
|
|
252
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
253
|
+
fungible: false;
|
|
254
|
+
} | null;
|
|
255
|
+
}[];
|
|
256
|
+
fees: {
|
|
257
|
+
type: "base" | "priority";
|
|
258
|
+
asset: {
|
|
259
|
+
unit: string;
|
|
260
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
261
|
+
amount: string;
|
|
262
|
+
fungible: true;
|
|
263
|
+
} | {
|
|
264
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
265
|
+
fungible: false;
|
|
266
|
+
};
|
|
267
|
+
}[];
|
|
268
|
+
}[]>;
|
|
269
|
+
};
|
|
270
|
+
}, {
|
|
271
|
+
method: import("@metamask/superstruct").Struct<"notify:accountTransactionsUpdated", "notify:accountTransactionsUpdated">;
|
|
272
|
+
params: import("@metamask/superstruct").Struct<{
|
|
273
|
+
transactions: Record<string, {
|
|
274
|
+
type: "send" | "receive";
|
|
275
|
+
id: string;
|
|
276
|
+
from: {
|
|
277
|
+
address: string;
|
|
278
|
+
asset: {
|
|
279
|
+
unit: string;
|
|
280
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
281
|
+
amount: string;
|
|
282
|
+
fungible: true;
|
|
283
|
+
} | {
|
|
284
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
285
|
+
fungible: false;
|
|
286
|
+
} | null;
|
|
287
|
+
}[];
|
|
288
|
+
events: {
|
|
289
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
290
|
+
timestamp: number | null;
|
|
291
|
+
}[];
|
|
292
|
+
chain: `${string}:${string}`;
|
|
293
|
+
account: string;
|
|
294
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
295
|
+
timestamp: number | null;
|
|
296
|
+
to: {
|
|
297
|
+
address: string;
|
|
298
|
+
asset: {
|
|
299
|
+
unit: string;
|
|
300
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
301
|
+
amount: string;
|
|
302
|
+
fungible: true;
|
|
303
|
+
} | {
|
|
304
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
305
|
+
fungible: false;
|
|
306
|
+
} | null;
|
|
307
|
+
}[];
|
|
308
|
+
fees: {
|
|
309
|
+
type: "base" | "priority";
|
|
310
|
+
asset: {
|
|
311
|
+
unit: string;
|
|
312
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
313
|
+
amount: string;
|
|
314
|
+
fungible: true;
|
|
315
|
+
} | {
|
|
316
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
317
|
+
fungible: false;
|
|
318
|
+
};
|
|
319
|
+
}[];
|
|
320
|
+
}[]>;
|
|
321
|
+
}, {
|
|
322
|
+
/**
|
|
323
|
+
* Transactions updates of accounts owned by the Snap.
|
|
324
|
+
*/
|
|
325
|
+
transactions: import("@metamask/superstruct").Struct<Record<string, {
|
|
326
|
+
type: "send" | "receive";
|
|
327
|
+
id: string;
|
|
328
|
+
from: {
|
|
329
|
+
address: string;
|
|
330
|
+
asset: {
|
|
331
|
+
unit: string;
|
|
332
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
333
|
+
amount: string;
|
|
334
|
+
fungible: true;
|
|
335
|
+
} | {
|
|
336
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
337
|
+
fungible: false;
|
|
338
|
+
} | null;
|
|
339
|
+
}[];
|
|
340
|
+
events: {
|
|
341
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
342
|
+
timestamp: number | null;
|
|
343
|
+
}[];
|
|
344
|
+
chain: `${string}:${string}`;
|
|
345
|
+
account: string;
|
|
346
|
+
status: "submitted" | "unconfirmed" | "confirmed" | "failed";
|
|
347
|
+
timestamp: number | null;
|
|
348
|
+
to: {
|
|
349
|
+
address: string;
|
|
350
|
+
asset: {
|
|
351
|
+
unit: string;
|
|
352
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
353
|
+
amount: string;
|
|
354
|
+
fungible: true;
|
|
355
|
+
} | {
|
|
356
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
357
|
+
fungible: false;
|
|
358
|
+
} | null;
|
|
359
|
+
}[];
|
|
360
|
+
fees: {
|
|
361
|
+
type: "base" | "priority";
|
|
362
|
+
asset: {
|
|
363
|
+
unit: string;
|
|
364
|
+
type: `${string}:${string}/${string}:${string}`;
|
|
365
|
+
amount: string;
|
|
366
|
+
fungible: true;
|
|
367
|
+
} | {
|
|
368
|
+
id: `${string}:${string}/${string}:${string}/${string}`;
|
|
369
|
+
fungible: false;
|
|
370
|
+
};
|
|
371
|
+
}[];
|
|
372
|
+
}[]>, null>;
|
|
373
|
+
}>;
|
|
374
|
+
}>;
|
|
375
|
+
/**
|
|
376
|
+
* Event emitted when the transactions of an account are updated (added or
|
|
377
|
+
* changed).
|
|
378
|
+
*
|
|
379
|
+
* Only changes are reported.
|
|
380
|
+
*
|
|
381
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
|
382
|
+
*/
|
|
383
|
+
export type AccountTransactionsUpdatedEvent = Infer<typeof AccountTransactionsUpdatedEventStruct>;
|
|
384
|
+
export type AccountTransactionsUpdatedEventPayload = AccountTransactionsUpdatedEvent['params'];
|
|
385
|
+
export declare const AccountAssetListUpdatedEventStruct: import("@metamask/superstruct").Struct<{
|
|
386
|
+
method: "notify:accountAssetListUpdated";
|
|
387
|
+
params: {
|
|
388
|
+
assets: Record<string, {
|
|
389
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
|
390
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
|
391
|
+
}>;
|
|
392
|
+
};
|
|
393
|
+
}, {
|
|
394
|
+
method: import("@metamask/superstruct").Struct<"notify:accountAssetListUpdated", "notify:accountAssetListUpdated">;
|
|
395
|
+
params: import("@metamask/superstruct").Struct<{
|
|
396
|
+
assets: Record<string, {
|
|
397
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
|
398
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
|
399
|
+
}>;
|
|
400
|
+
}, {
|
|
401
|
+
/**
|
|
402
|
+
* Asset list update of accounts owned by the Snap.
|
|
403
|
+
*/
|
|
404
|
+
assets: import("@metamask/superstruct").Struct<Record<string, {
|
|
405
|
+
added: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
|
406
|
+
removed: (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[];
|
|
407
|
+
}>, null>;
|
|
408
|
+
}>;
|
|
409
|
+
}>;
|
|
410
|
+
/**
|
|
411
|
+
* Event emitted when the assets of an account are updated.
|
|
412
|
+
*
|
|
413
|
+
* Only changes are reported.
|
|
414
|
+
*
|
|
415
|
+
* The Snap can choose to emit this event for multiple accounts at once.
|
|
416
|
+
*/
|
|
417
|
+
export type AccountAssetListUpdatedEvent = Infer<typeof AccountAssetListUpdatedEventStruct>;
|
|
418
|
+
export type AccountAssetListUpdatedEventPayload = AccountAssetListUpdatedEvent['params'];
|
|
180
419
|
//# sourceMappingURL=events.d.cts.map
|
package/dist/events.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.cts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,oBAAY,YAAY;IAEtB,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IACxC,cAAc,0BAA0B;IAGxC,eAAe,2BA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