@metamask-previews/keyring-api 20.1.0-a621908 → 21.0.0-855692d

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/dist/rpc.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
+ import type { Keyring } from "./api/index.cjs";
2
3
  /**
3
4
  * Keyring RPC methods used by the API.
4
5
  */
@@ -19,7 +20,8 @@ export declare enum KeyringRpcMethod {
19
20
  GetRequest = "keyring_getRequest",
20
21
  SubmitRequest = "keyring_submitRequest",
21
22
  ApproveRequest = "keyring_approveRequest",
22
- RejectRequest = "keyring_rejectRequest"
23
+ RejectRequest = "keyring_rejectRequest",
24
+ Batch = "keyring_batch"
23
25
  }
24
26
  /**
25
27
  * Check if a method is a keyring RPC method.
@@ -28,6 +30,18 @@ export declare enum KeyringRpcMethod {
28
30
  * @returns Whether the method is a keyring RPC method.
29
31
  */
30
32
  export declare function isKeyringRpcMethod(method: string): boolean;
33
+ /**
34
+ * Keyring RPC interface.
35
+ */
36
+ export type KeyringRpc = Keyring & {
37
+ /**
38
+ * Batch keyring RPC requests.
39
+ *
40
+ * @returns A promise that resolves to an array of results or errors for each
41
+ * keyring RPC requests.
42
+ */
43
+ batch(requests: BatchRequestRequest[]): Promise<BatchResponse>;
44
+ };
31
45
  export declare const ListAccountsRequestStruct: import("@metamask/superstruct").Struct<{
32
46
  method: "keyring_listAccounts";
33
47
  id: string | number | null;
@@ -681,7 +695,7 @@ export declare const ResolveAccountAddressResponseStruct: import("@metamask/supe
681
695
  address: import("@metamask/superstruct").Struct<`${string}:${string}:${string}`, null>;
682
696
  }>;
683
697
  export type ResolveAccountAddressResponse = Infer<typeof ResolveAccountAddressResponseStruct>;
684
- export declare const FilterAccountChainsStruct: import("@metamask/superstruct").Struct<{
698
+ export declare const FilterAccountChainsRequestStruct: import("@metamask/superstruct").Struct<{
685
699
  method: "keyring_filterAccountChains";
686
700
  id: string | number | null;
687
701
  jsonrpc: "2.0";
@@ -701,7 +715,7 @@ export declare const FilterAccountChainsStruct: import("@metamask/superstruct").
701
715
  jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
702
716
  id: import("@metamask/superstruct").Struct<string | number | null, null>;
703
717
  }>;
704
- export type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsStruct>;
718
+ export type FilterAccountChainsRequest = Infer<typeof FilterAccountChainsRequestStruct>;
705
719
  export declare const FilterAccountChainsResponseStruct: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
706
720
  export type FilterAccountChainsResponse = Infer<typeof FilterAccountChainsResponseStruct>;
707
721
  export declare const UpdateAccountRequestStruct: import("@metamask/superstruct").Struct<{
@@ -1021,4 +1035,1160 @@ export declare const RejectRequestRequestStruct: import("@metamask/superstruct")
1021
1035
  export type RejectRequestRequest = Infer<typeof RejectRequestRequestStruct>;
1022
1036
  export declare const RejectRequestResponseStruct: import("@metamask/superstruct").Struct<null, null>;
1023
1037
  export type RejectRequestResponse = Infer<typeof RejectRequestResponseStruct>;
1038
+ export declare const BatchRequestRequestStruct: import("@metamask/superstruct").Struct<{
1039
+ method: "keyring_listAccounts";
1040
+ id: string | number | null;
1041
+ jsonrpc: "2.0";
1042
+ } | {
1043
+ method: "keyring_getAccount";
1044
+ id: string | number | null;
1045
+ jsonrpc: "2.0";
1046
+ params: {
1047
+ id: string;
1048
+ };
1049
+ } | {
1050
+ method: "keyring_createAccount";
1051
+ id: string | number | null;
1052
+ jsonrpc: "2.0";
1053
+ params: {
1054
+ options: Record<string, import("@metamask/utils").Json>;
1055
+ };
1056
+ } | {
1057
+ method: "keyring_discoverAccounts";
1058
+ id: string | number | null;
1059
+ jsonrpc: "2.0";
1060
+ params: {
1061
+ groupIndex: number;
1062
+ scopes: `${string}:${string}`[];
1063
+ entropySource: string;
1064
+ };
1065
+ } | {
1066
+ method: "keyring_listAccountAssets";
1067
+ id: string | number | null;
1068
+ jsonrpc: "2.0";
1069
+ params: {
1070
+ id: string;
1071
+ };
1072
+ } | {
1073
+ method: "keyring_listAccountTransactions";
1074
+ id: string | number | null;
1075
+ jsonrpc: "2.0";
1076
+ params: {
1077
+ id: string;
1078
+ pagination: {
1079
+ limit: number;
1080
+ next?: string | null;
1081
+ };
1082
+ };
1083
+ } | {
1084
+ method: "keyring_getAccountBalances";
1085
+ id: string | number | null;
1086
+ jsonrpc: "2.0";
1087
+ params: {
1088
+ id: string;
1089
+ assets: `${string}:${string}/${string}:${string}`[];
1090
+ };
1091
+ } | {
1092
+ method: "keyring_resolveAccountAddress";
1093
+ id: string | number | null;
1094
+ jsonrpc: "2.0";
1095
+ params: {
1096
+ request: {
1097
+ method: string;
1098
+ id: string | number | null;
1099
+ jsonrpc: "2.0";
1100
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1101
+ };
1102
+ scope: `${string}:${string}`;
1103
+ };
1104
+ } | {
1105
+ method: "keyring_filterAccountChains";
1106
+ id: string | number | null;
1107
+ jsonrpc: "2.0";
1108
+ params: {
1109
+ id: string;
1110
+ chains: string[];
1111
+ };
1112
+ } | {
1113
+ method: "keyring_updateAccount";
1114
+ id: string | number | null;
1115
+ jsonrpc: "2.0";
1116
+ params: {
1117
+ account: {
1118
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
1119
+ id: string;
1120
+ options: Record<string, import("@metamask/utils").Json> & {
1121
+ entropy?: {
1122
+ type: "mnemonic";
1123
+ id: string;
1124
+ derivationPath: string;
1125
+ groupIndex: number;
1126
+ } | {
1127
+ type: "private-key";
1128
+ };
1129
+ exportable?: boolean;
1130
+ };
1131
+ address: string;
1132
+ scopes: `${string}:${string}`[];
1133
+ methods: string[];
1134
+ };
1135
+ };
1136
+ } | {
1137
+ method: "keyring_deleteAccount";
1138
+ id: string | number | null;
1139
+ jsonrpc: "2.0";
1140
+ params: {
1141
+ id: string;
1142
+ };
1143
+ } | {
1144
+ method: "keyring_exportAccount";
1145
+ id: string | number | null;
1146
+ jsonrpc: "2.0";
1147
+ params: {
1148
+ id: string;
1149
+ };
1150
+ } | {
1151
+ method: "keyring_listRequests";
1152
+ id: string | number | null;
1153
+ jsonrpc: "2.0";
1154
+ } | {
1155
+ method: "keyring_getRequest";
1156
+ id: string | number | null;
1157
+ jsonrpc: "2.0";
1158
+ params: {
1159
+ id: string;
1160
+ };
1161
+ } | {
1162
+ method: "keyring_submitRequest";
1163
+ id: string | number | null;
1164
+ jsonrpc: "2.0";
1165
+ params: {
1166
+ id: string;
1167
+ origin: string;
1168
+ request: {
1169
+ method: string;
1170
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1171
+ };
1172
+ scope: string;
1173
+ account: string;
1174
+ };
1175
+ } | {
1176
+ method: "keyring_approveRequest";
1177
+ id: string | number | null;
1178
+ jsonrpc: "2.0";
1179
+ params: {
1180
+ data: Record<string, import("@metamask/utils").Json>;
1181
+ id: string;
1182
+ };
1183
+ } | {
1184
+ method: "keyring_rejectRequest";
1185
+ id: string | number | null;
1186
+ jsonrpc: "2.0";
1187
+ params: {
1188
+ id: string;
1189
+ };
1190
+ }, null>;
1191
+ export type BatchRequestRequest = Infer<typeof BatchRequestRequestStruct>;
1192
+ export declare const BatchRequestResponseStruct: import("@metamask/superstruct").Struct<string[] | Record<string, import("@metamask/utils").Json> | {
1193
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
1194
+ id: string;
1195
+ options: Record<string, import("@metamask/utils").Json> & {
1196
+ entropy?: {
1197
+ type: "mnemonic";
1198
+ id: string;
1199
+ derivationPath: string;
1200
+ groupIndex: number;
1201
+ } | {
1202
+ type: "private-key";
1203
+ };
1204
+ exportable?: boolean;
1205
+ };
1206
+ address: string;
1207
+ scopes: `${string}:${string}`[];
1208
+ methods: string[];
1209
+ } | {
1210
+ id: string;
1211
+ origin: string;
1212
+ request: {
1213
+ method: string;
1214
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1215
+ };
1216
+ scope: string;
1217
+ account: string;
1218
+ } | {
1219
+ pending: true;
1220
+ redirect?: {
1221
+ message?: string;
1222
+ url?: string;
1223
+ };
1224
+ } | {
1225
+ result: import("@metamask/utils").Json;
1226
+ pending: false;
1227
+ } | {
1228
+ data: {
1229
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive";
1230
+ id: string;
1231
+ from: {
1232
+ address: string;
1233
+ asset: {
1234
+ unit: string;
1235
+ type: `${string}:${string}/${string}:${string}`;
1236
+ amount: string;
1237
+ fungible: true;
1238
+ } | {
1239
+ id: `${string}:${string}/${string}:${string}/${string}`;
1240
+ fungible: false;
1241
+ } | null;
1242
+ }[];
1243
+ events: {
1244
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
1245
+ timestamp: number | null;
1246
+ }[];
1247
+ chain: `${string}:${string}`;
1248
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
1249
+ account: string;
1250
+ timestamp: number | null;
1251
+ to: {
1252
+ address: string;
1253
+ asset: {
1254
+ unit: string;
1255
+ type: `${string}:${string}/${string}:${string}`;
1256
+ amount: string;
1257
+ fungible: true;
1258
+ } | {
1259
+ id: `${string}:${string}/${string}:${string}/${string}`;
1260
+ fungible: false;
1261
+ } | null;
1262
+ }[];
1263
+ fees: {
1264
+ type: "base" | "priority";
1265
+ asset: {
1266
+ unit: string;
1267
+ type: `${string}:${string}/${string}:${string}`;
1268
+ amount: string;
1269
+ fungible: true;
1270
+ } | {
1271
+ id: `${string}:${string}/${string}:${string}/${string}`;
1272
+ fungible: false;
1273
+ };
1274
+ }[];
1275
+ }[];
1276
+ next: string | null;
1277
+ } | {
1278
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
1279
+ id: string;
1280
+ options: Record<string, import("@metamask/utils").Json> & {
1281
+ entropy?: {
1282
+ type: "mnemonic";
1283
+ id: string;
1284
+ derivationPath: string;
1285
+ groupIndex: number;
1286
+ } | {
1287
+ type: "private-key";
1288
+ };
1289
+ exportable?: boolean;
1290
+ };
1291
+ address: string;
1292
+ scopes: `${string}:${string}`[];
1293
+ methods: string[];
1294
+ }[] | (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[] | {
1295
+ type: "bip44";
1296
+ derivationPath: `m/${string}`;
1297
+ scopes: `${string}:${string}`[];
1298
+ }[] | Record<`${string}:${string}/${string}:${string}`, {
1299
+ unit: string;
1300
+ amount: string;
1301
+ }> | {
1302
+ id: string;
1303
+ origin: string;
1304
+ request: {
1305
+ method: string;
1306
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1307
+ };
1308
+ scope: string;
1309
+ account: string;
1310
+ }[] | {
1311
+ address: `${string}:${string}:${string}`;
1312
+ } | null, null>;
1313
+ export type BatchRequestResponse = Infer<typeof BatchRequestResponseStruct>;
1314
+ export declare const BatchRequestStruct: import("@metamask/superstruct").Struct<{
1315
+ method: "keyring_batch";
1316
+ id: string | number | null;
1317
+ jsonrpc: "2.0";
1318
+ params: {
1319
+ id: string;
1320
+ requests: ({
1321
+ method: "keyring_listAccounts";
1322
+ id: string | number | null;
1323
+ jsonrpc: "2.0";
1324
+ } | {
1325
+ method: "keyring_getAccount";
1326
+ id: string | number | null;
1327
+ jsonrpc: "2.0";
1328
+ params: {
1329
+ id: string;
1330
+ };
1331
+ } | {
1332
+ method: "keyring_createAccount";
1333
+ id: string | number | null;
1334
+ jsonrpc: "2.0";
1335
+ params: {
1336
+ options: Record<string, import("@metamask/utils").Json>;
1337
+ };
1338
+ } | {
1339
+ method: "keyring_discoverAccounts";
1340
+ id: string | number | null;
1341
+ jsonrpc: "2.0";
1342
+ params: {
1343
+ groupIndex: number;
1344
+ scopes: `${string}:${string}`[];
1345
+ entropySource: string;
1346
+ };
1347
+ } | {
1348
+ method: "keyring_listAccountAssets";
1349
+ id: string | number | null;
1350
+ jsonrpc: "2.0";
1351
+ params: {
1352
+ id: string;
1353
+ };
1354
+ } | {
1355
+ method: "keyring_listAccountTransactions";
1356
+ id: string | number | null;
1357
+ jsonrpc: "2.0";
1358
+ params: {
1359
+ id: string;
1360
+ pagination: {
1361
+ limit: number;
1362
+ next?: string | null;
1363
+ };
1364
+ };
1365
+ } | {
1366
+ method: "keyring_getAccountBalances";
1367
+ id: string | number | null;
1368
+ jsonrpc: "2.0";
1369
+ params: {
1370
+ id: string;
1371
+ assets: `${string}:${string}/${string}:${string}`[];
1372
+ };
1373
+ } | {
1374
+ method: "keyring_resolveAccountAddress";
1375
+ id: string | number | null;
1376
+ jsonrpc: "2.0";
1377
+ params: {
1378
+ request: {
1379
+ method: string;
1380
+ id: string | number | null;
1381
+ jsonrpc: "2.0";
1382
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1383
+ };
1384
+ scope: `${string}:${string}`;
1385
+ };
1386
+ } | {
1387
+ method: "keyring_filterAccountChains";
1388
+ id: string | number | null;
1389
+ jsonrpc: "2.0";
1390
+ params: {
1391
+ id: string;
1392
+ chains: string[];
1393
+ };
1394
+ } | {
1395
+ method: "keyring_updateAccount";
1396
+ id: string | number | null;
1397
+ jsonrpc: "2.0";
1398
+ params: {
1399
+ account: {
1400
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
1401
+ id: string;
1402
+ options: Record<string, import("@metamask/utils").Json> & {
1403
+ entropy?: {
1404
+ type: "mnemonic";
1405
+ id: string;
1406
+ derivationPath: string;
1407
+ groupIndex: number;
1408
+ } | {
1409
+ type: "private-key";
1410
+ };
1411
+ exportable?: boolean;
1412
+ };
1413
+ address: string;
1414
+ scopes: `${string}:${string}`[];
1415
+ methods: string[];
1416
+ };
1417
+ };
1418
+ } | {
1419
+ method: "keyring_deleteAccount";
1420
+ id: string | number | null;
1421
+ jsonrpc: "2.0";
1422
+ params: {
1423
+ id: string;
1424
+ };
1425
+ } | {
1426
+ method: "keyring_exportAccount";
1427
+ id: string | number | null;
1428
+ jsonrpc: "2.0";
1429
+ params: {
1430
+ id: string;
1431
+ };
1432
+ } | {
1433
+ method: "keyring_listRequests";
1434
+ id: string | number | null;
1435
+ jsonrpc: "2.0";
1436
+ } | {
1437
+ method: "keyring_getRequest";
1438
+ id: string | number | null;
1439
+ jsonrpc: "2.0";
1440
+ params: {
1441
+ id: string;
1442
+ };
1443
+ } | {
1444
+ method: "keyring_submitRequest";
1445
+ id: string | number | null;
1446
+ jsonrpc: "2.0";
1447
+ params: {
1448
+ id: string;
1449
+ origin: string;
1450
+ request: {
1451
+ method: string;
1452
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1453
+ };
1454
+ scope: string;
1455
+ account: string;
1456
+ };
1457
+ } | {
1458
+ method: "keyring_approveRequest";
1459
+ id: string | number | null;
1460
+ jsonrpc: "2.0";
1461
+ params: {
1462
+ data: Record<string, import("@metamask/utils").Json>;
1463
+ id: string;
1464
+ };
1465
+ } | {
1466
+ method: "keyring_rejectRequest";
1467
+ id: string | number | null;
1468
+ jsonrpc: "2.0";
1469
+ params: {
1470
+ id: string;
1471
+ };
1472
+ })[];
1473
+ };
1474
+ }, {
1475
+ method: import("@metamask/superstruct").Struct<"keyring_batch", "keyring_batch">;
1476
+ params: import("@metamask/superstruct").Struct<{
1477
+ id: string;
1478
+ requests: ({
1479
+ method: "keyring_listAccounts";
1480
+ id: string | number | null;
1481
+ jsonrpc: "2.0";
1482
+ } | {
1483
+ method: "keyring_getAccount";
1484
+ id: string | number | null;
1485
+ jsonrpc: "2.0";
1486
+ params: {
1487
+ id: string;
1488
+ };
1489
+ } | {
1490
+ method: "keyring_createAccount";
1491
+ id: string | number | null;
1492
+ jsonrpc: "2.0";
1493
+ params: {
1494
+ options: Record<string, import("@metamask/utils").Json>;
1495
+ };
1496
+ } | {
1497
+ method: "keyring_discoverAccounts";
1498
+ id: string | number | null;
1499
+ jsonrpc: "2.0";
1500
+ params: {
1501
+ groupIndex: number;
1502
+ scopes: `${string}:${string}`[];
1503
+ entropySource: string;
1504
+ };
1505
+ } | {
1506
+ method: "keyring_listAccountAssets";
1507
+ id: string | number | null;
1508
+ jsonrpc: "2.0";
1509
+ params: {
1510
+ id: string;
1511
+ };
1512
+ } | {
1513
+ method: "keyring_listAccountTransactions";
1514
+ id: string | number | null;
1515
+ jsonrpc: "2.0";
1516
+ params: {
1517
+ id: string;
1518
+ pagination: {
1519
+ limit: number;
1520
+ next?: string | null;
1521
+ };
1522
+ };
1523
+ } | {
1524
+ method: "keyring_getAccountBalances";
1525
+ id: string | number | null;
1526
+ jsonrpc: "2.0";
1527
+ params: {
1528
+ id: string;
1529
+ assets: `${string}:${string}/${string}:${string}`[];
1530
+ };
1531
+ } | {
1532
+ method: "keyring_resolveAccountAddress";
1533
+ id: string | number | null;
1534
+ jsonrpc: "2.0";
1535
+ params: {
1536
+ request: {
1537
+ method: string;
1538
+ id: string | number | null;
1539
+ jsonrpc: "2.0";
1540
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1541
+ };
1542
+ scope: `${string}:${string}`;
1543
+ };
1544
+ } | {
1545
+ method: "keyring_filterAccountChains";
1546
+ id: string | number | null;
1547
+ jsonrpc: "2.0";
1548
+ params: {
1549
+ id: string;
1550
+ chains: string[];
1551
+ };
1552
+ } | {
1553
+ method: "keyring_updateAccount";
1554
+ id: string | number | null;
1555
+ jsonrpc: "2.0";
1556
+ params: {
1557
+ account: {
1558
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
1559
+ id: string;
1560
+ options: Record<string, import("@metamask/utils").Json> & {
1561
+ entropy?: {
1562
+ type: "mnemonic";
1563
+ id: string;
1564
+ derivationPath: string;
1565
+ groupIndex: number;
1566
+ } | {
1567
+ type: "private-key";
1568
+ };
1569
+ exportable?: boolean;
1570
+ };
1571
+ address: string;
1572
+ scopes: `${string}:${string}`[];
1573
+ methods: string[];
1574
+ };
1575
+ };
1576
+ } | {
1577
+ method: "keyring_deleteAccount";
1578
+ id: string | number | null;
1579
+ jsonrpc: "2.0";
1580
+ params: {
1581
+ id: string;
1582
+ };
1583
+ } | {
1584
+ method: "keyring_exportAccount";
1585
+ id: string | number | null;
1586
+ jsonrpc: "2.0";
1587
+ params: {
1588
+ id: string;
1589
+ };
1590
+ } | {
1591
+ method: "keyring_listRequests";
1592
+ id: string | number | null;
1593
+ jsonrpc: "2.0";
1594
+ } | {
1595
+ method: "keyring_getRequest";
1596
+ id: string | number | null;
1597
+ jsonrpc: "2.0";
1598
+ params: {
1599
+ id: string;
1600
+ };
1601
+ } | {
1602
+ method: "keyring_submitRequest";
1603
+ id: string | number | null;
1604
+ jsonrpc: "2.0";
1605
+ params: {
1606
+ id: string;
1607
+ origin: string;
1608
+ request: {
1609
+ method: string;
1610
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1611
+ };
1612
+ scope: string;
1613
+ account: string;
1614
+ };
1615
+ } | {
1616
+ method: "keyring_approveRequest";
1617
+ id: string | number | null;
1618
+ jsonrpc: "2.0";
1619
+ params: {
1620
+ data: Record<string, import("@metamask/utils").Json>;
1621
+ id: string;
1622
+ };
1623
+ } | {
1624
+ method: "keyring_rejectRequest";
1625
+ id: string | number | null;
1626
+ jsonrpc: "2.0";
1627
+ params: {
1628
+ id: string;
1629
+ };
1630
+ })[];
1631
+ }, {
1632
+ id: import("@metamask/superstruct").Struct<string, null>;
1633
+ requests: import("@metamask/superstruct").Struct<({
1634
+ method: "keyring_listAccounts";
1635
+ id: string | number | null;
1636
+ jsonrpc: "2.0";
1637
+ } | {
1638
+ method: "keyring_getAccount";
1639
+ id: string | number | null;
1640
+ jsonrpc: "2.0";
1641
+ params: {
1642
+ id: string;
1643
+ };
1644
+ } | {
1645
+ method: "keyring_createAccount";
1646
+ id: string | number | null;
1647
+ jsonrpc: "2.0";
1648
+ params: {
1649
+ options: Record<string, import("@metamask/utils").Json>;
1650
+ };
1651
+ } | {
1652
+ method: "keyring_discoverAccounts";
1653
+ id: string | number | null;
1654
+ jsonrpc: "2.0";
1655
+ params: {
1656
+ groupIndex: number;
1657
+ scopes: `${string}:${string}`[];
1658
+ entropySource: string;
1659
+ };
1660
+ } | {
1661
+ method: "keyring_listAccountAssets";
1662
+ id: string | number | null;
1663
+ jsonrpc: "2.0";
1664
+ params: {
1665
+ id: string;
1666
+ };
1667
+ } | {
1668
+ method: "keyring_listAccountTransactions";
1669
+ id: string | number | null;
1670
+ jsonrpc: "2.0";
1671
+ params: {
1672
+ id: string;
1673
+ pagination: {
1674
+ limit: number;
1675
+ next?: string | null;
1676
+ };
1677
+ };
1678
+ } | {
1679
+ method: "keyring_getAccountBalances";
1680
+ id: string | number | null;
1681
+ jsonrpc: "2.0";
1682
+ params: {
1683
+ id: string;
1684
+ assets: `${string}:${string}/${string}:${string}`[];
1685
+ };
1686
+ } | {
1687
+ method: "keyring_resolveAccountAddress";
1688
+ id: string | number | null;
1689
+ jsonrpc: "2.0";
1690
+ params: {
1691
+ request: {
1692
+ method: string;
1693
+ id: string | number | null;
1694
+ jsonrpc: "2.0";
1695
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1696
+ };
1697
+ scope: `${string}:${string}`;
1698
+ };
1699
+ } | {
1700
+ method: "keyring_filterAccountChains";
1701
+ id: string | number | null;
1702
+ jsonrpc: "2.0";
1703
+ params: {
1704
+ id: string;
1705
+ chains: string[];
1706
+ };
1707
+ } | {
1708
+ method: "keyring_updateAccount";
1709
+ id: string | number | null;
1710
+ jsonrpc: "2.0";
1711
+ params: {
1712
+ account: {
1713
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
1714
+ id: string;
1715
+ options: Record<string, import("@metamask/utils").Json> & {
1716
+ entropy?: {
1717
+ type: "mnemonic";
1718
+ id: string;
1719
+ derivationPath: string;
1720
+ groupIndex: number;
1721
+ } | {
1722
+ type: "private-key";
1723
+ };
1724
+ exportable?: boolean;
1725
+ };
1726
+ address: string;
1727
+ scopes: `${string}:${string}`[];
1728
+ methods: string[];
1729
+ };
1730
+ };
1731
+ } | {
1732
+ method: "keyring_deleteAccount";
1733
+ id: string | number | null;
1734
+ jsonrpc: "2.0";
1735
+ params: {
1736
+ id: string;
1737
+ };
1738
+ } | {
1739
+ method: "keyring_exportAccount";
1740
+ id: string | number | null;
1741
+ jsonrpc: "2.0";
1742
+ params: {
1743
+ id: string;
1744
+ };
1745
+ } | {
1746
+ method: "keyring_listRequests";
1747
+ id: string | number | null;
1748
+ jsonrpc: "2.0";
1749
+ } | {
1750
+ method: "keyring_getRequest";
1751
+ id: string | number | null;
1752
+ jsonrpc: "2.0";
1753
+ params: {
1754
+ id: string;
1755
+ };
1756
+ } | {
1757
+ method: "keyring_submitRequest";
1758
+ id: string | number | null;
1759
+ jsonrpc: "2.0";
1760
+ params: {
1761
+ id: string;
1762
+ origin: string;
1763
+ request: {
1764
+ method: string;
1765
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1766
+ };
1767
+ scope: string;
1768
+ account: string;
1769
+ };
1770
+ } | {
1771
+ method: "keyring_approveRequest";
1772
+ id: string | number | null;
1773
+ jsonrpc: "2.0";
1774
+ params: {
1775
+ data: Record<string, import("@metamask/utils").Json>;
1776
+ id: string;
1777
+ };
1778
+ } | {
1779
+ method: "keyring_rejectRequest";
1780
+ id: string | number | null;
1781
+ jsonrpc: "2.0";
1782
+ params: {
1783
+ id: string;
1784
+ };
1785
+ })[], import("@metamask/superstruct").Struct<{
1786
+ method: "keyring_listAccounts";
1787
+ id: string | number | null;
1788
+ jsonrpc: "2.0";
1789
+ } | {
1790
+ method: "keyring_getAccount";
1791
+ id: string | number | null;
1792
+ jsonrpc: "2.0";
1793
+ params: {
1794
+ id: string;
1795
+ };
1796
+ } | {
1797
+ method: "keyring_createAccount";
1798
+ id: string | number | null;
1799
+ jsonrpc: "2.0";
1800
+ params: {
1801
+ options: Record<string, import("@metamask/utils").Json>;
1802
+ };
1803
+ } | {
1804
+ method: "keyring_discoverAccounts";
1805
+ id: string | number | null;
1806
+ jsonrpc: "2.0";
1807
+ params: {
1808
+ groupIndex: number;
1809
+ scopes: `${string}:${string}`[];
1810
+ entropySource: string;
1811
+ };
1812
+ } | {
1813
+ method: "keyring_listAccountAssets";
1814
+ id: string | number | null;
1815
+ jsonrpc: "2.0";
1816
+ params: {
1817
+ id: string;
1818
+ };
1819
+ } | {
1820
+ method: "keyring_listAccountTransactions";
1821
+ id: string | number | null;
1822
+ jsonrpc: "2.0";
1823
+ params: {
1824
+ id: string;
1825
+ pagination: {
1826
+ limit: number;
1827
+ next?: string | null;
1828
+ };
1829
+ };
1830
+ } | {
1831
+ method: "keyring_getAccountBalances";
1832
+ id: string | number | null;
1833
+ jsonrpc: "2.0";
1834
+ params: {
1835
+ id: string;
1836
+ assets: `${string}:${string}/${string}:${string}`[];
1837
+ };
1838
+ } | {
1839
+ method: "keyring_resolveAccountAddress";
1840
+ id: string | number | null;
1841
+ jsonrpc: "2.0";
1842
+ params: {
1843
+ request: {
1844
+ method: string;
1845
+ id: string | number | null;
1846
+ jsonrpc: "2.0";
1847
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1848
+ };
1849
+ scope: `${string}:${string}`;
1850
+ };
1851
+ } | {
1852
+ method: "keyring_filterAccountChains";
1853
+ id: string | number | null;
1854
+ jsonrpc: "2.0";
1855
+ params: {
1856
+ id: string;
1857
+ chains: string[];
1858
+ };
1859
+ } | {
1860
+ method: "keyring_updateAccount";
1861
+ id: string | number | null;
1862
+ jsonrpc: "2.0";
1863
+ params: {
1864
+ account: {
1865
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
1866
+ id: string;
1867
+ options: Record<string, import("@metamask/utils").Json> & {
1868
+ entropy?: {
1869
+ type: "mnemonic";
1870
+ id: string;
1871
+ derivationPath: string;
1872
+ groupIndex: number;
1873
+ } | {
1874
+ type: "private-key";
1875
+ };
1876
+ exportable?: boolean;
1877
+ };
1878
+ address: string;
1879
+ scopes: `${string}:${string}`[];
1880
+ methods: string[];
1881
+ };
1882
+ };
1883
+ } | {
1884
+ method: "keyring_deleteAccount";
1885
+ id: string | number | null;
1886
+ jsonrpc: "2.0";
1887
+ params: {
1888
+ id: string;
1889
+ };
1890
+ } | {
1891
+ method: "keyring_exportAccount";
1892
+ id: string | number | null;
1893
+ jsonrpc: "2.0";
1894
+ params: {
1895
+ id: string;
1896
+ };
1897
+ } | {
1898
+ method: "keyring_listRequests";
1899
+ id: string | number | null;
1900
+ jsonrpc: "2.0";
1901
+ } | {
1902
+ method: "keyring_getRequest";
1903
+ id: string | number | null;
1904
+ jsonrpc: "2.0";
1905
+ params: {
1906
+ id: string;
1907
+ };
1908
+ } | {
1909
+ method: "keyring_submitRequest";
1910
+ id: string | number | null;
1911
+ jsonrpc: "2.0";
1912
+ params: {
1913
+ id: string;
1914
+ origin: string;
1915
+ request: {
1916
+ method: string;
1917
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1918
+ };
1919
+ scope: string;
1920
+ account: string;
1921
+ };
1922
+ } | {
1923
+ method: "keyring_approveRequest";
1924
+ id: string | number | null;
1925
+ jsonrpc: "2.0";
1926
+ params: {
1927
+ data: Record<string, import("@metamask/utils").Json>;
1928
+ id: string;
1929
+ };
1930
+ } | {
1931
+ method: "keyring_rejectRequest";
1932
+ id: string | number | null;
1933
+ jsonrpc: "2.0";
1934
+ params: {
1935
+ id: string;
1936
+ };
1937
+ }, null>>;
1938
+ }>;
1939
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
1940
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
1941
+ }>;
1942
+ export type BatchRequest = Infer<typeof BatchRequestStruct>;
1943
+ export declare const BatchResponseStruct: import("@metamask/superstruct").Struct<({
1944
+ response: string[] | Record<string, import("@metamask/utils").Json> | {
1945
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
1946
+ id: string;
1947
+ options: Record<string, import("@metamask/utils").Json> & {
1948
+ entropy?: {
1949
+ type: "mnemonic";
1950
+ id: string;
1951
+ derivationPath: string;
1952
+ groupIndex: number;
1953
+ } | {
1954
+ type: "private-key";
1955
+ };
1956
+ exportable?: boolean;
1957
+ };
1958
+ address: string;
1959
+ scopes: `${string}:${string}`[];
1960
+ methods: string[];
1961
+ } | {
1962
+ id: string;
1963
+ origin: string;
1964
+ request: {
1965
+ method: string;
1966
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
1967
+ };
1968
+ scope: string;
1969
+ account: string;
1970
+ } | {
1971
+ pending: true;
1972
+ redirect?: {
1973
+ message?: string;
1974
+ url?: string;
1975
+ };
1976
+ } | {
1977
+ result: import("@metamask/utils").Json;
1978
+ pending: false;
1979
+ } | {
1980
+ data: {
1981
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive";
1982
+ id: string;
1983
+ from: {
1984
+ address: string;
1985
+ asset: {
1986
+ unit: string;
1987
+ type: `${string}:${string}/${string}:${string}`;
1988
+ amount: string;
1989
+ fungible: true;
1990
+ } | {
1991
+ id: `${string}:${string}/${string}:${string}/${string}`;
1992
+ fungible: false;
1993
+ } | null;
1994
+ }[];
1995
+ events: {
1996
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
1997
+ timestamp: number | null;
1998
+ }[];
1999
+ chain: `${string}:${string}`;
2000
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
2001
+ account: string;
2002
+ timestamp: number | null;
2003
+ to: {
2004
+ address: string;
2005
+ asset: {
2006
+ unit: string;
2007
+ type: `${string}:${string}/${string}:${string}`;
2008
+ amount: string;
2009
+ fungible: true;
2010
+ } | {
2011
+ id: `${string}:${string}/${string}:${string}/${string}`;
2012
+ fungible: false;
2013
+ } | null;
2014
+ }[];
2015
+ fees: {
2016
+ type: "base" | "priority";
2017
+ asset: {
2018
+ unit: string;
2019
+ type: `${string}:${string}/${string}:${string}`;
2020
+ amount: string;
2021
+ fungible: true;
2022
+ } | {
2023
+ id: `${string}:${string}/${string}:${string}/${string}`;
2024
+ fungible: false;
2025
+ };
2026
+ }[];
2027
+ }[];
2028
+ next: string | null;
2029
+ } | {
2030
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
2031
+ id: string;
2032
+ options: Record<string, import("@metamask/utils").Json> & {
2033
+ entropy?: {
2034
+ type: "mnemonic";
2035
+ id: string;
2036
+ derivationPath: string;
2037
+ groupIndex: number;
2038
+ } | {
2039
+ type: "private-key";
2040
+ };
2041
+ exportable?: boolean;
2042
+ };
2043
+ address: string;
2044
+ scopes: `${string}:${string}`[];
2045
+ methods: string[];
2046
+ }[] | (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[] | {
2047
+ type: "bip44";
2048
+ derivationPath: `m/${string}`;
2049
+ scopes: `${string}:${string}`[];
2050
+ }[] | Record<`${string}:${string}/${string}:${string}`, {
2051
+ unit: string;
2052
+ amount: string;
2053
+ }> | {
2054
+ id: string;
2055
+ origin: string;
2056
+ request: {
2057
+ method: string;
2058
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
2059
+ };
2060
+ scope: string;
2061
+ account: string;
2062
+ }[] | {
2063
+ address: `${string}:${string}:${string}`;
2064
+ } | null;
2065
+ } | {
2066
+ error: string;
2067
+ })[], import("@metamask/superstruct").Struct<{
2068
+ response: string[] | Record<string, import("@metamask/utils").Json> | {
2069
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
2070
+ id: string;
2071
+ options: Record<string, import("@metamask/utils").Json> & {
2072
+ entropy?: {
2073
+ type: "mnemonic";
2074
+ id: string;
2075
+ derivationPath: string;
2076
+ groupIndex: number;
2077
+ } | {
2078
+ type: "private-key";
2079
+ };
2080
+ exportable?: boolean;
2081
+ };
2082
+ address: string;
2083
+ scopes: `${string}:${string}`[];
2084
+ methods: string[];
2085
+ } | {
2086
+ id: string;
2087
+ origin: string;
2088
+ request: {
2089
+ method: string;
2090
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
2091
+ };
2092
+ scope: string;
2093
+ account: string;
2094
+ } | {
2095
+ pending: true;
2096
+ redirect?: {
2097
+ message?: string;
2098
+ url?: string;
2099
+ };
2100
+ } | {
2101
+ result: import("@metamask/utils").Json;
2102
+ pending: false;
2103
+ } | {
2104
+ data: {
2105
+ type: "unknown" | "send" | "receive" | "swap" | "bridge:send" | "bridge:receive";
2106
+ id: string;
2107
+ from: {
2108
+ address: string;
2109
+ asset: {
2110
+ unit: string;
2111
+ type: `${string}:${string}/${string}:${string}`;
2112
+ amount: string;
2113
+ fungible: true;
2114
+ } | {
2115
+ id: `${string}:${string}/${string}:${string}/${string}`;
2116
+ fungible: false;
2117
+ } | null;
2118
+ }[];
2119
+ events: {
2120
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
2121
+ timestamp: number | null;
2122
+ }[];
2123
+ chain: `${string}:${string}`;
2124
+ status: "submitted" | "unconfirmed" | "confirmed" | "failed";
2125
+ account: string;
2126
+ timestamp: number | null;
2127
+ to: {
2128
+ address: string;
2129
+ asset: {
2130
+ unit: string;
2131
+ type: `${string}:${string}/${string}:${string}`;
2132
+ amount: string;
2133
+ fungible: true;
2134
+ } | {
2135
+ id: `${string}:${string}/${string}:${string}/${string}`;
2136
+ fungible: false;
2137
+ } | null;
2138
+ }[];
2139
+ fees: {
2140
+ type: "base" | "priority";
2141
+ asset: {
2142
+ unit: string;
2143
+ type: `${string}:${string}/${string}:${string}`;
2144
+ amount: string;
2145
+ fungible: true;
2146
+ } | {
2147
+ id: `${string}:${string}/${string}:${string}/${string}`;
2148
+ fungible: false;
2149
+ };
2150
+ }[];
2151
+ }[];
2152
+ next: string | null;
2153
+ } | {
2154
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
2155
+ id: string;
2156
+ options: Record<string, import("@metamask/utils").Json> & {
2157
+ entropy?: {
2158
+ type: "mnemonic";
2159
+ id: string;
2160
+ derivationPath: string;
2161
+ groupIndex: number;
2162
+ } | {
2163
+ type: "private-key";
2164
+ };
2165
+ exportable?: boolean;
2166
+ };
2167
+ address: string;
2168
+ scopes: `${string}:${string}`[];
2169
+ methods: string[];
2170
+ }[] | (`${string}:${string}/${string}:${string}` | `${string}:${string}/${string}:${string}/${string}`)[] | {
2171
+ type: "bip44";
2172
+ derivationPath: `m/${string}`;
2173
+ scopes: `${string}:${string}`[];
2174
+ }[] | Record<`${string}:${string}/${string}:${string}`, {
2175
+ unit: string;
2176
+ amount: string;
2177
+ }> | {
2178
+ id: string;
2179
+ origin: string;
2180
+ request: {
2181
+ method: string;
2182
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
2183
+ };
2184
+ scope: string;
2185
+ account: string;
2186
+ }[] | {
2187
+ address: `${string}:${string}:${string}`;
2188
+ } | null;
2189
+ } | {
2190
+ error: string;
2191
+ }, null>>;
2192
+ export type BatchResponse = Infer<typeof BatchResponseStruct>;
2193
+ export type BatchResponseOne = BatchResponse[number];
1024
2194
  //# sourceMappingURL=rpc.d.cts.map