@metamask/keyring-api 21.2.0 → 21.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -1
- package/README.md +11 -0
- package/dist/api/account-options.cjs +44 -7
- package/dist/api/account-options.cjs.map +1 -1
- package/dist/api/account-options.d.cts +41 -3
- package/dist/api/account-options.d.cts.map +1 -1
- package/dist/api/account-options.d.mts +41 -3
- package/dist/api/account-options.d.mts.map +1 -1
- package/dist/api/account-options.mjs +43 -6
- package/dist/api/account-options.mjs.map +1 -1
- package/dist/api/account.cjs +15 -1
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.d.cts +18 -0
- package/dist/api/account.d.cts.map +1 -1
- package/dist/api/account.d.mts +18 -0
- package/dist/api/account.d.mts.map +1 -1
- package/dist/api/account.mjs +14 -0
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/index.cjs +1 -0
- package/dist/api/index.cjs.map +1 -1
- package/dist/api/index.d.cts +1 -0
- package/dist/api/index.d.cts.map +1 -1
- package/dist/api/index.d.mts +1 -0
- package/dist/api/index.d.mts.map +1 -1
- package/dist/api/index.mjs +1 -0
- package/dist/api/index.mjs.map +1 -1
- package/dist/api/keyring.cjs +0 -2
- package/dist/api/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +13 -0
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +13 -0
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs +0 -2
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/api/v2/create-account/bip44.cjs +83 -0
- package/dist/api/v2/create-account/bip44.cjs.map +1 -0
- package/dist/api/v2/create-account/bip44.d.cts +129 -0
- package/dist/api/v2/create-account/bip44.d.cts.map +1 -0
- package/dist/api/v2/create-account/bip44.d.mts +129 -0
- package/dist/api/v2/create-account/bip44.d.mts.map +1 -0
- package/dist/api/v2/create-account/bip44.mjs +80 -0
- package/dist/api/v2/create-account/bip44.mjs.map +1 -0
- package/dist/api/v2/create-account/custom.cjs +14 -0
- package/dist/api/v2/create-account/custom.cjs.map +1 -0
- package/dist/api/v2/create-account/custom.d.cts +25 -0
- package/dist/api/v2/create-account/custom.d.cts.map +1 -0
- package/dist/api/v2/create-account/custom.d.mts +25 -0
- package/dist/api/v2/create-account/custom.d.mts.map +1 -0
- package/dist/api/v2/create-account/custom.mjs +11 -0
- package/dist/api/v2/create-account/custom.mjs.map +1 -0
- package/dist/api/v2/create-account/index.cjs +93 -0
- package/dist/api/v2/create-account/index.cjs.map +1 -0
- package/dist/api/v2/create-account/index.d.cts +83 -0
- package/dist/api/v2/create-account/index.d.cts.map +1 -0
- package/dist/api/v2/create-account/index.d.mts +83 -0
- package/dist/api/v2/create-account/index.d.mts.map +1 -0
- package/dist/api/v2/create-account/index.mjs +76 -0
- package/dist/api/v2/create-account/index.mjs.map +1 -0
- package/dist/api/v2/create-account/private-key.cjs +28 -0
- package/dist/api/v2/create-account/private-key.cjs.map +1 -0
- package/dist/api/v2/create-account/private-key.d.cts +45 -0
- package/dist/api/v2/create-account/private-key.d.cts.map +1 -0
- package/dist/api/v2/create-account/private-key.d.mts +45 -0
- package/dist/api/v2/create-account/private-key.d.mts.map +1 -0
- package/dist/api/v2/create-account/private-key.mjs +25 -0
- package/dist/api/v2/create-account/private-key.mjs.map +1 -0
- package/dist/api/v2/export-account/index.cjs +38 -0
- package/dist/api/v2/export-account/index.cjs.map +1 -0
- package/dist/api/v2/export-account/index.d.cts +48 -0
- package/dist/api/v2/export-account/index.d.cts.map +1 -0
- package/dist/api/v2/export-account/index.d.mts +48 -0
- package/dist/api/v2/export-account/index.d.mts.map +1 -0
- package/dist/api/v2/export-account/index.mjs +21 -0
- package/dist/api/v2/export-account/index.mjs.map +1 -0
- package/dist/api/v2/export-account/private-key.cjs +36 -0
- package/dist/api/v2/export-account/private-key.cjs.map +1 -0
- package/dist/api/v2/export-account/private-key.d.cts +53 -0
- package/dist/api/v2/export-account/private-key.d.cts.map +1 -0
- package/dist/api/v2/export-account/private-key.d.mts +53 -0
- package/dist/api/v2/export-account/private-key.d.mts.map +1 -0
- package/dist/api/v2/export-account/private-key.mjs +33 -0
- package/dist/api/v2/export-account/private-key.mjs.map +1 -0
- package/dist/api/v2/index.cjs +23 -0
- package/dist/api/v2/index.cjs.map +1 -0
- package/dist/api/v2/index.d.cts +8 -0
- package/dist/api/v2/index.d.cts.map +1 -0
- package/dist/api/v2/index.d.mts +8 -0
- package/dist/api/v2/index.d.mts.map +1 -0
- package/dist/api/v2/index.mjs +7 -0
- package/dist/api/v2/index.mjs.map +1 -0
- package/dist/api/v2/keyring-capabilities.cjs +60 -0
- package/dist/api/v2/keyring-capabilities.cjs.map +1 -0
- package/dist/api/v2/keyring-capabilities.d.cts +150 -0
- package/dist/api/v2/keyring-capabilities.d.cts.map +1 -0
- package/dist/api/v2/keyring-capabilities.d.mts +150 -0
- package/dist/api/v2/keyring-capabilities.d.mts.map +1 -0
- package/dist/api/v2/keyring-capabilities.mjs +57 -0
- package/dist/api/v2/keyring-capabilities.mjs.map +1 -0
- package/dist/api/v2/keyring-type.cjs +44 -0
- package/dist/api/v2/keyring-type.cjs.map +1 -0
- package/dist/api/v2/keyring-type.d.cts +40 -0
- package/dist/api/v2/keyring-type.d.cts.map +1 -0
- package/dist/api/v2/keyring-type.d.mts +40 -0
- package/dist/api/v2/keyring-type.d.mts.map +1 -0
- package/dist/api/v2/keyring-type.mjs +41 -0
- package/dist/api/v2/keyring-type.mjs.map +1 -0
- package/dist/api/v2/keyring.cjs +3 -0
- package/dist/api/v2/keyring.cjs.map +1 -0
- package/dist/api/v2/keyring.d.cts +107 -0
- package/dist/api/v2/keyring.d.cts.map +1 -0
- package/dist/api/v2/keyring.d.mts +107 -0
- package/dist/api/v2/keyring.d.mts.map +1 -0
- package/dist/api/v2/keyring.mjs +2 -0
- package/dist/api/v2/keyring.mjs.map +1 -0
- package/dist/api/v2/private-key.cjs +53 -0
- package/dist/api/v2/private-key.cjs.map +1 -0
- package/dist/api/v2/private-key.d.cts +77 -0
- package/dist/api/v2/private-key.d.cts.map +1 -0
- package/dist/api/v2/private-key.d.mts +77 -0
- package/dist/api/v2/private-key.d.mts.map +1 -0
- package/dist/api/v2/private-key.mjs +50 -0
- package/dist/api/v2/private-key.mjs.map +1 -0
- package/dist/api/v2/wrapper/index.cjs +19 -0
- package/dist/api/v2/wrapper/index.cjs.map +1 -0
- package/dist/api/v2/wrapper/index.d.cts +3 -0
- package/dist/api/v2/wrapper/index.d.cts.map +1 -0
- package/dist/api/v2/wrapper/index.d.mts +3 -0
- package/dist/api/v2/wrapper/index.d.mts.map +1 -0
- package/dist/api/v2/wrapper/index.mjs +3 -0
- package/dist/api/v2/wrapper/index.mjs.map +1 -0
- package/dist/api/v2/wrapper/keyring-account-registry.cjs +135 -0
- package/dist/api/v2/wrapper/keyring-account-registry.cjs.map +1 -0
- package/dist/api/v2/wrapper/keyring-account-registry.d.cts +88 -0
- package/dist/api/v2/wrapper/keyring-account-registry.d.cts.map +1 -0
- package/dist/api/v2/wrapper/keyring-account-registry.d.mts +88 -0
- package/dist/api/v2/wrapper/keyring-account-registry.d.mts.map +1 -0
- package/dist/api/v2/wrapper/keyring-account-registry.mjs +131 -0
- package/dist/api/v2/wrapper/keyring-account-registry.mjs.map +1 -0
- package/dist/api/v2/wrapper/keyring-wrapper.cjs +134 -0
- package/dist/api/v2/wrapper/keyring-wrapper.cjs.map +1 -0
- package/dist/api/v2/wrapper/keyring-wrapper.d.cts +154 -0
- package/dist/api/v2/wrapper/keyring-wrapper.d.cts.map +1 -0
- package/dist/api/v2/wrapper/keyring-wrapper.d.mts +154 -0
- package/dist/api/v2/wrapper/keyring-wrapper.d.mts.map +1 -0
- package/dist/api/v2/wrapper/keyring-wrapper.mjs +130 -0
- package/dist/api/v2/wrapper/keyring-wrapper.mjs.map +1 -0
- package/dist/btc/types.d.cts +16 -0
- package/dist/btc/types.d.cts.map +1 -1
- package/dist/btc/types.d.mts +16 -0
- package/dist/btc/types.d.mts.map +1 -1
- package/dist/eth/erc4337/types.d.cts +4 -4
- package/dist/eth/erc4337/types.d.mts +4 -4
- package/dist/eth/index.cjs +2 -0
- package/dist/eth/index.cjs.map +1 -1
- package/dist/eth/index.d.cts +2 -0
- package/dist/eth/index.d.cts.map +1 -1
- package/dist/eth/index.d.mts +2 -0
- package/dist/eth/index.d.mts.map +1 -1
- package/dist/eth/index.mjs +2 -0
- package/dist/eth/index.mjs.map +1 -1
- package/dist/eth/rpc/index.cjs +18 -0
- package/dist/eth/rpc/index.cjs.map +1 -0
- package/dist/eth/rpc/index.d.cts +2 -0
- package/dist/eth/rpc/index.d.cts.map +1 -0
- package/dist/eth/rpc/index.d.mts +2 -0
- package/dist/eth/rpc/index.d.mts.map +1 -0
- package/dist/eth/rpc/index.mjs +2 -0
- package/dist/eth/rpc/index.mjs.map +1 -0
- package/dist/eth/rpc/params.cjs +151 -0
- package/dist/eth/rpc/params.cjs.map +1 -0
- package/dist/eth/rpc/params.d.cts +215 -0
- package/dist/eth/rpc/params.d.cts.map +1 -0
- package/dist/eth/rpc/params.d.mts +215 -0
- package/dist/eth/rpc/params.d.mts.map +1 -0
- package/dist/eth/rpc/params.mjs +148 -0
- package/dist/eth/rpc/params.mjs.map +1 -0
- package/dist/eth/types.cjs.map +1 -1
- package/dist/eth/types.d.cts +13 -5
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts +13 -5
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/types.mjs.map +1 -1
- package/dist/eth/v2/eth-keyring-wrapper.cjs +165 -0
- package/dist/eth/v2/eth-keyring-wrapper.cjs.map +1 -0
- package/dist/eth/v2/eth-keyring-wrapper.d.cts +54 -0
- package/dist/eth/v2/eth-keyring-wrapper.d.cts.map +1 -0
- package/dist/eth/v2/eth-keyring-wrapper.d.mts +54 -0
- package/dist/eth/v2/eth-keyring-wrapper.d.mts.map +1 -0
- package/dist/eth/v2/eth-keyring-wrapper.mjs +161 -0
- package/dist/eth/v2/eth-keyring-wrapper.mjs.map +1 -0
- package/dist/eth/v2/index.cjs +18 -0
- package/dist/eth/v2/index.cjs.map +1 -0
- package/dist/eth/v2/index.d.cts +2 -0
- package/dist/eth/v2/index.d.cts.map +1 -0
- package/dist/eth/v2/index.d.mts +2 -0
- package/dist/eth/v2/index.d.mts.map +1 -0
- package/dist/eth/v2/index.mjs +2 -0
- package/dist/eth/v2/index.mjs.map +1 -0
- package/dist/events.cjs +0 -2
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +16 -0
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +16 -0
- package/dist/events.d.mts.map +1 -1
- package/dist/events.mjs +0 -2
- package/dist/events.mjs.map +1 -1
- package/dist/rpc.cjs +27 -12
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +200 -12
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +200 -12
- package/dist/rpc.d.mts.map +1 -1
- package/dist/rpc.mjs +27 -12
- package/dist/rpc.mjs.map +1 -1
- package/dist/sol/types.d.cts +4 -0
- package/dist/sol/types.d.cts.map +1 -1
- package/dist/sol/types.d.mts +4 -0
- package/dist/sol/types.d.mts.map +1 -1
- package/dist/trx/types.cjs +4 -0
- package/dist/trx/types.cjs.map +1 -1
- package/dist/trx/types.d.cts +8 -0
- package/dist/trx/types.d.cts.map +1 -1
- package/dist/trx/types.d.mts +8 -0
- package/dist/trx/types.d.mts.map +1 -1
- package/dist/trx/types.mjs +4 -0
- package/dist/trx/types.mjs.map +1 -1
- package/package.json +9 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./keyring-capabilities.cjs"), exports);
|
|
18
|
+
__exportStar(require("./keyring-type.cjs"), exports);
|
|
19
|
+
__exportStar(require("./create-account/index.cjs"), exports);
|
|
20
|
+
__exportStar(require("./export-account/index.cjs"), exports);
|
|
21
|
+
__exportStar(require("./private-key.cjs"), exports);
|
|
22
|
+
__exportStar(require("./wrapper/index.cjs"), exports);
|
|
23
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../src/api/v2/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,6DAAuC;AACvC,qDAA+B;AAC/B,6DAAiC;AACjC,6DAAiC;AACjC,oDAA8B;AAC9B,sDAA0B","sourcesContent":["export type * from './keyring';\nexport * from './keyring-capabilities';\nexport * from './keyring-type';\nexport * from './create-account';\nexport * from './export-account';\nexport * from './private-key';\nexport * from './wrapper';\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type * from "./keyring.cjs";
|
|
2
|
+
export * from "./keyring-capabilities.cjs";
|
|
3
|
+
export * from "./keyring-type.cjs";
|
|
4
|
+
export * from "./create-account/index.cjs";
|
|
5
|
+
export * from "./export-account/index.cjs";
|
|
6
|
+
export * from "./private-key.cjs";
|
|
7
|
+
export * from "./wrapper/index.cjs";
|
|
8
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/api/v2/index.ts"],"names":[],"mappings":"AAAA,mCAA+B;AAC/B,2CAAuC;AACvC,mCAA+B;AAC/B,2CAAiC;AACjC,2CAAiC;AACjC,kCAA8B;AAC9B,oCAA0B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type * from "./keyring.mjs";
|
|
2
|
+
export * from "./keyring-capabilities.mjs";
|
|
3
|
+
export * from "./keyring-type.mjs";
|
|
4
|
+
export * from "./create-account/index.mjs";
|
|
5
|
+
export * from "./export-account/index.mjs";
|
|
6
|
+
export * from "./private-key.mjs";
|
|
7
|
+
export * from "./wrapper/index.mjs";
|
|
8
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/api/v2/index.ts"],"names":[],"mappings":"AAAA,mCAA+B;AAC/B,2CAAuC;AACvC,mCAA+B;AAC/B,2CAAiC;AACjC,2CAAiC;AACjC,kCAA8B;AAC9B,oCAA0B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./keyring-capabilities.mjs";
|
|
2
|
+
export * from "./keyring-type.mjs";
|
|
3
|
+
export * from "./create-account/index.mjs";
|
|
4
|
+
export * from "./export-account/index.mjs";
|
|
5
|
+
export * from "./private-key.mjs";
|
|
6
|
+
export * from "./wrapper/index.mjs";
|
|
7
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/api/v2/index.ts"],"names":[],"mappings":"AACA,2CAAuC;AACvC,mCAA+B;AAC/B,2CAAiC;AACjC,2CAAiC;AACjC,kCAA8B;AAC9B,oCAA0B","sourcesContent":["export type * from './keyring';\nexport * from './keyring-capabilities';\nexport * from './keyring-type';\nexport * from './create-account';\nexport * from './export-account';\nexport * from './private-key';\nexport * from './wrapper';\n"]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyringCapabilitiesStruct = void 0;
|
|
4
|
+
const superstruct_1 = require("@metamask/superstruct");
|
|
5
|
+
const private_key_1 = require("./private-key.cjs");
|
|
6
|
+
const caip_1 = require("../caip.cjs");
|
|
7
|
+
/**
|
|
8
|
+
* Struct for {@link KeyringCapabilities}.
|
|
9
|
+
*/
|
|
10
|
+
exports.KeyringCapabilitiesStruct = (0, superstruct_1.object)({
|
|
11
|
+
/**
|
|
12
|
+
* List of CAIP-2 chain IDs that this keyring supports.
|
|
13
|
+
*/
|
|
14
|
+
scopes: (0, superstruct_1.nonempty)((0, superstruct_1.array)(caip_1.CaipChainIdStruct)),
|
|
15
|
+
/**
|
|
16
|
+
* BIP-44 capabilities supported by this keyring.
|
|
17
|
+
*/
|
|
18
|
+
bip44: (0, superstruct_1.exactOptional)((0, superstruct_1.object)({
|
|
19
|
+
/**
|
|
20
|
+
* Whether the keyring supports deriving accounts from a specific BIP-44 path.
|
|
21
|
+
*/
|
|
22
|
+
derivePath: (0, superstruct_1.exactOptional)((0, superstruct_1.boolean)()),
|
|
23
|
+
/**
|
|
24
|
+
* Whether the keyring supports deriving accounts from a BIP-44 account index.
|
|
25
|
+
*/
|
|
26
|
+
deriveIndex: (0, superstruct_1.exactOptional)((0, superstruct_1.boolean)()),
|
|
27
|
+
/**
|
|
28
|
+
* Whether the keyring supports deriving accounts from a range of BIP-44 account indices.
|
|
29
|
+
*/
|
|
30
|
+
deriveIndexRange: (0, superstruct_1.exactOptional)((0, superstruct_1.boolean)()),
|
|
31
|
+
/**
|
|
32
|
+
* Whether the keyring supports BIP-44 account discovery.
|
|
33
|
+
*/
|
|
34
|
+
discover: (0, superstruct_1.exactOptional)((0, superstruct_1.boolean)()),
|
|
35
|
+
})),
|
|
36
|
+
/**
|
|
37
|
+
* Private key capabilities supported by this keyring.
|
|
38
|
+
*/
|
|
39
|
+
privateKey: (0, superstruct_1.exactOptional)((0, superstruct_1.object)({
|
|
40
|
+
/**
|
|
41
|
+
* List of supported formats for importing private keys.
|
|
42
|
+
*/
|
|
43
|
+
importFormats: (0, superstruct_1.exactOptional)((0, superstruct_1.array)(private_key_1.ImportPrivateKeyFormatStruct)),
|
|
44
|
+
/**
|
|
45
|
+
* List of supported formats for exporting private keys.
|
|
46
|
+
*/
|
|
47
|
+
exportFormats: (0, superstruct_1.exactOptional)((0, superstruct_1.array)(private_key_1.ExportPrivateKeyFormatStruct)),
|
|
48
|
+
})),
|
|
49
|
+
/**
|
|
50
|
+
* Indicates which KeyringV2 methods accept non-standard options.
|
|
51
|
+
*
|
|
52
|
+
* When a method is set to `true`, it signals that the keyring implementation
|
|
53
|
+
* accepts custom options for that method, different from the standard API.
|
|
54
|
+
* This is a workaround for keyrings with very specific requirements.
|
|
55
|
+
*/
|
|
56
|
+
custom: (0, superstruct_1.exactOptional)((0, superstruct_1.partial)((0, superstruct_1.object)({
|
|
57
|
+
createAccounts: (0, superstruct_1.boolean)(),
|
|
58
|
+
}))),
|
|
59
|
+
});
|
|
60
|
+
//# sourceMappingURL=keyring-capabilities.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.cjs","sourceRoot":"","sources":["../../../src/api/v2/keyring-capabilities.ts"],"names":[],"mappings":";;;AAAA,uDAQ+B;AAE/B,mDAGuB;AACvB,sCAA4C;AAE5C;;GAEG;AACU,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,wBAAiB,CAAC,CAAC;IAC1C;;OAEG;IACH,KAAK,EAAE,IAAA,2BAAa,EAClB,IAAA,oBAAM,EAAC;QACL;;WAEG;QACH,UAAU,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QACpC;;WAEG;QACH,WAAW,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QACrC;;WAEG;QACH,gBAAgB,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QAC1C;;WAEG;QACH,QAAQ,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;KACnC,CAAC,CACH;IACD;;OAEG;IACH,UAAU,EAAE,IAAA,2BAAa,EACvB,IAAA,oBAAM,EAAC;QACL;;WAEG;QACH,aAAa,EAAE,IAAA,2BAAa,EAAC,IAAA,mBAAK,EAAC,0CAA4B,CAAC,CAAC;QACjE;;WAEG;QACH,aAAa,EAAE,IAAA,2BAAa,EAAC,IAAA,mBAAK,EAAC,0CAA4B,CAAC,CAAC;KAClE,CAAC,CACH;IACD;;;;;;OAMG;IACH,MAAM,EAAE,IAAA,2BAAa,EACnB,IAAA,qBAAO,EACL,IAAA,oBAAM,EAAC;QACL,cAAc,EAAE,IAAA,qBAAO,GAAE;KAC1B,CAAC,CACH,CACF;CACF,CAAC,CAAC","sourcesContent":["import {\n array,\n boolean,\n exactOptional,\n nonempty,\n object,\n partial,\n type Infer,\n} from '@metamask/superstruct';\n\nimport {\n ExportPrivateKeyFormatStruct,\n ImportPrivateKeyFormatStruct,\n} from './private-key';\nimport { CaipChainIdStruct } from '../caip';\n\n/**\n * Struct for {@link KeyringCapabilities}.\n */\nexport const KeyringCapabilitiesStruct = object({\n /**\n * List of CAIP-2 chain IDs that this keyring supports.\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * BIP-44 capabilities supported by this keyring.\n */\n bip44: exactOptional(\n object({\n /**\n * Whether the keyring supports deriving accounts from a specific BIP-44 path.\n */\n derivePath: exactOptional(boolean()),\n /**\n * Whether the keyring supports deriving accounts from a BIP-44 account index.\n */\n deriveIndex: exactOptional(boolean()),\n /**\n * Whether the keyring supports deriving accounts from a range of BIP-44 account indices.\n */\n deriveIndexRange: exactOptional(boolean()),\n /**\n * Whether the keyring supports BIP-44 account discovery.\n */\n discover: exactOptional(boolean()),\n }),\n ),\n /**\n * Private key capabilities supported by this keyring.\n */\n privateKey: exactOptional(\n object({\n /**\n * List of supported formats for importing private keys.\n */\n importFormats: exactOptional(array(ImportPrivateKeyFormatStruct)),\n /**\n * List of supported formats for exporting private keys.\n */\n exportFormats: exactOptional(array(ExportPrivateKeyFormatStruct)),\n }),\n ),\n /**\n * Indicates which KeyringV2 methods accept non-standard options.\n *\n * When a method is set to `true`, it signals that the keyring implementation\n * accepts custom options for that method, different from the standard API.\n * This is a workaround for keyrings with very specific requirements.\n */\n custom: exactOptional(\n partial(\n object({\n createAccounts: boolean(),\n }),\n ),\n ),\n});\n\n/**\n * Type representing the capabilities supported by a keyring.\n *\n * @example\n * ```ts\n * const capabilities: KeyringCapabilities = {\n * scopes: ['bip122:_'],\n * bip44: {\n * derivePath: true,\n * deriveIndex: true,\n * deriveIndexRange: true,\n * discover: true,\n * },\n * privateKey: {\n * importFormats: [\n * { encoding: 'base58', type: 'bip122:p2sh' },\n * { encoding: 'base58', type: 'bip122:p2tr' },\n * { encoding: 'base58', type: 'bip122:p2pkh' },\n * { encoding: 'base58', type: 'bip122:p2wpkh' },\n * ],\n * exportFormats: [\n * { encoding: 'base58' },\n * { encoding: 'base58' },\n * ],\n * },\n * };\n * ```\n */\nexport type KeyringCapabilities = Infer<typeof KeyringCapabilitiesStruct>;\n"]}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { type Infer } from "@metamask/superstruct";
|
|
2
|
+
/**
|
|
3
|
+
* Struct for {@link KeyringCapabilities}.
|
|
4
|
+
*/
|
|
5
|
+
export declare const KeyringCapabilitiesStruct: import("@metamask/superstruct").Struct<{
|
|
6
|
+
scopes: `${string}:${string}`[];
|
|
7
|
+
custom?: {
|
|
8
|
+
createAccounts?: boolean | undefined;
|
|
9
|
+
};
|
|
10
|
+
bip44?: {
|
|
11
|
+
derivePath?: boolean;
|
|
12
|
+
deriveIndex?: boolean;
|
|
13
|
+
deriveIndexRange?: boolean;
|
|
14
|
+
discover?: boolean;
|
|
15
|
+
};
|
|
16
|
+
privateKey?: {
|
|
17
|
+
importFormats?: {
|
|
18
|
+
encoding: "hexadecimal" | "base58";
|
|
19
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
20
|
+
}[];
|
|
21
|
+
exportFormats?: {
|
|
22
|
+
encoding: "hexadecimal" | "base58";
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
/**
|
|
27
|
+
* List of CAIP-2 chain IDs that this keyring supports.
|
|
28
|
+
*/
|
|
29
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
|
30
|
+
/**
|
|
31
|
+
* BIP-44 capabilities supported by this keyring.
|
|
32
|
+
*/
|
|
33
|
+
bip44: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
34
|
+
derivePath?: boolean;
|
|
35
|
+
deriveIndex?: boolean;
|
|
36
|
+
deriveIndexRange?: boolean;
|
|
37
|
+
discover?: boolean;
|
|
38
|
+
}, {
|
|
39
|
+
/**
|
|
40
|
+
* Whether the keyring supports deriving accounts from a specific BIP-44 path.
|
|
41
|
+
*/
|
|
42
|
+
derivePath: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the keyring supports deriving accounts from a BIP-44 account index.
|
|
45
|
+
*/
|
|
46
|
+
deriveIndex: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the keyring supports deriving accounts from a range of BIP-44 account indices.
|
|
49
|
+
*/
|
|
50
|
+
deriveIndexRange: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the keyring supports BIP-44 account discovery.
|
|
53
|
+
*/
|
|
54
|
+
discover: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Private key capabilities supported by this keyring.
|
|
58
|
+
*/
|
|
59
|
+
privateKey: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
60
|
+
importFormats?: {
|
|
61
|
+
encoding: "hexadecimal" | "base58";
|
|
62
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
63
|
+
}[];
|
|
64
|
+
exportFormats?: {
|
|
65
|
+
encoding: "hexadecimal" | "base58";
|
|
66
|
+
}[];
|
|
67
|
+
}, {
|
|
68
|
+
/**
|
|
69
|
+
* List of supported formats for importing private keys.
|
|
70
|
+
*/
|
|
71
|
+
importFormats: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
72
|
+
encoding: "hexadecimal" | "base58";
|
|
73
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
74
|
+
}[], import("@metamask/superstruct").Struct<{
|
|
75
|
+
encoding: "hexadecimal" | "base58";
|
|
76
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
77
|
+
}, {
|
|
78
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
79
|
+
hexadecimal: "hexadecimal";
|
|
80
|
+
base58: "base58";
|
|
81
|
+
}>;
|
|
82
|
+
type: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
83
|
+
"eip155:eoa": "eip155:eoa";
|
|
84
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
85
|
+
"bip122:p2pkh": "bip122:p2pkh";
|
|
86
|
+
"bip122:p2sh": "bip122:p2sh";
|
|
87
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
88
|
+
"bip122:p2tr": "bip122:p2tr";
|
|
89
|
+
"solana:data-account": "solana:data-account";
|
|
90
|
+
"tron:eoa": "tron:eoa";
|
|
91
|
+
"any:account": "any:account";
|
|
92
|
+
}>;
|
|
93
|
+
}>>;
|
|
94
|
+
/**
|
|
95
|
+
* List of supported formats for exporting private keys.
|
|
96
|
+
*/
|
|
97
|
+
exportFormats: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
98
|
+
encoding: "hexadecimal" | "base58";
|
|
99
|
+
}[], import("@metamask/superstruct").Struct<{
|
|
100
|
+
encoding: "hexadecimal" | "base58";
|
|
101
|
+
}, {
|
|
102
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
103
|
+
hexadecimal: "hexadecimal";
|
|
104
|
+
base58: "base58";
|
|
105
|
+
}>;
|
|
106
|
+
}>>;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Indicates which KeyringV2 methods accept non-standard options.
|
|
110
|
+
*
|
|
111
|
+
* When a method is set to `true`, it signals that the keyring implementation
|
|
112
|
+
* accepts custom options for that method, different from the standard API.
|
|
113
|
+
* This is a workaround for keyrings with very specific requirements.
|
|
114
|
+
*/
|
|
115
|
+
custom: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
116
|
+
createAccounts?: boolean | undefined;
|
|
117
|
+
}, import("@metamask/superstruct").PartialObjectSchema<{
|
|
118
|
+
createAccounts: import("@metamask/superstruct").Struct<boolean, null>;
|
|
119
|
+
}>>;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* Type representing the capabilities supported by a keyring.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const capabilities: KeyringCapabilities = {
|
|
127
|
+
* scopes: ['bip122:_'],
|
|
128
|
+
* bip44: {
|
|
129
|
+
* derivePath: true,
|
|
130
|
+
* deriveIndex: true,
|
|
131
|
+
* deriveIndexRange: true,
|
|
132
|
+
* discover: true,
|
|
133
|
+
* },
|
|
134
|
+
* privateKey: {
|
|
135
|
+
* importFormats: [
|
|
136
|
+
* { encoding: 'base58', type: 'bip122:p2sh' },
|
|
137
|
+
* { encoding: 'base58', type: 'bip122:p2tr' },
|
|
138
|
+
* { encoding: 'base58', type: 'bip122:p2pkh' },
|
|
139
|
+
* { encoding: 'base58', type: 'bip122:p2wpkh' },
|
|
140
|
+
* ],
|
|
141
|
+
* exportFormats: [
|
|
142
|
+
* { encoding: 'base58' },
|
|
143
|
+
* { encoding: 'base58' },
|
|
144
|
+
* ],
|
|
145
|
+
* },
|
|
146
|
+
* };
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export type KeyringCapabilities = Infer<typeof KeyringCapabilitiesStruct>;
|
|
150
|
+
//# sourceMappingURL=keyring-capabilities.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.d.cts","sourceRoot":"","sources":["../../../src/api/v2/keyring-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,KAAK,EACX,8BAA8B;AAQ/B;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;IACpC;;OAEG;;IAEH;;OAEG;;;;;;;QAGC;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;IAIP;;OAEG;;;;;;;;;;QAGC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;QAEH;;WAEG;;;;;;;;;;;;IAIP;;;;;;OAMG;;;;;;EAQH,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { type Infer } from "@metamask/superstruct";
|
|
2
|
+
/**
|
|
3
|
+
* Struct for {@link KeyringCapabilities}.
|
|
4
|
+
*/
|
|
5
|
+
export declare const KeyringCapabilitiesStruct: import("@metamask/superstruct").Struct<{
|
|
6
|
+
scopes: `${string}:${string}`[];
|
|
7
|
+
custom?: {
|
|
8
|
+
createAccounts?: boolean | undefined;
|
|
9
|
+
};
|
|
10
|
+
bip44?: {
|
|
11
|
+
derivePath?: boolean;
|
|
12
|
+
deriveIndex?: boolean;
|
|
13
|
+
deriveIndexRange?: boolean;
|
|
14
|
+
discover?: boolean;
|
|
15
|
+
};
|
|
16
|
+
privateKey?: {
|
|
17
|
+
importFormats?: {
|
|
18
|
+
encoding: "hexadecimal" | "base58";
|
|
19
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
20
|
+
}[];
|
|
21
|
+
exportFormats?: {
|
|
22
|
+
encoding: "hexadecimal" | "base58";
|
|
23
|
+
}[];
|
|
24
|
+
};
|
|
25
|
+
}, {
|
|
26
|
+
/**
|
|
27
|
+
* List of CAIP-2 chain IDs that this keyring supports.
|
|
28
|
+
*/
|
|
29
|
+
scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
|
|
30
|
+
/**
|
|
31
|
+
* BIP-44 capabilities supported by this keyring.
|
|
32
|
+
*/
|
|
33
|
+
bip44: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
34
|
+
derivePath?: boolean;
|
|
35
|
+
deriveIndex?: boolean;
|
|
36
|
+
deriveIndexRange?: boolean;
|
|
37
|
+
discover?: boolean;
|
|
38
|
+
}, {
|
|
39
|
+
/**
|
|
40
|
+
* Whether the keyring supports deriving accounts from a specific BIP-44 path.
|
|
41
|
+
*/
|
|
42
|
+
derivePath: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
43
|
+
/**
|
|
44
|
+
* Whether the keyring supports deriving accounts from a BIP-44 account index.
|
|
45
|
+
*/
|
|
46
|
+
deriveIndex: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
47
|
+
/**
|
|
48
|
+
* Whether the keyring supports deriving accounts from a range of BIP-44 account indices.
|
|
49
|
+
*/
|
|
50
|
+
deriveIndexRange: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the keyring supports BIP-44 account discovery.
|
|
53
|
+
*/
|
|
54
|
+
discover: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
55
|
+
}>;
|
|
56
|
+
/**
|
|
57
|
+
* Private key capabilities supported by this keyring.
|
|
58
|
+
*/
|
|
59
|
+
privateKey: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
60
|
+
importFormats?: {
|
|
61
|
+
encoding: "hexadecimal" | "base58";
|
|
62
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
63
|
+
}[];
|
|
64
|
+
exportFormats?: {
|
|
65
|
+
encoding: "hexadecimal" | "base58";
|
|
66
|
+
}[];
|
|
67
|
+
}, {
|
|
68
|
+
/**
|
|
69
|
+
* List of supported formats for importing private keys.
|
|
70
|
+
*/
|
|
71
|
+
importFormats: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
72
|
+
encoding: "hexadecimal" | "base58";
|
|
73
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
74
|
+
}[], import("@metamask/superstruct").Struct<{
|
|
75
|
+
encoding: "hexadecimal" | "base58";
|
|
76
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
77
|
+
}, {
|
|
78
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
79
|
+
hexadecimal: "hexadecimal";
|
|
80
|
+
base58: "base58";
|
|
81
|
+
}>;
|
|
82
|
+
type: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
83
|
+
"eip155:eoa": "eip155:eoa";
|
|
84
|
+
"eip155:erc4337": "eip155:erc4337";
|
|
85
|
+
"bip122:p2pkh": "bip122:p2pkh";
|
|
86
|
+
"bip122:p2sh": "bip122:p2sh";
|
|
87
|
+
"bip122:p2wpkh": "bip122:p2wpkh";
|
|
88
|
+
"bip122:p2tr": "bip122:p2tr";
|
|
89
|
+
"solana:data-account": "solana:data-account";
|
|
90
|
+
"tron:eoa": "tron:eoa";
|
|
91
|
+
"any:account": "any:account";
|
|
92
|
+
}>;
|
|
93
|
+
}>>;
|
|
94
|
+
/**
|
|
95
|
+
* List of supported formats for exporting private keys.
|
|
96
|
+
*/
|
|
97
|
+
exportFormats: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
98
|
+
encoding: "hexadecimal" | "base58";
|
|
99
|
+
}[], import("@metamask/superstruct").Struct<{
|
|
100
|
+
encoding: "hexadecimal" | "base58";
|
|
101
|
+
}, {
|
|
102
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
103
|
+
hexadecimal: "hexadecimal";
|
|
104
|
+
base58: "base58";
|
|
105
|
+
}>;
|
|
106
|
+
}>>;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Indicates which KeyringV2 methods accept non-standard options.
|
|
110
|
+
*
|
|
111
|
+
* When a method is set to `true`, it signals that the keyring implementation
|
|
112
|
+
* accepts custom options for that method, different from the standard API.
|
|
113
|
+
* This is a workaround for keyrings with very specific requirements.
|
|
114
|
+
*/
|
|
115
|
+
custom: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
116
|
+
createAccounts?: boolean | undefined;
|
|
117
|
+
}, import("@metamask/superstruct").PartialObjectSchema<{
|
|
118
|
+
createAccounts: import("@metamask/superstruct").Struct<boolean, null>;
|
|
119
|
+
}>>;
|
|
120
|
+
}>;
|
|
121
|
+
/**
|
|
122
|
+
* Type representing the capabilities supported by a keyring.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const capabilities: KeyringCapabilities = {
|
|
127
|
+
* scopes: ['bip122:_'],
|
|
128
|
+
* bip44: {
|
|
129
|
+
* derivePath: true,
|
|
130
|
+
* deriveIndex: true,
|
|
131
|
+
* deriveIndexRange: true,
|
|
132
|
+
* discover: true,
|
|
133
|
+
* },
|
|
134
|
+
* privateKey: {
|
|
135
|
+
* importFormats: [
|
|
136
|
+
* { encoding: 'base58', type: 'bip122:p2sh' },
|
|
137
|
+
* { encoding: 'base58', type: 'bip122:p2tr' },
|
|
138
|
+
* { encoding: 'base58', type: 'bip122:p2pkh' },
|
|
139
|
+
* { encoding: 'base58', type: 'bip122:p2wpkh' },
|
|
140
|
+
* ],
|
|
141
|
+
* exportFormats: [
|
|
142
|
+
* { encoding: 'base58' },
|
|
143
|
+
* { encoding: 'base58' },
|
|
144
|
+
* ],
|
|
145
|
+
* },
|
|
146
|
+
* };
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export type KeyringCapabilities = Infer<typeof KeyringCapabilitiesStruct>;
|
|
150
|
+
//# sourceMappingURL=keyring-capabilities.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.d.mts","sourceRoot":"","sources":["../../../src/api/v2/keyring-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,KAAK,EACX,8BAA8B;AAQ/B;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;IACpC;;OAEG;;IAEH;;OAEG;;;;;;;QAGC;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;QAEH;;WAEG;;;IAIP;;OAEG;;;;;;;;;;QAGC;;WAEG;;;;;;;;;;;;;;;;;;;;;;;;QAEH;;WAEG;;;;;;;;;;;;IAIP;;;;;;OAMG;;;;;;EAQH,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { array, boolean, exactOptional, nonempty, object, partial } from "@metamask/superstruct";
|
|
2
|
+
import { ExportPrivateKeyFormatStruct, ImportPrivateKeyFormatStruct } from "./private-key.mjs";
|
|
3
|
+
import { CaipChainIdStruct } from "../caip.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Struct for {@link KeyringCapabilities}.
|
|
6
|
+
*/
|
|
7
|
+
export const KeyringCapabilitiesStruct = object({
|
|
8
|
+
/**
|
|
9
|
+
* List of CAIP-2 chain IDs that this keyring supports.
|
|
10
|
+
*/
|
|
11
|
+
scopes: nonempty(array(CaipChainIdStruct)),
|
|
12
|
+
/**
|
|
13
|
+
* BIP-44 capabilities supported by this keyring.
|
|
14
|
+
*/
|
|
15
|
+
bip44: exactOptional(object({
|
|
16
|
+
/**
|
|
17
|
+
* Whether the keyring supports deriving accounts from a specific BIP-44 path.
|
|
18
|
+
*/
|
|
19
|
+
derivePath: exactOptional(boolean()),
|
|
20
|
+
/**
|
|
21
|
+
* Whether the keyring supports deriving accounts from a BIP-44 account index.
|
|
22
|
+
*/
|
|
23
|
+
deriveIndex: exactOptional(boolean()),
|
|
24
|
+
/**
|
|
25
|
+
* Whether the keyring supports deriving accounts from a range of BIP-44 account indices.
|
|
26
|
+
*/
|
|
27
|
+
deriveIndexRange: exactOptional(boolean()),
|
|
28
|
+
/**
|
|
29
|
+
* Whether the keyring supports BIP-44 account discovery.
|
|
30
|
+
*/
|
|
31
|
+
discover: exactOptional(boolean()),
|
|
32
|
+
})),
|
|
33
|
+
/**
|
|
34
|
+
* Private key capabilities supported by this keyring.
|
|
35
|
+
*/
|
|
36
|
+
privateKey: exactOptional(object({
|
|
37
|
+
/**
|
|
38
|
+
* List of supported formats for importing private keys.
|
|
39
|
+
*/
|
|
40
|
+
importFormats: exactOptional(array(ImportPrivateKeyFormatStruct)),
|
|
41
|
+
/**
|
|
42
|
+
* List of supported formats for exporting private keys.
|
|
43
|
+
*/
|
|
44
|
+
exportFormats: exactOptional(array(ExportPrivateKeyFormatStruct)),
|
|
45
|
+
})),
|
|
46
|
+
/**
|
|
47
|
+
* Indicates which KeyringV2 methods accept non-standard options.
|
|
48
|
+
*
|
|
49
|
+
* When a method is set to `true`, it signals that the keyring implementation
|
|
50
|
+
* accepts custom options for that method, different from the standard API.
|
|
51
|
+
* This is a workaround for keyrings with very specific requirements.
|
|
52
|
+
*/
|
|
53
|
+
custom: exactOptional(partial(object({
|
|
54
|
+
createAccounts: boolean(),
|
|
55
|
+
}))),
|
|
56
|
+
});
|
|
57
|
+
//# sourceMappingURL=keyring-capabilities.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.mjs","sourceRoot":"","sources":["../../../src/api/v2/keyring-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,MAAM,EACN,OAAO,EAER,8BAA8B;AAE/B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC7B,0BAAsB;AACvB,OAAO,EAAE,iBAAiB,EAAE,oBAAgB;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;IAC9C;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1C;;OAEG;IACH,KAAK,EAAE,aAAa,CAClB,MAAM,CAAC;QACL;;WAEG;QACH,UAAU,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;QACpC;;WAEG;QACH,WAAW,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;QACrC;;WAEG;QACH,gBAAgB,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;QAC1C;;WAEG;QACH,QAAQ,EAAE,aAAa,CAAC,OAAO,EAAE,CAAC;KACnC,CAAC,CACH;IACD;;OAEG;IACH,UAAU,EAAE,aAAa,CACvB,MAAM,CAAC;QACL;;WAEG;QACH,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;QACjE;;WAEG;QACH,aAAa,EAAE,aAAa,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;KAClE,CAAC,CACH;IACD;;;;;;OAMG;IACH,MAAM,EAAE,aAAa,CACnB,OAAO,CACL,MAAM,CAAC;QACL,cAAc,EAAE,OAAO,EAAE;KAC1B,CAAC,CACH,CACF;CACF,CAAC,CAAC","sourcesContent":["import {\n array,\n boolean,\n exactOptional,\n nonempty,\n object,\n partial,\n type Infer,\n} from '@metamask/superstruct';\n\nimport {\n ExportPrivateKeyFormatStruct,\n ImportPrivateKeyFormatStruct,\n} from './private-key';\nimport { CaipChainIdStruct } from '../caip';\n\n/**\n * Struct for {@link KeyringCapabilities}.\n */\nexport const KeyringCapabilitiesStruct = object({\n /**\n * List of CAIP-2 chain IDs that this keyring supports.\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * BIP-44 capabilities supported by this keyring.\n */\n bip44: exactOptional(\n object({\n /**\n * Whether the keyring supports deriving accounts from a specific BIP-44 path.\n */\n derivePath: exactOptional(boolean()),\n /**\n * Whether the keyring supports deriving accounts from a BIP-44 account index.\n */\n deriveIndex: exactOptional(boolean()),\n /**\n * Whether the keyring supports deriving accounts from a range of BIP-44 account indices.\n */\n deriveIndexRange: exactOptional(boolean()),\n /**\n * Whether the keyring supports BIP-44 account discovery.\n */\n discover: exactOptional(boolean()),\n }),\n ),\n /**\n * Private key capabilities supported by this keyring.\n */\n privateKey: exactOptional(\n object({\n /**\n * List of supported formats for importing private keys.\n */\n importFormats: exactOptional(array(ImportPrivateKeyFormatStruct)),\n /**\n * List of supported formats for exporting private keys.\n */\n exportFormats: exactOptional(array(ExportPrivateKeyFormatStruct)),\n }),\n ),\n /**\n * Indicates which KeyringV2 methods accept non-standard options.\n *\n * When a method is set to `true`, it signals that the keyring implementation\n * accepts custom options for that method, different from the standard API.\n * This is a workaround for keyrings with very specific requirements.\n */\n custom: exactOptional(\n partial(\n object({\n createAccounts: boolean(),\n }),\n ),\n ),\n});\n\n/**\n * Type representing the capabilities supported by a keyring.\n *\n * @example\n * ```ts\n * const capabilities: KeyringCapabilities = {\n * scopes: ['bip122:_'],\n * bip44: {\n * derivePath: true,\n * deriveIndex: true,\n * deriveIndexRange: true,\n * discover: true,\n * },\n * privateKey: {\n * importFormats: [\n * { encoding: 'base58', type: 'bip122:p2sh' },\n * { encoding: 'base58', type: 'bip122:p2tr' },\n * { encoding: 'base58', type: 'bip122:p2pkh' },\n * { encoding: 'base58', type: 'bip122:p2wpkh' },\n * ],\n * exportFormats: [\n * { encoding: 'base58' },\n * { encoding: 'base58' },\n * ],\n * },\n * };\n * ```\n */\nexport type KeyringCapabilities = Infer<typeof KeyringCapabilitiesStruct>;\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyringType = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Enum representing the different types of keyrings supported.
|
|
6
|
+
*/
|
|
7
|
+
var KeyringType;
|
|
8
|
+
(function (KeyringType) {
|
|
9
|
+
/**
|
|
10
|
+
* Represents a hierarchical deterministic (HD) keyring.
|
|
11
|
+
*/
|
|
12
|
+
KeyringType["Hd"] = "hd";
|
|
13
|
+
/**
|
|
14
|
+
* Represents a keyring that directly stores private keys.
|
|
15
|
+
*/
|
|
16
|
+
KeyringType["PrivateKey"] = "private-key";
|
|
17
|
+
/**
|
|
18
|
+
* Represents a keyring that implements the QR protocol.
|
|
19
|
+
*
|
|
20
|
+
* See: https://eips.ethereum.org/EIPS/eip-4527
|
|
21
|
+
*/
|
|
22
|
+
KeyringType["Qr"] = "qr";
|
|
23
|
+
/**
|
|
24
|
+
* Represents keyring backed by a Snap.
|
|
25
|
+
*/
|
|
26
|
+
KeyringType["Snap"] = "snap";
|
|
27
|
+
/**
|
|
28
|
+
* Represents keyring backed by a Ledger hardware wallet.
|
|
29
|
+
*/
|
|
30
|
+
KeyringType["Ledger"] = "ledger";
|
|
31
|
+
/**
|
|
32
|
+
* Represents keyring backed by a Lattice hardware wallet.
|
|
33
|
+
*/
|
|
34
|
+
KeyringType["Lattice"] = "lattice";
|
|
35
|
+
/**
|
|
36
|
+
* Represents keyring backed by a Trezor hardware wallet.
|
|
37
|
+
*/
|
|
38
|
+
KeyringType["Trezor"] = "trezor";
|
|
39
|
+
/**
|
|
40
|
+
* Represents keyring backed by a OneKey hardware wallet.
|
|
41
|
+
*/
|
|
42
|
+
KeyringType["OneKey"] = "onekey";
|
|
43
|
+
})(KeyringType || (exports.KeyringType = KeyringType = {}));
|
|
44
|
+
//# sourceMappingURL=keyring-type.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring-type.cjs","sourceRoot":"","sources":["../../../src/api/v2/keyring-type.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,WA0CX;AA1CD,WAAY,WAAW;IACrB;;OAEG;IACH,wBAAS,CAAA;IAET;;OAEG;IACH,yCAA0B,CAAA;IAE1B;;;;OAIG;IACH,wBAAS,CAAA;IAET;;OAEG;IACH,4BAAa,CAAA;IAEb;;OAEG;IACH,gCAAiB,CAAA;IAEjB;;OAEG;IACH,kCAAmB,CAAA;IAEnB;;OAEG;IACH,gCAAiB,CAAA;IAEjB;;OAEG;IACH,gCAAiB,CAAA;AACnB,CAAC,EA1CW,WAAW,2BAAX,WAAW,QA0CtB","sourcesContent":["/**\n * Enum representing the different types of keyrings supported.\n */\nexport enum KeyringType {\n /**\n * Represents a hierarchical deterministic (HD) keyring.\n */\n Hd = 'hd',\n\n /**\n * Represents a keyring that directly stores private keys.\n */\n PrivateKey = 'private-key',\n\n /**\n * Represents a keyring that implements the QR protocol.\n *\n * See: https://eips.ethereum.org/EIPS/eip-4527\n */\n Qr = 'qr',\n\n /**\n * Represents keyring backed by a Snap.\n */\n Snap = 'snap',\n\n /**\n * Represents keyring backed by a Ledger hardware wallet.\n */\n Ledger = 'ledger',\n\n /**\n * Represents keyring backed by a Lattice hardware wallet.\n */\n Lattice = 'lattice',\n\n /**\n * Represents keyring backed by a Trezor hardware wallet.\n */\n Trezor = 'trezor',\n\n /**\n * Represents keyring backed by a OneKey hardware wallet.\n */\n OneKey = 'onekey',\n}\n"]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the different types of keyrings supported.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum KeyringType {
|
|
5
|
+
/**
|
|
6
|
+
* Represents a hierarchical deterministic (HD) keyring.
|
|
7
|
+
*/
|
|
8
|
+
Hd = "hd",
|
|
9
|
+
/**
|
|
10
|
+
* Represents a keyring that directly stores private keys.
|
|
11
|
+
*/
|
|
12
|
+
PrivateKey = "private-key",
|
|
13
|
+
/**
|
|
14
|
+
* Represents a keyring that implements the QR protocol.
|
|
15
|
+
*
|
|
16
|
+
* See: https://eips.ethereum.org/EIPS/eip-4527
|
|
17
|
+
*/
|
|
18
|
+
Qr = "qr",
|
|
19
|
+
/**
|
|
20
|
+
* Represents keyring backed by a Snap.
|
|
21
|
+
*/
|
|
22
|
+
Snap = "snap",
|
|
23
|
+
/**
|
|
24
|
+
* Represents keyring backed by a Ledger hardware wallet.
|
|
25
|
+
*/
|
|
26
|
+
Ledger = "ledger",
|
|
27
|
+
/**
|
|
28
|
+
* Represents keyring backed by a Lattice hardware wallet.
|
|
29
|
+
*/
|
|
30
|
+
Lattice = "lattice",
|
|
31
|
+
/**
|
|
32
|
+
* Represents keyring backed by a Trezor hardware wallet.
|
|
33
|
+
*/
|
|
34
|
+
Trezor = "trezor",
|
|
35
|
+
/**
|
|
36
|
+
* Represents keyring backed by a OneKey hardware wallet.
|
|
37
|
+
*/
|
|
38
|
+
OneKey = "onekey"
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=keyring-type.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyring-type.d.cts","sourceRoot":"","sources":["../../../src/api/v2/keyring-type.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,WAAW;IACrB;;OAEG;IACH,EAAE,OAAO;IAET;;OAEG;IACH,UAAU,gBAAgB;IAE1B;;;;OAIG;IACH,EAAE,OAAO;IAET;;OAEG;IACH,IAAI,SAAS;IAEb;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,OAAO,YAAY;IAEnB;;OAEG;IACH,MAAM,WAAW;IAEjB;;OAEG;IACH,MAAM,WAAW;CAClB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the different types of keyrings supported.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum KeyringType {
|
|
5
|
+
/**
|
|
6
|
+
* Represents a hierarchical deterministic (HD) keyring.
|
|
7
|
+
*/
|
|
8
|
+
Hd = "hd",
|
|
9
|
+
/**
|
|
10
|
+
* Represents a keyring that directly stores private keys.
|
|
11
|
+
*/
|
|
12
|
+
PrivateKey = "private-key",
|
|
13
|
+
/**
|
|
14
|
+
* Represents a keyring that implements the QR protocol.
|
|
15
|
+
*
|
|
16
|
+
* See: https://eips.ethereum.org/EIPS/eip-4527
|
|
17
|
+
*/
|
|
18
|
+
Qr = "qr",
|
|
19
|
+
/**
|
|
20
|
+
* Represents keyring backed by a Snap.
|
|
21
|
+
*/
|
|
22
|
+
Snap = "snap",
|
|
23
|
+
/**
|
|
24
|
+
* Represents keyring backed by a Ledger hardware wallet.
|
|
25
|
+
*/
|
|
26
|
+
Ledger = "ledger",
|
|
27
|
+
/**
|
|
28
|
+
* Represents keyring backed by a Lattice hardware wallet.
|
|
29
|
+
*/
|
|
30
|
+
Lattice = "lattice",
|
|
31
|
+
/**
|
|
32
|
+
* Represents keyring backed by a Trezor hardware wallet.
|
|
33
|
+
*/
|
|
34
|
+
Trezor = "trezor",
|
|
35
|
+
/**
|
|
36
|
+
* Represents keyring backed by a OneKey hardware wallet.
|
|
37
|
+
*/
|
|
38
|
+
OneKey = "onekey"
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=keyring-type.d.mts.map
|