@metamask-previews/keyring-api 22.0.0-ea8175e → 23.1.0-bc99865
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 +35 -8
- package/README.md +0 -9
- package/dist/api/account.cjs +15 -1
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.d.cts +17 -4
- package/dist/api/account.d.cts.map +1 -1
- package/dist/api/account.d.mts +17 -4
- 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/keyring.cjs.map +1 -1
- package/dist/api/keyring.d.cts +1 -1
- package/dist/api/keyring.d.cts.map +1 -1
- package/dist/api/keyring.d.mts +1 -1
- package/dist/api/keyring.d.mts.map +1 -1
- package/dist/api/keyring.mjs.map +1 -1
- package/dist/api/transaction.cjs +5 -0
- package/dist/api/transaction.cjs.map +1 -1
- package/dist/api/transaction.d.cts +12 -6
- package/dist/api/transaction.d.cts.map +1 -1
- package/dist/api/transaction.d.mts +12 -6
- package/dist/api/transaction.d.mts.map +1 -1
- package/dist/api/transaction.mjs +5 -0
- package/dist/api/transaction.mjs.map +1 -1
- package/dist/eth/erc4337/types.cjs.map +1 -1
- package/dist/eth/erc4337/types.d.cts +1 -1
- package/dist/eth/erc4337/types.d.cts.map +1 -1
- package/dist/eth/erc4337/types.d.mts +1 -1
- package/dist/eth/erc4337/types.d.mts.map +1 -1
- package/dist/eth/erc4337/types.mjs.map +1 -1
- package/dist/eth/types.cjs.map +1 -1
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/types.mjs.map +1 -1
- package/dist/eth/utils.cjs +2 -1
- package/dist/eth/utils.cjs.map +1 -1
- package/dist/events.d.cts +13 -11
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +13 -11
- package/dist/events.d.mts.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -1
- package/dist/rpc.cjs +2 -2
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +27 -21
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +27 -21
- package/dist/rpc.d.mts.map +1 -1
- package/dist/v2/api/create-account/bip44.cjs.map +1 -1
- package/dist/v2/api/create-account/bip44.d.cts +1 -1
- package/dist/v2/api/create-account/bip44.d.cts.map +1 -1
- package/dist/v2/api/create-account/bip44.d.mts +1 -1
- package/dist/v2/api/create-account/bip44.d.mts.map +1 -1
- package/dist/v2/api/create-account/bip44.mjs.map +1 -1
- package/dist/v2/api/create-account/custom.cjs.map +1 -1
- package/dist/v2/api/create-account/custom.d.cts +1 -1
- package/dist/v2/api/create-account/custom.d.cts.map +1 -1
- package/dist/v2/api/create-account/custom.d.mts +1 -1
- package/dist/v2/api/create-account/custom.d.mts.map +1 -1
- package/dist/v2/api/create-account/custom.mjs.map +1 -1
- package/dist/v2/api/create-account/index.cjs +2 -2
- package/dist/v2/api/create-account/index.cjs.map +1 -1
- package/dist/v2/api/create-account/index.d.cts +2 -2
- package/dist/v2/api/create-account/index.d.cts.map +1 -1
- package/dist/v2/api/create-account/index.d.mts +2 -2
- package/dist/v2/api/create-account/index.d.mts.map +1 -1
- package/dist/v2/api/create-account/index.mjs.map +1 -1
- package/dist/v2/api/create-account/private-key.cjs.map +1 -1
- package/dist/v2/api/create-account/private-key.d.cts +4 -3
- package/dist/v2/api/create-account/private-key.d.cts.map +1 -1
- package/dist/v2/api/create-account/private-key.d.mts +4 -3
- package/dist/v2/api/create-account/private-key.d.mts.map +1 -1
- package/dist/v2/api/create-account/private-key.mjs.map +1 -1
- package/dist/v2/api/export-account/index.cjs.map +1 -1
- package/dist/v2/api/export-account/index.d.cts +1 -1
- package/dist/v2/api/export-account/index.d.cts.map +1 -1
- package/dist/v2/api/export-account/index.d.mts +1 -1
- package/dist/v2/api/export-account/index.d.mts.map +1 -1
- package/dist/v2/api/export-account/index.mjs.map +1 -1
- package/dist/v2/api/export-account/private-key.cjs.map +1 -1
- package/dist/v2/api/export-account/private-key.d.cts +1 -1
- package/dist/v2/api/export-account/private-key.d.cts.map +1 -1
- package/dist/v2/api/export-account/private-key.d.mts +1 -1
- package/dist/v2/api/export-account/private-key.d.mts.map +1 -1
- package/dist/v2/api/export-account/private-key.mjs.map +1 -1
- package/dist/v2/api/keyring-capabilities.cjs +1 -1
- package/dist/v2/api/keyring-capabilities.cjs.map +1 -1
- package/dist/v2/api/keyring-capabilities.d.cts +7 -6
- package/dist/v2/api/keyring-capabilities.d.cts.map +1 -1
- package/dist/v2/api/keyring-capabilities.d.mts +7 -6
- package/dist/v2/api/keyring-capabilities.d.mts.map +1 -1
- package/dist/v2/api/keyring-capabilities.mjs +1 -1
- package/dist/v2/api/keyring-capabilities.mjs.map +1 -1
- package/dist/v2/api/keyring-rpc.cjs +4 -4
- package/dist/v2/api/keyring-rpc.cjs.map +1 -1
- package/dist/v2/api/keyring-rpc.d.cts +13 -10
- package/dist/v2/api/keyring-rpc.d.cts.map +1 -1
- package/dist/v2/api/keyring-rpc.d.mts +13 -10
- package/dist/v2/api/keyring-rpc.d.mts.map +1 -1
- package/dist/v2/api/keyring-rpc.mjs +2 -2
- package/dist/v2/api/keyring-rpc.mjs.map +1 -1
- package/dist/v2/api/keyring.cjs.map +1 -1
- package/dist/v2/api/keyring.d.cts +2 -2
- package/dist/v2/api/keyring.d.cts.map +1 -1
- package/dist/v2/api/keyring.d.mts +2 -2
- package/dist/v2/api/keyring.d.mts.map +1 -1
- package/dist/v2/api/keyring.mjs.map +1 -1
- package/dist/v2/api/private-key.cjs.map +1 -1
- package/dist/v2/api/private-key.d.cts +4 -3
- package/dist/v2/api/private-key.d.cts.map +1 -1
- package/dist/v2/api/private-key.d.mts +4 -3
- package/dist/v2/api/private-key.d.mts.map +1 -1
- package/dist/v2/api/private-key.mjs.map +1 -1
- package/dist/xlm/constants.cjs +15 -0
- package/dist/xlm/constants.cjs.map +1 -0
- package/dist/xlm/constants.d.cts +10 -0
- package/dist/xlm/constants.d.cts.map +1 -0
- package/dist/xlm/constants.d.mts +10 -0
- package/dist/xlm/constants.d.mts.map +1 -0
- package/dist/xlm/constants.mjs +12 -0
- package/dist/xlm/constants.mjs.map +1 -0
- package/dist/xlm/index.cjs +19 -0
- package/dist/xlm/index.cjs.map +1 -0
- package/dist/xlm/index.d.cts +3 -0
- package/dist/xlm/index.d.cts.map +1 -0
- package/dist/xlm/index.d.mts +3 -0
- package/dist/xlm/index.d.mts.map +1 -0
- package/dist/xlm/index.mjs +3 -0
- package/dist/xlm/index.mjs.map +1 -0
- package/dist/xlm/types.cjs +43 -0
- package/dist/xlm/types.cjs.map +1 -0
- package/dist/xlm/types.d.cts +73 -0
- package/dist/xlm/types.d.cts.map +1 -0
- package/dist/xlm/types.d.mts +73 -0
- package/dist/xlm/types.d.mts.map +1 -0
- package/dist/xlm/types.mjs +40 -0
- package/dist/xlm/types.mjs.map +1 -0
- package/package.json +36 -30
- package/v2.js +3 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-capabilities.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,MAAM,EACN,OAAO,
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,aAAa,EACb,QAAQ,EACR,MAAM,EACN,OAAO,EACR,8BAA8B;AAG/B,OAAO,EAAE,iBAAiB,EAAE,2BAAuB;AACnD,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC7B,0BAAsB;AAEvB;;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} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { CaipChainIdStruct } from '../../api/caip';\nimport {\n ExportPrivateKeyFormatStruct,\n ImportPrivateKeyFormatStruct,\n} from './private-key';\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 Keyring 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"]}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SubmitRequestResponseStruct = exports.SubmitRequestRequestStruct = exports.ExportAccountResponseStruct = exports.ExportAccountRequestStruct = exports.DeleteAccountResponseStruct = exports.DeleteAccountRequestStruct = exports.CreateAccountsResponseStruct = exports.CreateAccountsRequestStruct = exports.GetAccountResponseStruct = exports.GetAccountRequestStruct = exports.GetAccountsResponseStruct = exports.GetAccountsRequestStruct = exports.KeyringRpcMethod = void 0;
|
|
4
|
-
exports.isKeyringRpcMethod = isKeyringRpcMethod;
|
|
3
|
+
exports.SubmitRequestResponseStruct = exports.SubmitRequestRequestStruct = exports.ExportAccountResponseStruct = exports.ExportAccountRequestStruct = exports.DeleteAccountResponseStruct = exports.DeleteAccountRequestStruct = exports.CreateAccountsResponseStruct = exports.CreateAccountsRequestStruct = exports.GetAccountResponseStruct = exports.GetAccountRequestStruct = exports.GetAccountsResponseStruct = exports.GetAccountsRequestStruct = exports.isKeyringRpcMethod = exports.KeyringRpcMethod = void 0;
|
|
5
4
|
const keyring_utils_1 = require("@metamask/keyring-utils");
|
|
6
5
|
const superstruct_1 = require("@metamask/superstruct");
|
|
7
6
|
const utils_1 = require("@metamask/utils");
|
|
8
|
-
const create_account_1 = require("./create-account/index.cjs");
|
|
9
|
-
const export_account_1 = require("./export-account/index.cjs");
|
|
10
7
|
const account_1 = require("../../api/account.cjs");
|
|
11
8
|
const request_1 = require("../../api/request.cjs");
|
|
9
|
+
const create_account_1 = require("./create-account/index.cjs");
|
|
10
|
+
const export_account_1 = require("./export-account/index.cjs");
|
|
12
11
|
/**
|
|
13
12
|
* Keyring RPC methods used by the API.
|
|
14
13
|
*/
|
|
@@ -31,6 +30,7 @@ exports.KeyringRpcMethod = {
|
|
|
31
30
|
function isKeyringRpcMethod(method) {
|
|
32
31
|
return Object.values(exports.KeyringRpcMethod).includes(method);
|
|
33
32
|
}
|
|
33
|
+
exports.isKeyringRpcMethod = isKeyringRpcMethod;
|
|
34
34
|
// ----------------------------------------------------------------------------
|
|
35
35
|
const CommonHeader = {
|
|
36
36
|
jsonrpc: (0, superstruct_1.literal)('2.0'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-rpc.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"keyring-rpc.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":";;;AAAA,2DAA4E;AAE5E,uDAA8E;AAC9E,2CAA6C;AAE7C,mDAAyD;AACzD,mDAAyD;AACzD,+DAA8D;AAC9D,+DAG0B;AAgB1B;;GAEG;AACU,QAAA,gBAAgB,GAAG;IAC9B,WAAW,EAAE,qBAAqB;IAClC,cAAc,EAAE,wBAAwB;IACxC,2DAA2D;IAC3D,6DAA6D;IAC7D,UAAU,EAAE,oBAAoB;IAChC,aAAa,EAAE,uBAAuB;IACtC,aAAa,EAAE,uBAAuB;IACtC,aAAa,EAAE,uBAAuB;CAC9B,CAAC;AAQX;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,MAAc;IAC/C,OAAO,MAAM,CAAC,MAAM,CAAC,wBAAgB,CAAC,CAAC,QAAQ,CAAC,MAA0B,CAAC,CAAC;AAC9E,CAAC;AAFD,gDAEC;AAED,+EAA+E;AAE/E,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;IACvB,EAAE,EAAE,IAAA,mBAAK,EAAC,CAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,oBAAM,GAAE,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;CAC/C,CAAC;AAEF,+EAA+E;AAC/E,eAAe;AAEF,QAAA,wBAAwB,GAAG,IAAA,sBAAM,EAAC;IAC7C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,wBAAgB,CAAC,WAAW,EAAE,CAAC;CACnD,CAAC,CAAC;AAIU,QAAA,yBAAyB,GAAG,IAAA,mBAAK,EAAC,8BAAoB,CAAC,CAAC;AAIrE,+EAA+E;AAC/E,cAAc;AAED,QAAA,uB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C/E,iBAAiB;AAEJ,QAAA,0BAA0B,GAAG,IAAA,sBAAM,EAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,wBAAgB,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,8BAAoB;CAC7B,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,kBAAU,CAAC","sourcesContent":["import { object, exactOptional, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, literal, number, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { KeyringAccountStruct } from '../../api/account';\nimport { KeyringRequestStruct } from '../../api/request';\nimport { CreateAccountOptionsStruct } from './create-account';\nimport {\n ExportAccountOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './export-account';\nimport type { Keyring } from './keyring';\n\n/**\n * Keyring interface for keyring methods that can be invoked through\n * RPC calls.\n */\nexport type KeyringRpc = {\n getAccount: Keyring['getAccount'];\n getAccounts: Keyring['getAccounts'];\n createAccounts: Keyring['createAccounts'];\n deleteAccount: Keyring['deleteAccount'];\n submitRequest: Keyring['submitRequest'];\n exportAccount?: Keyring['exportAccount'];\n};\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport const KeyringRpcMethod = {\n GetAccounts: 'keyring_getAccounts',\n CreateAccounts: 'keyring_createAccounts',\n // Inherited from v1 (but method signatures may differ...):\n // NOTE: We use literals here to avoid circular dependencies.\n GetAccount: 'keyring_getAccount',\n DeleteAccount: 'keyring_deleteAccount',\n ExportAccount: 'keyring_exportAccount',\n SubmitRequest: 'keyring_submitRequest',\n} as const;\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport type KeyringRpcMethod =\n (typeof KeyringRpcMethod)[keyof typeof KeyringRpcMethod];\n\n/**\n * Check if a method is a keyring RPC method (v2).\n *\n * @param method - Method to check.\n * @returns Whether the method is a keyring RPC method (v2).\n */\nexport function isKeyringRpcMethod(method: string): method is KeyringRpcMethod {\n return Object.values(KeyringRpcMethod).includes(method as KeyringRpcMethod);\n}\n\n// ----------------------------------------------------------------------------\n\nconst CommonHeader = {\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n};\n\n// ----------------------------------------------------------------------------\n// Get accounts\n\nexport const GetAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccounts}`),\n});\n\nexport type GetAccountsRequest = Infer<typeof GetAccountsRequestStruct>;\n\nexport const GetAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type GetAccountsResponse = Infer<typeof GetAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get account\n\nexport const GetAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccount}`),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;\n\nexport const GetAccountResponseStruct = KeyringAccountStruct;\n\nexport type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Create accounts\n\nexport const CreateAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.CreateAccounts}`),\n params: CreateAccountOptionsStruct,\n});\n\nexport type CreateAccountsRequest = Infer<typeof CreateAccountsRequestStruct>;\n\nexport const CreateAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type CreateAccountsResponse = Infer<typeof CreateAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Delete account\n\nexport const DeleteAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.DeleteAccount}`),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;\n\nexport const DeleteAccountResponseStruct = literal(null);\n\nexport type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Export account\n\nexport const ExportAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.ExportAccount}`),\n params: object({\n id: UuidStruct,\n options: exactOptional(ExportAccountOptionsStruct),\n }),\n});\n\nexport type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;\n\nexport const ExportAccountResponseStruct = PrivateKeyExportedAccountStruct;\n\nexport type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Submit request\n\nexport const SubmitRequestRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.SubmitRequest}`),\n params: KeyringRequestStruct,\n});\n\nexport type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;\n\nexport const SubmitRequestResponseStruct = JsonStruct;\n\nexport type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n\n/**\n * Keyring RPC requests.\n */\nexport type KeyringRpcRequests =\n | GetAccountsRequest\n | GetAccountRequest\n | CreateAccountsRequest\n | DeleteAccountRequest\n | ExportAccountRequest\n | SubmitRequestRequest;\n\n/**\n * Extract the proper request type for a given `KeyringRpcMethod`.\n */\nexport type KeyringRpcRequest<RpcMethod extends KeyringRpcMethod> = Extract<\n KeyringRpcRequests,\n { method: `${RpcMethod}` }\n>;\n"]}
|
|
@@ -45,7 +45,7 @@ export declare const GetAccountsRequestStruct: import("@metamask/superstruct").S
|
|
|
45
45
|
}>;
|
|
46
46
|
export type GetAccountsRequest = Infer<typeof GetAccountsRequestStruct>;
|
|
47
47
|
export declare const GetAccountsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
48
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
48
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
49
49
|
id: string;
|
|
50
50
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
51
51
|
entropy?: {
|
|
@@ -64,7 +64,7 @@ export declare const GetAccountsResponseStruct: import("@metamask/superstruct").
|
|
|
64
64
|
scopes: `${string}:${string}`[];
|
|
65
65
|
methods: string[];
|
|
66
66
|
}[], import("@metamask/superstruct").Struct<{
|
|
67
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
67
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
68
68
|
id: string;
|
|
69
69
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
70
70
|
entropy?: {
|
|
@@ -84,7 +84,7 @@ export declare const GetAccountsResponseStruct: import("@metamask/superstruct").
|
|
|
84
84
|
methods: string[];
|
|
85
85
|
}, {
|
|
86
86
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
87
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
87
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
88
88
|
"eip155:eoa": "eip155:eoa";
|
|
89
89
|
"eip155:erc4337": "eip155:erc4337";
|
|
90
90
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -93,6 +93,7 @@ export declare const GetAccountsResponseStruct: import("@metamask/superstruct").
|
|
|
93
93
|
"bip122:p2tr": "bip122:p2tr";
|
|
94
94
|
"solana:data-account": "solana:data-account";
|
|
95
95
|
"tron:eoa": "tron:eoa";
|
|
96
|
+
"stellar:account": "stellar:account";
|
|
96
97
|
"any:account": "any:account";
|
|
97
98
|
}>;
|
|
98
99
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -132,7 +133,7 @@ export declare const GetAccountRequestStruct: import("@metamask/superstruct").St
|
|
|
132
133
|
}>;
|
|
133
134
|
export type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
|
|
134
135
|
export declare const GetAccountResponseStruct: import("@metamask/superstruct").Struct<{
|
|
135
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
136
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
136
137
|
id: string;
|
|
137
138
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
138
139
|
entropy?: {
|
|
@@ -152,7 +153,7 @@ export declare const GetAccountResponseStruct: import("@metamask/superstruct").S
|
|
|
152
153
|
methods: string[];
|
|
153
154
|
}, {
|
|
154
155
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
155
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
156
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
156
157
|
"eip155:eoa": "eip155:eoa";
|
|
157
158
|
"eip155:erc4337": "eip155:erc4337";
|
|
158
159
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -161,6 +162,7 @@ export declare const GetAccountResponseStruct: import("@metamask/superstruct").S
|
|
|
161
162
|
"bip122:p2tr": "bip122:p2tr";
|
|
162
163
|
"solana:data-account": "solana:data-account";
|
|
163
164
|
"tron:eoa": "tron:eoa";
|
|
165
|
+
"stellar:account": "stellar:account";
|
|
164
166
|
"any:account": "any:account";
|
|
165
167
|
}>;
|
|
166
168
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -210,7 +212,7 @@ export declare const CreateAccountsRequestStruct: import("@metamask/superstruct"
|
|
|
210
212
|
type: "private-key:import";
|
|
211
213
|
encoding: "hexadecimal" | "base58";
|
|
212
214
|
privateKey: string;
|
|
213
|
-
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
215
|
+
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
214
216
|
};
|
|
215
217
|
}, {
|
|
216
218
|
method: import("@metamask/superstruct").Struct<"keyring_createAccounts", "keyring_createAccounts">;
|
|
@@ -239,14 +241,14 @@ export declare const CreateAccountsRequestStruct: import("@metamask/superstruct"
|
|
|
239
241
|
type: "private-key:import";
|
|
240
242
|
encoding: "hexadecimal" | "base58";
|
|
241
243
|
privateKey: string;
|
|
242
|
-
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
244
|
+
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
243
245
|
}, null>;
|
|
244
246
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
245
247
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
246
248
|
}>;
|
|
247
249
|
export type CreateAccountsRequest = Infer<typeof CreateAccountsRequestStruct>;
|
|
248
250
|
export declare const CreateAccountsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
249
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
251
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
250
252
|
id: string;
|
|
251
253
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
252
254
|
entropy?: {
|
|
@@ -265,7 +267,7 @@ export declare const CreateAccountsResponseStruct: import("@metamask/superstruct
|
|
|
265
267
|
scopes: `${string}:${string}`[];
|
|
266
268
|
methods: string[];
|
|
267
269
|
}[], import("@metamask/superstruct").Struct<{
|
|
268
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
270
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
269
271
|
id: string;
|
|
270
272
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
271
273
|
entropy?: {
|
|
@@ -285,7 +287,7 @@ export declare const CreateAccountsResponseStruct: import("@metamask/superstruct
|
|
|
285
287
|
methods: string[];
|
|
286
288
|
}, {
|
|
287
289
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
288
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
290
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
289
291
|
"eip155:eoa": "eip155:eoa";
|
|
290
292
|
"eip155:erc4337": "eip155:erc4337";
|
|
291
293
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -294,6 +296,7 @@ export declare const CreateAccountsResponseStruct: import("@metamask/superstruct
|
|
|
294
296
|
"bip122:p2tr": "bip122:p2tr";
|
|
295
297
|
"solana:data-account": "solana:data-account";
|
|
296
298
|
"tron:eoa": "tron:eoa";
|
|
299
|
+
"stellar:account": "stellar:account";
|
|
297
300
|
"any:account": "any:account";
|
|
298
301
|
}>;
|
|
299
302
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-rpc.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"keyring-rpc.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAWnD,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAkB;AAEzC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAClC,WAAW,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACpC,cAAc,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC1C,aAAa,EAAE,OAAO,CAAC,eAAe,C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C"}
|
|
@@ -45,7 +45,7 @@ export declare const GetAccountsRequestStruct: import("@metamask/superstruct").S
|
|
|
45
45
|
}>;
|
|
46
46
|
export type GetAccountsRequest = Infer<typeof GetAccountsRequestStruct>;
|
|
47
47
|
export declare const GetAccountsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
48
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
48
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
49
49
|
id: string;
|
|
50
50
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
51
51
|
entropy?: {
|
|
@@ -64,7 +64,7 @@ export declare const GetAccountsResponseStruct: import("@metamask/superstruct").
|
|
|
64
64
|
scopes: `${string}:${string}`[];
|
|
65
65
|
methods: string[];
|
|
66
66
|
}[], import("@metamask/superstruct").Struct<{
|
|
67
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
67
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
68
68
|
id: string;
|
|
69
69
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
70
70
|
entropy?: {
|
|
@@ -84,7 +84,7 @@ export declare const GetAccountsResponseStruct: import("@metamask/superstruct").
|
|
|
84
84
|
methods: string[];
|
|
85
85
|
}, {
|
|
86
86
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
87
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
87
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
88
88
|
"eip155:eoa": "eip155:eoa";
|
|
89
89
|
"eip155:erc4337": "eip155:erc4337";
|
|
90
90
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -93,6 +93,7 @@ export declare const GetAccountsResponseStruct: import("@metamask/superstruct").
|
|
|
93
93
|
"bip122:p2tr": "bip122:p2tr";
|
|
94
94
|
"solana:data-account": "solana:data-account";
|
|
95
95
|
"tron:eoa": "tron:eoa";
|
|
96
|
+
"stellar:account": "stellar:account";
|
|
96
97
|
"any:account": "any:account";
|
|
97
98
|
}>;
|
|
98
99
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -132,7 +133,7 @@ export declare const GetAccountRequestStruct: import("@metamask/superstruct").St
|
|
|
132
133
|
}>;
|
|
133
134
|
export type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;
|
|
134
135
|
export declare const GetAccountResponseStruct: import("@metamask/superstruct").Struct<{
|
|
135
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
136
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
136
137
|
id: string;
|
|
137
138
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
138
139
|
entropy?: {
|
|
@@ -152,7 +153,7 @@ export declare const GetAccountResponseStruct: import("@metamask/superstruct").S
|
|
|
152
153
|
methods: string[];
|
|
153
154
|
}, {
|
|
154
155
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
155
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
156
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
156
157
|
"eip155:eoa": "eip155:eoa";
|
|
157
158
|
"eip155:erc4337": "eip155:erc4337";
|
|
158
159
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -161,6 +162,7 @@ export declare const GetAccountResponseStruct: import("@metamask/superstruct").S
|
|
|
161
162
|
"bip122:p2tr": "bip122:p2tr";
|
|
162
163
|
"solana:data-account": "solana:data-account";
|
|
163
164
|
"tron:eoa": "tron:eoa";
|
|
165
|
+
"stellar:account": "stellar:account";
|
|
164
166
|
"any:account": "any:account";
|
|
165
167
|
}>;
|
|
166
168
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -210,7 +212,7 @@ export declare const CreateAccountsRequestStruct: import("@metamask/superstruct"
|
|
|
210
212
|
type: "private-key:import";
|
|
211
213
|
encoding: "hexadecimal" | "base58";
|
|
212
214
|
privateKey: string;
|
|
213
|
-
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
215
|
+
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
214
216
|
};
|
|
215
217
|
}, {
|
|
216
218
|
method: import("@metamask/superstruct").Struct<"keyring_createAccounts", "keyring_createAccounts">;
|
|
@@ -239,14 +241,14 @@ export declare const CreateAccountsRequestStruct: import("@metamask/superstruct"
|
|
|
239
241
|
type: "private-key:import";
|
|
240
242
|
encoding: "hexadecimal" | "base58";
|
|
241
243
|
privateKey: string;
|
|
242
|
-
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
244
|
+
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
243
245
|
}, null>;
|
|
244
246
|
jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
|
|
245
247
|
id: import("@metamask/superstruct").Struct<string | number | null, null>;
|
|
246
248
|
}>;
|
|
247
249
|
export type CreateAccountsRequest = Infer<typeof CreateAccountsRequestStruct>;
|
|
248
250
|
export declare const CreateAccountsResponseStruct: import("@metamask/superstruct").Struct<{
|
|
249
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
251
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
250
252
|
id: string;
|
|
251
253
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
252
254
|
entropy?: {
|
|
@@ -265,7 +267,7 @@ export declare const CreateAccountsResponseStruct: import("@metamask/superstruct
|
|
|
265
267
|
scopes: `${string}:${string}`[];
|
|
266
268
|
methods: string[];
|
|
267
269
|
}[], import("@metamask/superstruct").Struct<{
|
|
268
|
-
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
270
|
+
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
269
271
|
id: string;
|
|
270
272
|
options: Record<string, import("@metamask/utils").Json> & {
|
|
271
273
|
entropy?: {
|
|
@@ -285,7 +287,7 @@ export declare const CreateAccountsResponseStruct: import("@metamask/superstruct
|
|
|
285
287
|
methods: string[];
|
|
286
288
|
}, {
|
|
287
289
|
id: import("@metamask/superstruct").Struct<string, null>;
|
|
288
|
-
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
290
|
+
type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
289
291
|
"eip155:eoa": "eip155:eoa";
|
|
290
292
|
"eip155:erc4337": "eip155:erc4337";
|
|
291
293
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -294,6 +296,7 @@ export declare const CreateAccountsResponseStruct: import("@metamask/superstruct
|
|
|
294
296
|
"bip122:p2tr": "bip122:p2tr";
|
|
295
297
|
"solana:data-account": "solana:data-account";
|
|
296
298
|
"tron:eoa": "tron:eoa";
|
|
299
|
+
"stellar:account": "stellar:account";
|
|
297
300
|
"any:account": "any:account";
|
|
298
301
|
}>;
|
|
299
302
|
address: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-rpc.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EA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K,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E,eAAO,MAAM,2BAA2B,iFAAa,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAI9E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,kBAAkB,GAClB,iBAAiB,GACjB,qBAAqB,GACrB,oBAAoB,GACpB,oBAAoB,GACpB,oBAAoB,CAAC;AAEzB;;GAEG;AACH,MAAM,MAAM,iBAAiB,CAAC,SAAS,SAAS,gBAAgB,IAAI,OAAO,CACzE,kBAAkB,EAClB;IAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAA;CAAE,CAC3B,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { object, exactOptional, UuidStruct } from "@metamask/keyring-utils";
|
|
2
2
|
import { array, literal, number, string, union } from "@metamask/superstruct";
|
|
3
3
|
import { JsonStruct } from "@metamask/utils";
|
|
4
|
-
import { CreateAccountOptionsStruct } from "./create-account/index.mjs";
|
|
5
|
-
import { ExportAccountOptionsStruct, PrivateKeyExportedAccountStruct } from "./export-account/index.mjs";
|
|
6
4
|
import { KeyringAccountStruct } from "../../api/account.mjs";
|
|
7
5
|
import { KeyringRequestStruct } from "../../api/request.mjs";
|
|
6
|
+
import { CreateAccountOptionsStruct } from "./create-account/index.mjs";
|
|
7
|
+
import { ExportAccountOptionsStruct, PrivateKeyExportedAccountStruct } from "./export-account/index.mjs";
|
|
8
8
|
/**
|
|
9
9
|
* Keyring RPC methods used by the API.
|
|
10
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-rpc.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-rpc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,gCAAgC;AAE5E,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAA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,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,UAAU;QACd,OAAO,EAAE,aAAa,CAAC,0BAA0B,CAAC;KACnD,CAAC;CACH,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,+BAA+B,CAAC;AAI3E,+EAA+E;AAC/E,iBAAiB;AAEjB,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAC;IAC/C,GAAG,YAAY;IACf,MAAM,EAAE,OAAO,CAAC,GAAG,gBAAgB,CAAC,aAAa,EAAE,CAAC;IACpD,MAAM,EAAE,oBAAoB;CAC7B,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,2BAA2B,GAAG,UAAU,CAAC","sourcesContent":["import { object, exactOptional, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, literal, number, string, union } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { KeyringAccountStruct } from '../../api/account';\nimport { KeyringRequestStruct } from '../../api/request';\nimport { CreateAccountOptionsStruct } from './create-account';\nimport {\n ExportAccountOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './export-account';\nimport type { Keyring } from './keyring';\n\n/**\n * Keyring interface for keyring methods that can be invoked through\n * RPC calls.\n */\nexport type KeyringRpc = {\n getAccount: Keyring['getAccount'];\n getAccounts: Keyring['getAccounts'];\n createAccounts: Keyring['createAccounts'];\n deleteAccount: Keyring['deleteAccount'];\n submitRequest: Keyring['submitRequest'];\n exportAccount?: Keyring['exportAccount'];\n};\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport const KeyringRpcMethod = {\n GetAccounts: 'keyring_getAccounts',\n CreateAccounts: 'keyring_createAccounts',\n // Inherited from v1 (but method signatures may differ...):\n // NOTE: We use literals here to avoid circular dependencies.\n GetAccount: 'keyring_getAccount',\n DeleteAccount: 'keyring_deleteAccount',\n ExportAccount: 'keyring_exportAccount',\n SubmitRequest: 'keyring_submitRequest',\n} as const;\n\n/**\n * Keyring RPC methods used by the API.\n */\nexport type KeyringRpcMethod =\n (typeof KeyringRpcMethod)[keyof typeof KeyringRpcMethod];\n\n/**\n * Check if a method is a keyring RPC method (v2).\n *\n * @param method - Method to check.\n * @returns Whether the method is a keyring RPC method (v2).\n */\nexport function isKeyringRpcMethod(method: string): method is KeyringRpcMethod {\n return Object.values(KeyringRpcMethod).includes(method as KeyringRpcMethod);\n}\n\n// ----------------------------------------------------------------------------\n\nconst CommonHeader = {\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n};\n\n// ----------------------------------------------------------------------------\n// Get accounts\n\nexport const GetAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccounts}`),\n});\n\nexport type GetAccountsRequest = Infer<typeof GetAccountsRequestStruct>;\n\nexport const GetAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type GetAccountsResponse = Infer<typeof GetAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Get account\n\nexport const GetAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.GetAccount}`),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type GetAccountRequest = Infer<typeof GetAccountRequestStruct>;\n\nexport const GetAccountResponseStruct = KeyringAccountStruct;\n\nexport type GetAccountResponse = Infer<typeof GetAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Create accounts\n\nexport const CreateAccountsRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.CreateAccounts}`),\n params: CreateAccountOptionsStruct,\n});\n\nexport type CreateAccountsRequest = Infer<typeof CreateAccountsRequestStruct>;\n\nexport const CreateAccountsResponseStruct = array(KeyringAccountStruct);\n\nexport type CreateAccountsResponse = Infer<typeof CreateAccountsResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Delete account\n\nexport const DeleteAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.DeleteAccount}`),\n params: object({\n id: UuidStruct,\n }),\n});\n\nexport type DeleteAccountRequest = Infer<typeof DeleteAccountRequestStruct>;\n\nexport const DeleteAccountResponseStruct = literal(null);\n\nexport type DeleteAccountResponse = Infer<typeof DeleteAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Export account\n\nexport const ExportAccountRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.ExportAccount}`),\n params: object({\n id: UuidStruct,\n options: exactOptional(ExportAccountOptionsStruct),\n }),\n});\n\nexport type ExportAccountRequest = Infer<typeof ExportAccountRequestStruct>;\n\nexport const ExportAccountResponseStruct = PrivateKeyExportedAccountStruct;\n\nexport type ExportAccountResponse = Infer<typeof ExportAccountResponseStruct>;\n\n// ----------------------------------------------------------------------------\n// Submit request\n\nexport const SubmitRequestRequestStruct = object({\n ...CommonHeader,\n method: literal(`${KeyringRpcMethod.SubmitRequest}`),\n params: KeyringRequestStruct,\n});\n\nexport type SubmitRequestRequest = Infer<typeof SubmitRequestRequestStruct>;\n\nexport const SubmitRequestResponseStruct = JsonStruct;\n\nexport type SubmitRequestResponse = Infer<typeof SubmitRequestResponseStruct>;\n\n// ----------------------------------------------------------------------------\n\n/**\n * Keyring RPC requests.\n */\nexport type KeyringRpcRequests =\n | GetAccountsRequest\n | GetAccountRequest\n | CreateAccountsRequest\n | DeleteAccountRequest\n | ExportAccountRequest\n | SubmitRequestRequest;\n\n/**\n * Extract the proper request type for a given `KeyringRpcMethod`.\n */\nexport type KeyringRpcRequest<RpcMethod extends KeyringRpcMethod> = Extract<\n KeyringRpcRequests,\n { method: `${RpcMethod}` }\n>;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"keyring.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from '../../api/account';\nimport type { KeyringRequest } from '../../api/request';\nimport type { CreateAccountOptions } from './create-account';\nimport type { ExportedAccount, ExportAccountOptions } from './export-account';\nimport type { KeyringCapabilities } from './keyring-capabilities';\nimport type { KeyringType } from './keyring-type';\n\n/**\n * The Keyring interface defines methods for managing accounts and signing\n * requests. This interface unifies the existing EVM and Snap keyring interfaces\n * to provide a consistent API for all keyring type.\n *\n * This interface supports both EVM and non-EVM chains, and includes\n * account metadata needed for features like Multi-SRP and Backup and Sync.\n */\nexport type Keyring = {\n /**\n * Type of the keyring.\n */\n type: `${KeyringType}`;\n\n /**\n * List of capabilities supported by the keyring.\n */\n capabilities: KeyringCapabilities;\n\n /**\n * Serialize the keyring state to a JSON object.\n *\n * @returns A promise that resolves to a JSON-serializable representation of\n * the keyring state.\n */\n serialize(): Promise<Json>;\n\n /**\n * Restores the keyring state from a serialized JSON object.\n *\n * @param state - A JSON object representing a serialized keyring state.\n * @returns A promise that resolves when the keyring state has been restored.\n */\n deserialize(state: Json): Promise<void>;\n\n /**\n * Initialize the keyring.\n *\n * This method is called after the constructor to allow the keyring to\n * perform any necessary asynchronous initialization tasks.\n *\n * @returns A promise that resolves when initialization is complete.\n */\n init?(): Promise<void>;\n\n /**\n * Destroy the keyring.\n *\n * This method is called before the keyring is removed from the Keyring\n * Controller, allowing the keyring to perform any necessary cleanup tasks.\n *\n * @returns A promise that resolves when cleanup is complete.\n */\n destroy?(): Promise<void>;\n\n /**\n * Returns all accounts managed by the keyring.\n *\n * @returns A promise that resolves to an array of all accounts managed by\n * this keyring.\n */\n getAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Returns the account with the specified ID.\n *\n * @param accountId - ID of the account to retrieve.\n * @returns A promise that resolves to the account with the given ID.\n */\n getAccount(accountId: AccountId): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Deletes the account with the specified ID.\n *\n * @param accountId - ID of the account to delete.\n * @returns A promise that resolves when the account has been deleted.\n */\n deleteAccount(accountId: AccountId): Promise<void>;\n\n /**\n * Exports the private key or secret material for the specified account.\n *\n * @param accountId - ID of the account to export.\n * @param options - Optional export options.\n * @returns A promise that resolves to the exported account data.\n */\n exportAccount?(\n accountId: AccountId,\n options?: ExportAccountOptions,\n ): Promise<ExportedAccount>;\n\n /**\n * Submits a request to the keyring.\n *\n * @param request - The `KeyringRequest` object to submit.\n * @returns A promise that resolves to the response for the request.\n */\n submitRequest(request: KeyringRequest): Promise<Json>;\n};\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { AccountId } from "@metamask/keyring-utils";
|
|
2
2
|
import type { Json } from "@metamask/utils";
|
|
3
|
+
import type { KeyringAccount } from "../../api/account.cjs";
|
|
4
|
+
import type { KeyringRequest } from "../../api/request.cjs";
|
|
3
5
|
import type { CreateAccountOptions } from "./create-account/index.cjs";
|
|
4
6
|
import type { ExportedAccount, ExportAccountOptions } from "./export-account/index.cjs";
|
|
5
7
|
import type { KeyringCapabilities } from "./keyring-capabilities.cjs";
|
|
6
8
|
import type { KeyringType } from "./keyring-type.cjs";
|
|
7
|
-
import type { KeyringAccount } from "../../api/account.cjs";
|
|
8
|
-
import type { KeyringRequest } from "../../api/request.cjs";
|
|
9
9
|
/**
|
|
10
10
|
* The Keyring interface defines methods for managing accounts and signing
|
|
11
11
|
* requests. This interface unifies the existing EVM and Snap keyring interfaces
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gCAAgC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"keyring.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gCAAgC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA0B;AACxD,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA0B;AACxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,mCAAyB;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE,mCAAyB;AAC9E,OAAO,KAAK,EAAE,mBAAmB,EAAE,mCAA+B;AAClE,OAAO,KAAK,EAAE,WAAW,EAAE,2BAAuB;AAElD;;;;;;;GAOG;AACH,MAAM,MAAM,OAAO,GAAG;IACpB;;OAEG;IACH,IAAI,EAAE,GAAG,WAAW,EAAE,CAAC;IAEvB;;OAEG;IACH,YAAY,EAAE,mBAAmB,CAAC;IAElC;;;;;OAKG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B;;;;;OAKG;IACH,WAAW,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;;;;OAOG;IACH,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvB;;;;;;;OAOG;IACH,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;;OAKG;IACH,WAAW,IAAI,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAEzC;;;;;OAKG;IACH,UAAU,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAE1D;;;;;;;;;;OAUG;IACH,cAAc,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IAEzE;;;;;OAKG;IACH,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;;;;;OAMG;IACH,aAAa,CAAC,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAAC;IAE5B;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { AccountId } from "@metamask/keyring-utils";
|
|
2
2
|
import type { Json } from "@metamask/utils";
|
|
3
|
+
import type { KeyringAccount } from "../../api/account.mjs";
|
|
4
|
+
import type { KeyringRequest } from "../../api/request.mjs";
|
|
3
5
|
import type { CreateAccountOptions } from "./create-account/index.mjs";
|
|
4
6
|
import type { ExportedAccount, ExportAccountOptions } from "./export-account/index.mjs";
|
|
5
7
|
import type { KeyringCapabilities } from "./keyring-capabilities.mjs";
|
|
6
8
|
import type { KeyringType } from "./keyring-type.mjs";
|
|
7
|
-
import type { KeyringAccount } from "../../api/account.mjs";
|
|
8
|
-
import type { KeyringRequest } from "../../api/request.mjs";
|
|
9
9
|
/**
|
|
10
10
|
* The Keyring interface defines methods for managing accounts and signing
|
|
11
11
|
* requests. This interface unifies the existing EVM and Snap keyring interfaces
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.d.mts","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gCAAgC;AACzD,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAE5C,OAAO,KAAK,EAAE,
|
|
1
|
+
{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IAAI,CAAC,CAAC;IAEnD;;;;;;OAMG;IACH,aAAa,CAAC,CACZ,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,OAAO,CAAC,eAAe,CAAC,CAAC;IAE5B;;;;;OAKG;IACH,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACvD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type {
|
|
1
|
+
{"version":3,"file":"keyring.mjs","sourceRoot":"","sources":["../../../src/v2/api/keyring.ts"],"names":[],"mappings":"","sourcesContent":["import type { AccountId } from '@metamask/keyring-utils';\nimport type { Json } from '@metamask/utils';\n\nimport type { KeyringAccount } from '../../api/account';\nimport type { KeyringRequest } from '../../api/request';\nimport type { CreateAccountOptions } from './create-account';\nimport type { ExportedAccount, ExportAccountOptions } from './export-account';\nimport type { KeyringCapabilities } from './keyring-capabilities';\nimport type { KeyringType } from './keyring-type';\n\n/**\n * The Keyring interface defines methods for managing accounts and signing\n * requests. This interface unifies the existing EVM and Snap keyring interfaces\n * to provide a consistent API for all keyring type.\n *\n * This interface supports both EVM and non-EVM chains, and includes\n * account metadata needed for features like Multi-SRP and Backup and Sync.\n */\nexport type Keyring = {\n /**\n * Type of the keyring.\n */\n type: `${KeyringType}`;\n\n /**\n * List of capabilities supported by the keyring.\n */\n capabilities: KeyringCapabilities;\n\n /**\n * Serialize the keyring state to a JSON object.\n *\n * @returns A promise that resolves to a JSON-serializable representation of\n * the keyring state.\n */\n serialize(): Promise<Json>;\n\n /**\n * Restores the keyring state from a serialized JSON object.\n *\n * @param state - A JSON object representing a serialized keyring state.\n * @returns A promise that resolves when the keyring state has been restored.\n */\n deserialize(state: Json): Promise<void>;\n\n /**\n * Initialize the keyring.\n *\n * This method is called after the constructor to allow the keyring to\n * perform any necessary asynchronous initialization tasks.\n *\n * @returns A promise that resolves when initialization is complete.\n */\n init?(): Promise<void>;\n\n /**\n * Destroy the keyring.\n *\n * This method is called before the keyring is removed from the Keyring\n * Controller, allowing the keyring to perform any necessary cleanup tasks.\n *\n * @returns A promise that resolves when cleanup is complete.\n */\n destroy?(): Promise<void>;\n\n /**\n * Returns all accounts managed by the keyring.\n *\n * @returns A promise that resolves to an array of all accounts managed by\n * this keyring.\n */\n getAccounts(): Promise<KeyringAccount[]>;\n\n /**\n * Returns the account with the specified ID.\n *\n * @param accountId - ID of the account to retrieve.\n * @returns A promise that resolves to the account with the given ID.\n */\n getAccount(accountId: AccountId): Promise<KeyringAccount>;\n\n /**\n * Creates one or more new accounts according to the provided options.\n *\n * Deterministic account creation MUST be idempotent, meaning that for\n * deterministic algorithms, like BIP-44, calling this method with the same\n * options should always return the same accounts, even if the accounts\n * already exist in the keyring.\n *\n * @param options - Options describing how to create the account(s).\n * @returns A promise that resolves to an array of the created account objects.\n */\n createAccounts(options: CreateAccountOptions): Promise<KeyringAccount[]>;\n\n /**\n * Deletes the account with the specified ID.\n *\n * @param accountId - ID of the account to delete.\n * @returns A promise that resolves when the account has been deleted.\n */\n deleteAccount(accountId: AccountId): Promise<void>;\n\n /**\n * Exports the private key or secret material for the specified account.\n *\n * @param accountId - ID of the account to export.\n * @param options - Optional export options.\n * @returns A promise that resolves to the exported account data.\n */\n exportAccount?(\n accountId: AccountId,\n options?: ExportAccountOptions,\n ): Promise<ExportedAccount>;\n\n /**\n * Submits a request to the keyring.\n *\n * @param request - The `KeyringRequest` object to submit.\n * @returns A promise that resolves to the response for the request.\n */\n submitRequest(request: KeyringRequest): Promise<Json>;\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;AAGrE,mDAA6D;AAE7D;;GAEG;AACH,IAAY,kBAUX;AAVD,WAAY,kBAAkB;IAC5B;;OAEG;IACH,iDAA2B,CAAA;IAE3B;;OAEG;IACH,uCAAiB,CAAA;AACnB,CAAC,EAVW,kBAAkB,kCAAlB,kBAAkB,QAU7B;AAED;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAA,mBAAK,EAAC;IAC5C,GAAG,kBAAkB,CAAC,WAAW,EAAE;IACnC,GAAG,kBAAkB,CAAC,MAAM,EAAE;CAC/B,CAAC,CAAC;AAEH;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,gCAAwB;IAElC;;;;;;OAMG;IACH,IAAI,EAAE,IAAA,2BAAa,EAAC,kCAAwB,CAAC;CAC9C,CAAC,CAAC;AAOH;;GAEG;AACU,QAAA,4BAA4B,GAAG,IAAA,oBAAM,EAAC;IACjD;;OAEG;IACH,QAAQ,EAAE,gCAAwB;CACnC,CAAC,CAAC","sourcesContent":["import { enums, exactOptional, object } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../api/account';\n\n/**\n * Supported encoding formats for private keys.\n */\nexport enum PrivateKeyEncoding {\n /**\n * Hexadecimal encoding format.\n */\n Hexadecimal = 'hexadecimal',\n\n /**\n * Base58 encoding format.\n */\n Base58 = 'base58',\n}\n\n/**\n * Struct for {@link PrivateKeyEncoding}.\n */\nexport const PrivateKeyEncodingStruct = enums([\n `${PrivateKeyEncoding.Hexadecimal}`,\n `${PrivateKeyEncoding.Base58}`,\n]);\n\n/**\n * Struct for {@link ImportPrivateKeyFormat}.\n */\nexport const ImportPrivateKeyFormatStruct = object({\n /**\n * Format used to encode the private key as a string.\n */\n encoding: PrivateKeyEncodingStruct,\n\n /**\n * Type of the account to be created.\n *\n * This field is necessary when there is ambiguity about the type of account\n * to be created from the private key. For example, in Bitcoin, a private key\n * can be used to create multiple types of accounts, such as P2WPKH, or P2TR.\n */\n type: exactOptional(KeyringAccountTypeStruct),\n});\n\n/**\n * Represents the format for importing a private key into a keyring.\n */\nexport type ImportPrivateKeyFormat = Infer<typeof ImportPrivateKeyFormatStruct>;\n\n/**\n * Struct for {@link ExportPrivateKeyFormat}.\n */\nexport const ExportPrivateKeyFormatStruct = object({\n /**\n * Format used to encode the private key as a string.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Represents the format for exporting a private key from a keyring.\n */\nexport type ExportPrivateKeyFormat = Infer<typeof ExportPrivateKeyFormatStruct>;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Infer } from "@metamask/superstruct";
|
|
2
2
|
/**
|
|
3
3
|
* Supported encoding formats for private keys.
|
|
4
4
|
*/
|
|
@@ -24,7 +24,7 @@ export declare const PrivateKeyEncodingStruct: import("@metamask/superstruct").S
|
|
|
24
24
|
*/
|
|
25
25
|
export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct").Struct<{
|
|
26
26
|
encoding: "hexadecimal" | "base58";
|
|
27
|
-
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
|
|
27
|
+
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
28
28
|
}, {
|
|
29
29
|
/**
|
|
30
30
|
* Format used to encode the private key as a string.
|
|
@@ -40,7 +40,7 @@ export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct
|
|
|
40
40
|
* to be created from the private key. For example, in Bitcoin, a private key
|
|
41
41
|
* can be used to create multiple types of accounts, such as P2WPKH, or P2TR.
|
|
42
42
|
*/
|
|
43
|
-
type: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
|
|
43
|
+
type: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account", {
|
|
44
44
|
"eip155:eoa": "eip155:eoa";
|
|
45
45
|
"eip155:erc4337": "eip155:erc4337";
|
|
46
46
|
"bip122:p2pkh": "bip122:p2pkh";
|
|
@@ -49,6 +49,7 @@ export declare const ImportPrivateKeyFormatStruct: import("@metamask/superstruct
|
|
|
49
49
|
"bip122:p2tr": "bip122:p2tr";
|
|
50
50
|
"solana:data-account": "solana:data-account";
|
|
51
51
|
"tron:eoa": "tron:eoa";
|
|
52
|
+
"stellar:account": "stellar:account";
|
|
52
53
|
"any:account": "any:account";
|
|
53
54
|
}>;
|
|
54
55
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../src/v2/api/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,kBAAkB;IAC5B;;OAEG;IACH,WAAW,gBAAgB;IAE3B;;OAEG;IACH,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;EAGnC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;;IACvC;;OAEG;;;;;IAGH;;;;;;OAMG;;;;;;;;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEhF;;GAEG;AACH,eAAO,MAAM,4BAA4B;;;IACvC;;OAEG;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
|