@metamask/keyring-api 23.4.0 → 23.6.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 +27 -1
- package/dist/api/account-options.cjs +3 -3
- package/dist/api/account-options.cjs.map +1 -1
- package/dist/api/account-options.d.cts.map +1 -1
- package/dist/api/account-options.d.mts.map +1 -1
- package/dist/api/account-options.mjs +2 -2
- package/dist/api/account-options.mjs.map +1 -1
- package/dist/api/account.cjs +1 -1
- package/dist/api/account.cjs.map +1 -1
- package/dist/api/account.mjs +2 -2
- package/dist/api/account.mjs.map +1 -1
- package/dist/api/asset.cjs +3 -3
- package/dist/api/asset.cjs.map +1 -1
- package/dist/api/asset.d.cts.map +1 -1
- package/dist/api/asset.d.mts.map +1 -1
- package/dist/api/asset.mjs +2 -2
- package/dist/api/asset.mjs.map +1 -1
- package/dist/api/balance.cjs +1 -1
- package/dist/api/balance.cjs.map +1 -1
- package/dist/api/balance.mjs +2 -2
- package/dist/api/balance.mjs.map +1 -1
- package/dist/api/options.cjs +3 -2
- package/dist/api/options.cjs.map +1 -1
- package/dist/api/options.d.cts +1 -1
- package/dist/api/options.d.cts.map +1 -1
- package/dist/api/options.d.mts +1 -1
- package/dist/api/options.d.mts.map +1 -1
- package/dist/api/options.mjs +2 -1
- package/dist/api/options.mjs.map +1 -1
- package/dist/api/pagination.cjs +2 -3
- package/dist/api/pagination.cjs.map +1 -1
- package/dist/api/pagination.d.cts +1 -1
- package/dist/api/pagination.d.cts.map +1 -1
- package/dist/api/pagination.d.mts +1 -1
- package/dist/api/pagination.d.mts.map +1 -1
- package/dist/api/pagination.mjs +1 -2
- package/dist/api/pagination.mjs.map +1 -1
- package/dist/api/request.cjs +3 -3
- package/dist/api/request.cjs.map +1 -1
- package/dist/api/request.d.cts +1 -1
- package/dist/api/request.d.cts.map +1 -1
- package/dist/api/request.d.mts +1 -1
- package/dist/api/request.d.mts.map +1 -1
- package/dist/api/request.mjs +2 -2
- package/dist/api/request.mjs.map +1 -1
- package/dist/api/response.cjs +5 -6
- package/dist/api/response.cjs.map +1 -1
- package/dist/api/response.d.cts.map +1 -1
- package/dist/api/response.d.mts.map +1 -1
- package/dist/api/response.mjs +1 -2
- package/dist/api/response.mjs.map +1 -1
- package/dist/api/transaction.cjs +10 -10
- package/dist/api/transaction.cjs.map +1 -1
- package/dist/api/transaction.d.cts +11 -11
- package/dist/api/transaction.d.cts.map +1 -1
- package/dist/api/transaction.d.mts +11 -11
- package/dist/api/transaction.d.mts.map +1 -1
- package/dist/api/transaction.mjs +2 -2
- package/dist/api/transaction.mjs.map +1 -1
- package/dist/btc/types.cjs +5 -6
- package/dist/btc/types.cjs.map +1 -1
- package/dist/btc/types.d.cts.map +1 -1
- package/dist/btc/types.d.mts.map +1 -1
- package/dist/btc/types.mjs +1 -2
- package/dist/btc/types.mjs.map +1 -1
- package/dist/eth/erc4337/types.cjs +9 -8
- package/dist/eth/erc4337/types.cjs.map +1 -1
- package/dist/eth/erc4337/types.d.cts +4 -4
- package/dist/eth/erc4337/types.d.cts.map +1 -1
- package/dist/eth/erc4337/types.d.mts +4 -4
- package/dist/eth/erc4337/types.d.mts.map +1 -1
- package/dist/eth/erc4337/types.mjs +2 -1
- package/dist/eth/erc4337/types.mjs.map +1 -1
- package/dist/eth/rpc/params.cjs +4 -5
- package/dist/eth/rpc/params.cjs.map +1 -1
- package/dist/eth/rpc/params.d.cts.map +1 -1
- package/dist/eth/rpc/params.d.mts.map +1 -1
- package/dist/eth/rpc/params.mjs +1 -2
- package/dist/eth/rpc/params.mjs.map +1 -1
- package/dist/eth/types.cjs +4 -5
- package/dist/eth/types.cjs.map +1 -1
- package/dist/eth/types.d.cts +1 -1
- package/dist/eth/types.d.cts.map +1 -1
- package/dist/eth/types.d.mts +1 -1
- package/dist/eth/types.d.mts.map +1 -1
- package/dist/eth/types.mjs +2 -3
- package/dist/eth/types.mjs.map +1 -1
- package/dist/events.cjs +20 -20
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +4 -4
- package/dist/events.d.cts.map +1 -1
- package/dist/events.d.mts +4 -4
- package/dist/events.d.mts.map +1 -1
- package/dist/events.mjs +2 -2
- package/dist/events.mjs.map +1 -1
- package/dist/rpc.cjs +36 -36
- package/dist/rpc.cjs.map +1 -1
- package/dist/rpc.d.cts +12 -12
- package/dist/rpc.d.cts.map +1 -1
- package/dist/rpc.d.mts +12 -12
- package/dist/rpc.d.mts.map +1 -1
- package/dist/rpc.mjs +2 -2
- package/dist/rpc.mjs.map +1 -1
- package/dist/sol/types.cjs +1 -2
- package/dist/sol/types.cjs.map +1 -1
- package/dist/sol/types.d.cts.map +1 -1
- package/dist/sol/types.d.mts.map +1 -1
- package/dist/sol/types.mjs +1 -2
- package/dist/sol/types.mjs.map +1 -1
- package/dist/trx/types.cjs +1 -2
- package/dist/trx/types.cjs.map +1 -1
- package/dist/trx/types.d.cts.map +1 -1
- package/dist/trx/types.d.mts.map +1 -1
- package/dist/trx/types.mjs +1 -2
- package/dist/trx/types.mjs.map +1 -1
- package/dist/v2/api/create-account/index.d.cts +1 -1
- package/dist/v2/api/create-account/index.d.mts +1 -1
- package/dist/v2/api/create-account/private-key.cjs +1 -1
- package/dist/v2/api/create-account/private-key.cjs.map +1 -1
- package/dist/v2/api/create-account/private-key.d.cts +3 -2
- package/dist/v2/api/create-account/private-key.d.cts.map +1 -1
- package/dist/v2/api/create-account/private-key.d.mts +3 -2
- package/dist/v2/api/create-account/private-key.d.mts.map +1 -1
- package/dist/v2/api/create-account/private-key.mjs +2 -2
- package/dist/v2/api/create-account/private-key.mjs.map +1 -1
- package/dist/v2/api/export-account/index.d.cts +9 -4
- package/dist/v2/api/export-account/index.d.cts.map +1 -1
- package/dist/v2/api/export-account/index.d.mts +9 -4
- package/dist/v2/api/export-account/index.d.mts.map +1 -1
- package/dist/v2/api/export-account/private-key.cjs +1 -1
- package/dist/v2/api/export-account/private-key.cjs.map +1 -1
- package/dist/v2/api/export-account/private-key.d.cts +6 -4
- package/dist/v2/api/export-account/private-key.d.cts.map +1 -1
- package/dist/v2/api/export-account/private-key.d.mts +6 -4
- package/dist/v2/api/export-account/private-key.d.mts.map +1 -1
- package/dist/v2/api/export-account/private-key.mjs +2 -2
- package/dist/v2/api/export-account/private-key.mjs.map +1 -1
- package/dist/v2/api/keyring-capabilities.cjs +5 -0
- package/dist/v2/api/keyring-capabilities.cjs.map +1 -1
- package/dist/v2/api/keyring-capabilities.d.cts +19 -10
- package/dist/v2/api/keyring-capabilities.d.cts.map +1 -1
- package/dist/v2/api/keyring-capabilities.d.mts +19 -10
- package/dist/v2/api/keyring-capabilities.d.mts.map +1 -1
- package/dist/v2/api/keyring-capabilities.mjs +5 -0
- package/dist/v2/api/keyring-capabilities.mjs.map +1 -1
- package/dist/v2/api/keyring-rpc.cjs +10 -10
- package/dist/v2/api/keyring-rpc.cjs.map +1 -1
- package/dist/v2/api/keyring-rpc.d.cts +12 -10
- package/dist/v2/api/keyring-rpc.d.cts.map +1 -1
- package/dist/v2/api/keyring-rpc.d.mts +12 -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-snap-rpc.cjs +14 -1
- package/dist/v2/api/keyring-snap-rpc.cjs.map +1 -1
- package/dist/v2/api/keyring-snap-rpc.d.cts +62 -8
- package/dist/v2/api/keyring-snap-rpc.d.cts.map +1 -1
- package/dist/v2/api/keyring-snap-rpc.d.mts +62 -8
- package/dist/v2/api/keyring-snap-rpc.d.mts.map +1 -1
- package/dist/v2/api/keyring-snap-rpc.mjs +16 -3
- package/dist/v2/api/keyring-snap-rpc.mjs.map +1 -1
- package/dist/v2/api/private-key.cjs +5 -0
- package/dist/v2/api/private-key.cjs.map +1 -1
- package/dist/v2/api/private-key.d.cts +13 -6
- package/dist/v2/api/private-key.d.cts.map +1 -1
- package/dist/v2/api/private-key.d.mts +13 -6
- package/dist/v2/api/private-key.d.mts.map +1 -1
- package/dist/v2/api/private-key.mjs +5 -0
- package/dist/v2/api/private-key.mjs.map +1 -1
- package/dist/xlm/types.cjs +1 -2
- package/dist/xlm/types.cjs.map +1 -1
- package/dist/xlm/types.d.cts.map +1 -1
- package/dist/xlm/types.d.mts.map +1 -1
- package/dist/xlm/types.mjs +1 -2
- package/dist/xlm/types.mjs.map +1 -1
- package/package.json +3 -3
package/dist/trx/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAUnD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IACnB,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IAGnC,aAAa,kBAAkB;IAE/B,eAAe,oBAAoB;CACpC;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;IAE9B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
|
package/dist/trx/types.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { object } from "@metamask/
|
|
2
|
-
import { array, enums, literal, nonempty } from "@metamask/superstruct";
|
|
1
|
+
import { array, enums, literal, nonempty, object } from "@metamask/superstruct";
|
|
3
2
|
import { definePattern } from "@metamask/utils";
|
|
4
3
|
import { CaipChainIdStruct, KeyringAccountStruct, TrxAccountType } from "../api/index.mjs";
|
|
5
4
|
/**
|
package/dist/trx/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/trx/types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,8BAA8B;AAChF,OAAO,EAAE,aAAa,EAAE,wBAAwB;AAEhD,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,cAAc,EACf,yBAAe;AAEhB;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,aAAa,CAC3C,YAAY,EACZ,+BAA+B,CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,gDAAmC,CAAA;IAEnC,yCAAyC;IACzC,4CAA+B,CAAA;IAC/B,qCAAqC;IACrC,gDAAmC,CAAA;AACrC,CAAC,EARW,SAAS,KAAT,SAAS,QAQpB;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC;IACxC,GAAG,oBAAoB,CAAC,MAAM;IAC9B;;OAEG;IACH,OAAO,EAAE,gBAAgB;IACzB;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC;IACtC;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC1C;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;CAChD,CAAC,CAAC","sourcesContent":["import type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal, nonempty, object } from '@metamask/superstruct';\nimport { definePattern } from '@metamask/utils';\n\nimport {\n CaipChainIdStruct,\n KeyringAccountStruct,\n TrxAccountType,\n} from '../api';\n\n/**\n * TRON addresses are Base58-encoded strings that are exactly 34 characters long\n * and start with the letter 'T'.\n */\nexport const TrxAddressStruct = definePattern(\n 'TrxAddress',\n /^T[1-9A-HJ-NP-Za-km-z]{33}$/iu,\n);\n\n/**\n * Supported TRON methods.\n */\nexport enum TrxMethod {\n SignMessage = 'signMessage',\n SignTransaction = 'signTransaction',\n\n // @deprecated Use `SignMessage` instead.\n SignMessageV2 = 'signMessageV2',\n // @deprecated Not supported anymore.\n VerifyMessageV2 = 'verifyMessageV2',\n}\n\nexport const TrxEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n /**\n * Account address.\n */\n address: TrxAddressStruct,\n /**\n * Account type.\n */\n type: literal(`${TrxAccountType.Eoa}`),\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n /**\n * Account supported methods.\n */\n methods: array(enums(Object.values(TrxMethod))),\n});\n\nexport type TrxEoaAccount = Infer<typeof TrxEoaAccountStruct>;\n"]}
|
|
@@ -72,7 +72,7 @@ export declare const CreateAccountOptionsStruct: import("@metamask/superstruct")
|
|
|
72
72
|
type: "custom";
|
|
73
73
|
} | {
|
|
74
74
|
type: "private-key:import";
|
|
75
|
-
encoding: "hexadecimal" | "base58";
|
|
75
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
76
76
|
privateKey: string;
|
|
77
77
|
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
78
78
|
}, null>;
|
|
@@ -72,7 +72,7 @@ export declare const CreateAccountOptionsStruct: import("@metamask/superstruct")
|
|
|
72
72
|
type: "custom";
|
|
73
73
|
} | {
|
|
74
74
|
type: "private-key:import";
|
|
75
|
-
encoding: "hexadecimal" | "base58";
|
|
75
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
76
76
|
privateKey: string;
|
|
77
77
|
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
78
78
|
}, null>;
|
|
@@ -15,7 +15,7 @@ exports.CreateAccountPrivateKeyOptionsStruct = (0, superstruct_1.object)({
|
|
|
15
15
|
/**
|
|
16
16
|
* The encoded private key to be imported.
|
|
17
17
|
*/
|
|
18
|
-
privateKey: (0, superstruct_1.string)(),
|
|
18
|
+
privateKey: (0, superstruct_1.sensitive)((0, superstruct_1.string)()),
|
|
19
19
|
/**
|
|
20
20
|
* The encoding of the private key.
|
|
21
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAM+B;AAG/B,sDAAgE;AAChE,oDAA0D;AAE1D;;GAEG;AACU,QAAA,oCAAoC,GAAG,IAAA,oBAAM,EAAC;IACzD;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,oBAAoB,CAAC;IACnC;;OAEG;IACH,UAAU,EAAE,IAAA,uBAAS,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,sCAAwB;IAClC;;OAEG;IACH,WAAW,EAAE,IAAA,2BAAa,EAAC,kCAAwB,CAAC;CACrD,CAAC,CAAC","sourcesContent":["import {\n exactOptional,\n literal,\n object,\n sensitive,\n string,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../../api/account';\nimport { PrivateKeyEncodingStruct } from '../private-key';\n\n/**\n * Struct for {@link CreateAccountPrivateKeyOptions}.\n */\nexport const CreateAccountPrivateKeyOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('private-key:import'),\n /**\n * The encoded private key to be imported.\n */\n privateKey: sensitive(string()),\n /**\n * The encoding of the private key.\n */\n encoding: PrivateKeyEncodingStruct,\n /**\n * The account type of the imported account.\n */\n accountType: exactOptional(KeyringAccountTypeStruct),\n});\n\n/**\n * Options for importing an account from a private key.\n */\nexport type CreateAccountPrivateKeyOptions = Infer<\n typeof CreateAccountPrivateKeyOptionsStruct\n>;\n"]}
|
|
@@ -4,7 +4,7 @@ import type { Infer } from "@metamask/superstruct";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const CreateAccountPrivateKeyOptionsStruct: import("@metamask/superstruct").Struct<{
|
|
6
6
|
type: "private-key:import";
|
|
7
|
-
encoding: "hexadecimal" | "base58";
|
|
7
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
8
8
|
privateKey: string;
|
|
9
9
|
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
10
10
|
}, {
|
|
@@ -19,9 +19,10 @@ export declare const CreateAccountPrivateKeyOptionsStruct: import("@metamask/sup
|
|
|
19
19
|
/**
|
|
20
20
|
* The encoding of the private key.
|
|
21
21
|
*/
|
|
22
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
22
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
23
23
|
hexadecimal: "hexadecimal";
|
|
24
24
|
base58: "base58";
|
|
25
|
+
base32: "base32";
|
|
25
26
|
}>;
|
|
26
27
|
/**
|
|
27
28
|
* The account type of the imported account.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;IAC/C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { Infer } from "@metamask/superstruct";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const CreateAccountPrivateKeyOptionsStruct: import("@metamask/superstruct").Struct<{
|
|
6
6
|
type: "private-key:import";
|
|
7
|
-
encoding: "hexadecimal" | "base58";
|
|
7
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
8
8
|
privateKey: string;
|
|
9
9
|
accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
10
10
|
}, {
|
|
@@ -19,9 +19,10 @@ export declare const CreateAccountPrivateKeyOptionsStruct: import("@metamask/sup
|
|
|
19
19
|
/**
|
|
20
20
|
* The encoding of the private key.
|
|
21
21
|
*/
|
|
22
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
22
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
23
23
|
hexadecimal: "hexadecimal";
|
|
24
24
|
base58: "base58";
|
|
25
|
+
base32: "base32";
|
|
25
26
|
}>;
|
|
26
27
|
/**
|
|
27
28
|
* The account type of the imported account.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;;;IAC/C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;IAEH;;OAEG;;;;;;;;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { exactOptional, literal, object, string } from "@metamask/superstruct";
|
|
1
|
+
import { exactOptional, literal, object, sensitive, string } from "@metamask/superstruct";
|
|
2
2
|
import { KeyringAccountTypeStruct } from "../../../api/account.mjs";
|
|
3
3
|
import { PrivateKeyEncodingStruct } from "../private-key.mjs";
|
|
4
4
|
/**
|
|
@@ -12,7 +12,7 @@ export const CreateAccountPrivateKeyOptionsStruct = object({
|
|
|
12
12
|
/**
|
|
13
13
|
* The encoded private key to be imported.
|
|
14
14
|
*/
|
|
15
|
-
privateKey: string(),
|
|
15
|
+
privateKey: sensitive(string()),
|
|
16
16
|
/**
|
|
17
17
|
* The encoding of the private key.
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/v2/api/create-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,OAAO,EACP,MAAM,EACN,SAAS,EACT,MAAM,EACP,8BAA8B;AAG/B,OAAO,EAAE,wBAAwB,EAAE,iCAA6B;AAChE,OAAO,EAAE,wBAAwB,EAAE,2BAAuB;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAC;IACzD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC;IACnC;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,wBAAwB;IAClC;;OAEG;IACH,WAAW,EAAE,aAAa,CAAC,wBAAwB,CAAC;CACrD,CAAC,CAAC","sourcesContent":["import {\n exactOptional,\n literal,\n object,\n sensitive,\n string,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../../api/account';\nimport { PrivateKeyEncodingStruct } from '../private-key';\n\n/**\n * Struct for {@link CreateAccountPrivateKeyOptions}.\n */\nexport const CreateAccountPrivateKeyOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('private-key:import'),\n /**\n * The encoded private key to be imported.\n */\n privateKey: sensitive(string()),\n /**\n * The encoding of the private key.\n */\n encoding: PrivateKeyEncodingStruct,\n /**\n * The account type of the imported account.\n */\n accountType: exactOptional(KeyringAccountTypeStruct),\n});\n\n/**\n * Options for importing an account from a private key.\n */\nexport type CreateAccountPrivateKeyOptions = Infer<\n typeof CreateAccountPrivateKeyOptionsStruct\n>;\n"]}
|
|
@@ -14,12 +14,13 @@ export declare enum AccountExportType {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const ExportAccountOptionsStruct: import("@metamask/superstruct").Struct<{
|
|
16
16
|
type: "private-key";
|
|
17
|
-
encoding: "hexadecimal" | "base58";
|
|
17
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
18
18
|
}, {
|
|
19
19
|
type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
|
|
20
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
20
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
21
21
|
hexadecimal: "hexadecimal";
|
|
22
22
|
base58: "base58";
|
|
23
|
+
base32: "base32";
|
|
23
24
|
}>;
|
|
24
25
|
}>;
|
|
25
26
|
/**
|
|
@@ -31,14 +32,18 @@ export type ExportAccountOptions = Infer<typeof ExportAccountOptionsStruct>;
|
|
|
31
32
|
*/
|
|
32
33
|
export declare const ExportedAccountStruct: import("@metamask/superstruct").Struct<{
|
|
33
34
|
type: "private-key";
|
|
34
|
-
encoding: "hexadecimal" | "base58";
|
|
35
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
35
36
|
privateKey: string;
|
|
36
37
|
}, {
|
|
38
|
+
/**
|
|
39
|
+
* Export account as a private key.
|
|
40
|
+
*/
|
|
37
41
|
type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
|
|
38
42
|
privateKey: import("@metamask/superstruct").Struct<string, null>;
|
|
39
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
43
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
40
44
|
hexadecimal: "hexadecimal";
|
|
41
45
|
base58: "base58";
|
|
46
|
+
base32: "base32";
|
|
42
47
|
}>;
|
|
43
48
|
}>;
|
|
44
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,UAAU,gBAAgB;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,UAAU,gBAAgB;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;EAAuC,CAAC;AAE/E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;IAnBhC;;OAEG;;;;;;;;EAiB+D,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -14,12 +14,13 @@ export declare enum AccountExportType {
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const ExportAccountOptionsStruct: import("@metamask/superstruct").Struct<{
|
|
16
16
|
type: "private-key";
|
|
17
|
-
encoding: "hexadecimal" | "base58";
|
|
17
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
18
18
|
}, {
|
|
19
19
|
type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
|
|
20
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
20
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
21
21
|
hexadecimal: "hexadecimal";
|
|
22
22
|
base58: "base58";
|
|
23
|
+
base32: "base32";
|
|
23
24
|
}>;
|
|
24
25
|
}>;
|
|
25
26
|
/**
|
|
@@ -31,14 +32,18 @@ export type ExportAccountOptions = Infer<typeof ExportAccountOptionsStruct>;
|
|
|
31
32
|
*/
|
|
32
33
|
export declare const ExportedAccountStruct: import("@metamask/superstruct").Struct<{
|
|
33
34
|
type: "private-key";
|
|
34
|
-
encoding: "hexadecimal" | "base58";
|
|
35
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
35
36
|
privateKey: string;
|
|
36
37
|
}, {
|
|
38
|
+
/**
|
|
39
|
+
* Export account as a private key.
|
|
40
|
+
*/
|
|
37
41
|
type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
|
|
38
42
|
privateKey: import("@metamask/superstruct").Struct<string, null>;
|
|
39
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
43
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
40
44
|
hexadecimal: "hexadecimal";
|
|
41
45
|
base58: "base58";
|
|
46
|
+
base32: "base32";
|
|
42
47
|
}>;
|
|
43
48
|
}>;
|
|
44
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,UAAU,gBAAgB;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAOnD,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,iBAAiB;IAC3B;;OAEG;IACH,UAAU,gBAAgB;CAC3B;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;EAAuC,CAAC;AAE/E;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE5E;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;IAnBhC;;OAEG;;;;;;;;EAiB+D,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
|
|
@@ -14,7 +14,7 @@ exports.PrivateKeyExportedAccountStruct = (0, superstruct_1.object)({
|
|
|
14
14
|
/**
|
|
15
15
|
* The private key of the exported account.
|
|
16
16
|
*/
|
|
17
|
-
privateKey: (0, superstruct_1.string)(),
|
|
17
|
+
privateKey: (0, superstruct_1.sensitive)((0, superstruct_1.string)()),
|
|
18
18
|
/**
|
|
19
19
|
* The encoding of the exported private key.
|
|
20
20
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAA2E;AAG3E,oDAA0D;AAE1D;;GAEG;AACU,QAAA,+BAA+B,GAAG,IAAA,oBAAM,EAAC;IACpD;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,UAAU,EAAE,IAAA,uBAAS,EAAC,IAAA,oBAAM,GAAE,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,sCAAwB;CACnC,CAAC,CAAC;AASH;;GAEG;AACU,QAAA,oCAAoC,GAAG,IAAA,oBAAM,EAAC;IACzD;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,sCAAwB;CACnC,CAAC,CAAC","sourcesContent":["import { object, sensitive, literal, string } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { PrivateKeyEncodingStruct } from '../private-key';\n\n/**\n * Struct for {@link PrivateKeyExportedAccount}.\n */\nexport const PrivateKeyExportedAccountStruct = object({\n /**\n * The type of the account export.\n */\n type: literal('private-key'),\n /**\n * The private key of the exported account.\n */\n privateKey: sensitive(string()),\n /**\n * The encoding of the exported private key.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Represents an account that has been exported using a private key.\n */\nexport type PrivateKeyExportedAccount = Infer<\n typeof PrivateKeyExportedAccountStruct\n>;\n\n/**\n * Struct for {@link ExportAccountPrivateKeyOptions}.\n */\nexport const ExportAccountPrivateKeyOptionsStruct = object({\n /**\n * The type of the account export.\n */\n type: literal('private-key'),\n /**\n * The encoding of the exported private key.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Options for exporting an account's private key.\n */\nexport type ExportAccountPrivateKeyOptions = Infer<\n typeof ExportAccountPrivateKeyOptionsStruct\n>;\n"]}
|
|
@@ -4,7 +4,7 @@ import type { Infer } from "@metamask/superstruct";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const PrivateKeyExportedAccountStruct: import("@metamask/superstruct").Struct<{
|
|
6
6
|
type: "private-key";
|
|
7
|
-
encoding: "hexadecimal" | "base58";
|
|
7
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
8
8
|
privateKey: string;
|
|
9
9
|
}, {
|
|
10
10
|
/**
|
|
@@ -18,9 +18,10 @@ export declare const PrivateKeyExportedAccountStruct: import("@metamask/superstr
|
|
|
18
18
|
/**
|
|
19
19
|
* The encoding of the exported private key.
|
|
20
20
|
*/
|
|
21
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
21
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
22
22
|
hexadecimal: "hexadecimal";
|
|
23
23
|
base58: "base58";
|
|
24
|
+
base32: "base32";
|
|
24
25
|
}>;
|
|
25
26
|
}>;
|
|
26
27
|
/**
|
|
@@ -32,7 +33,7 @@ export type PrivateKeyExportedAccount = Infer<typeof PrivateKeyExportedAccountSt
|
|
|
32
33
|
*/
|
|
33
34
|
export declare const ExportAccountPrivateKeyOptionsStruct: import("@metamask/superstruct").Struct<{
|
|
34
35
|
type: "private-key";
|
|
35
|
-
encoding: "hexadecimal" | "base58";
|
|
36
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
36
37
|
}, {
|
|
37
38
|
/**
|
|
38
39
|
* The type of the account export.
|
|
@@ -41,9 +42,10 @@ export declare const ExportAccountPrivateKeyOptionsStruct: import("@metamask/sup
|
|
|
41
42
|
/**
|
|
42
43
|
* The encoding of the exported private key.
|
|
43
44
|
*/
|
|
44
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
45
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
45
46
|
hexadecimal: "hexadecimal";
|
|
46
47
|
base58: "base58";
|
|
48
|
+
base32: "base32";
|
|
47
49
|
}>;
|
|
48
50
|
}>;
|
|
49
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;IAC1C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG
|
|
1
|
+
{"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;IAC1C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;IAC/C;;OAEG;;IAEH;;OAEG;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -4,7 +4,7 @@ import type { Infer } from "@metamask/superstruct";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const PrivateKeyExportedAccountStruct: import("@metamask/superstruct").Struct<{
|
|
6
6
|
type: "private-key";
|
|
7
|
-
encoding: "hexadecimal" | "base58";
|
|
7
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
8
8
|
privateKey: string;
|
|
9
9
|
}, {
|
|
10
10
|
/**
|
|
@@ -18,9 +18,10 @@ export declare const PrivateKeyExportedAccountStruct: import("@metamask/superstr
|
|
|
18
18
|
/**
|
|
19
19
|
* The encoding of the exported private key.
|
|
20
20
|
*/
|
|
21
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
21
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
22
22
|
hexadecimal: "hexadecimal";
|
|
23
23
|
base58: "base58";
|
|
24
|
+
base32: "base32";
|
|
24
25
|
}>;
|
|
25
26
|
}>;
|
|
26
27
|
/**
|
|
@@ -32,7 +33,7 @@ export type PrivateKeyExportedAccount = Infer<typeof PrivateKeyExportedAccountSt
|
|
|
32
33
|
*/
|
|
33
34
|
export declare const ExportAccountPrivateKeyOptionsStruct: import("@metamask/superstruct").Struct<{
|
|
34
35
|
type: "private-key";
|
|
35
|
-
encoding: "hexadecimal" | "base58";
|
|
36
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
36
37
|
}, {
|
|
37
38
|
/**
|
|
38
39
|
* The type of the account export.
|
|
@@ -41,9 +42,10 @@ export declare const ExportAccountPrivateKeyOptionsStruct: import("@metamask/sup
|
|
|
41
42
|
/**
|
|
42
43
|
* The encoding of the exported private key.
|
|
43
44
|
*/
|
|
44
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
45
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
45
46
|
hexadecimal: "hexadecimal";
|
|
46
47
|
base58: "base58";
|
|
48
|
+
base32: "base32";
|
|
47
49
|
}>;
|
|
48
50
|
}>;
|
|
49
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;IAC1C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG
|
|
1
|
+
{"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,eAAO,MAAM,+BAA+B;;;;;IAC1C;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oCAAoC;;;;IAC/C;;OAEG;;IAEH;;OAEG;;;;;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,8BAA8B,GAAG,KAAK,CAChD,OAAO,oCAAoC,CAC5C,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { object, sensitive, literal, string } from "@metamask/superstruct";
|
|
2
2
|
import { PrivateKeyEncodingStruct } from "../private-key.mjs";
|
|
3
3
|
/**
|
|
4
4
|
* Struct for {@link PrivateKeyExportedAccount}.
|
|
@@ -11,7 +11,7 @@ export const PrivateKeyExportedAccountStruct = object({
|
|
|
11
11
|
/**
|
|
12
12
|
* The private key of the exported account.
|
|
13
13
|
*/
|
|
14
|
-
privateKey: string(),
|
|
14
|
+
privateKey: sensitive(string()),
|
|
15
15
|
/**
|
|
16
16
|
* The encoding of the exported private key.
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/v2/api/export-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,8BAA8B;AAG3E,OAAO,EAAE,wBAAwB,EAAE,2BAAuB;AAE1D;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;IACpD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,CAAC;IAC/B;;OAEG;IACH,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC;AASH;;GAEG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAC;IACzD;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC;IAC5B;;OAEG;IACH,QAAQ,EAAE,wBAAwB;CACnC,CAAC,CAAC","sourcesContent":["import { object, sensitive, literal, string } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\nimport { PrivateKeyEncodingStruct } from '../private-key';\n\n/**\n * Struct for {@link PrivateKeyExportedAccount}.\n */\nexport const PrivateKeyExportedAccountStruct = object({\n /**\n * The type of the account export.\n */\n type: literal('private-key'),\n /**\n * The private key of the exported account.\n */\n privateKey: sensitive(string()),\n /**\n * The encoding of the exported private key.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Represents an account that has been exported using a private key.\n */\nexport type PrivateKeyExportedAccount = Infer<\n typeof PrivateKeyExportedAccountStruct\n>;\n\n/**\n * Struct for {@link ExportAccountPrivateKeyOptions}.\n */\nexport const ExportAccountPrivateKeyOptionsStruct = object({\n /**\n * The type of the account export.\n */\n type: literal('private-key'),\n /**\n * The encoding of the exported private key.\n */\n encoding: PrivateKeyEncodingStruct,\n});\n\n/**\n * Options for exporting an account's private key.\n */\nexport type ExportAccountPrivateKeyOptions = Infer<\n typeof ExportAccountPrivateKeyOptionsStruct\n>;\n"]}
|
|
@@ -87,6 +87,11 @@ exports.KeyringCapabilitiesStruct = (0, superstruct_1.object)({
|
|
|
87
87
|
* (`keyring_setSelectedAccounts`).
|
|
88
88
|
*/
|
|
89
89
|
selectedAccounts: (0, superstruct_1.exactOptional)((0, superstruct_1.boolean)()),
|
|
90
|
+
/**
|
|
91
|
+
* Whether the keyring supports resolving the account address to use for
|
|
92
|
+
* routing a signing request (`keyring_resolveAccountAddress`).
|
|
93
|
+
*/
|
|
94
|
+
resolveAccountAddress: (0, superstruct_1.exactOptional)((0, superstruct_1.boolean)()),
|
|
90
95
|
})),
|
|
91
96
|
});
|
|
92
97
|
//# sourceMappingURL=keyring-capabilities.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-capabilities.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":";;;AAAA,uDAO+B;AAG/B,6CAAmD;AACnD,mDAGuB;AAEvB;;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;IACD;;;;OAIG;IACH,IAAI,EAAE,IAAA,2BAAa,EACjB,IAAA,oBAAM,EAAC;QACL;;WAEG;QACH,MAAM,EAAE,IAAA,2BAAa,EACnB,IAAA,oBAAM,EAAC;YACL;;;eAGG;YACH,QAAQ,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;YAClC;;;eAGG;YACH,QAAQ,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;SACnC,CAAC,CACH;QACD;;;WAGG;QACH,YAAY,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QACtC;;;WAGG;QACH,gBAAgB,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.cjs","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":";;;AAAA,uDAO+B;AAG/B,6CAAmD;AACnD,mDAGuB;AAEvB;;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;IACD;;;;OAIG;IACH,IAAI,EAAE,IAAA,2BAAa,EACjB,IAAA,oBAAM,EAAC;QACL;;WAEG;QACH,MAAM,EAAE,IAAA,2BAAa,EACnB,IAAA,oBAAM,EAAC;YACL;;;eAGG;YACH,QAAQ,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;YAClC;;;eAGG;YACH,QAAQ,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;SACnC,CAAC,CACH;QACD;;;WAGG;QACH,YAAY,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QACtC;;;WAGG;QACH,gBAAgB,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;QAC1C;;;WAGG;QACH,qBAAqB,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;KAChD,CAAC,CACH;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 * Snap-specific capabilities supported by this keyring.\n *\n * Each flag maps to a Snap keyring RPC method that the Snap implements.\n */\n snap: exactOptional(\n object({\n /**\n * Asset-related capabilities.\n */\n assets: exactOptional(\n object({\n /**\n * Whether the keyring supports getting account assets\n * (`keyring_getAccountAssets`).\n */\n metadata: exactOptional(boolean()),\n /**\n * Whether the keyring supports getting account balances\n * (`keyring_getAccountBalances`).\n */\n balances: exactOptional(boolean()),\n }),\n ),\n /**\n * Whether the keyring supports getting account transactions\n * (`keyring_getAccountTransactions`).\n */\n transactions: exactOptional(boolean()),\n /**\n * Whether the keyring supports receiving selected accounts notifications\n * (`keyring_setSelectedAccounts`).\n */\n selectedAccounts: exactOptional(boolean()),\n /**\n * Whether the keyring supports resolving the account address to use for\n * routing a signing request (`keyring_resolveAccountAddress`).\n */\n resolveAccountAddress: exactOptional(boolean()),\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"]}
|
|
@@ -15,11 +15,11 @@ export declare const KeyringCapabilitiesStruct: import("@metamask/superstruct").
|
|
|
15
15
|
};
|
|
16
16
|
privateKey?: {
|
|
17
17
|
importFormats?: {
|
|
18
|
-
encoding: "hexadecimal" | "base58";
|
|
18
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
19
19
|
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
20
20
|
}[];
|
|
21
21
|
exportFormats?: {
|
|
22
|
-
encoding: "hexadecimal" | "base58";
|
|
22
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
23
23
|
}[];
|
|
24
24
|
};
|
|
25
25
|
snap?: {
|
|
@@ -29,6 +29,7 @@ export declare const KeyringCapabilitiesStruct: import("@metamask/superstruct").
|
|
|
29
29
|
};
|
|
30
30
|
transactions?: boolean;
|
|
31
31
|
selectedAccounts?: boolean;
|
|
32
|
+
resolveAccountAddress?: boolean;
|
|
32
33
|
};
|
|
33
34
|
}, {
|
|
34
35
|
/**
|
|
@@ -66,26 +67,27 @@ export declare const KeyringCapabilitiesStruct: import("@metamask/superstruct").
|
|
|
66
67
|
*/
|
|
67
68
|
privateKey: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
68
69
|
importFormats?: {
|
|
69
|
-
encoding: "hexadecimal" | "base58";
|
|
70
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
70
71
|
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
71
72
|
}[];
|
|
72
73
|
exportFormats?: {
|
|
73
|
-
encoding: "hexadecimal" | "base58";
|
|
74
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
74
75
|
}[];
|
|
75
76
|
}, {
|
|
76
77
|
/**
|
|
77
78
|
* List of supported formats for importing private keys.
|
|
78
79
|
*/
|
|
79
80
|
importFormats: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
80
|
-
encoding: "hexadecimal" | "base58";
|
|
81
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
81
82
|
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
82
83
|
}[], import("@metamask/superstruct").Struct<{
|
|
83
|
-
encoding: "hexadecimal" | "base58";
|
|
84
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
84
85
|
type?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "stellar:account" | "any:account";
|
|
85
86
|
}, {
|
|
86
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
87
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
87
88
|
hexadecimal: "hexadecimal";
|
|
88
89
|
base58: "base58";
|
|
90
|
+
base32: "base32";
|
|
89
91
|
}>;
|
|
90
92
|
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", {
|
|
91
93
|
"eip155:eoa": "eip155:eoa";
|
|
@@ -104,13 +106,14 @@ export declare const KeyringCapabilitiesStruct: import("@metamask/superstruct").
|
|
|
104
106
|
* List of supported formats for exporting private keys.
|
|
105
107
|
*/
|
|
106
108
|
exportFormats: import("@metamask/superstruct").ExactOptionalStruct<{
|
|
107
|
-
encoding: "hexadecimal" | "base58";
|
|
109
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
108
110
|
}[], import("@metamask/superstruct").Struct<{
|
|
109
|
-
encoding: "hexadecimal" | "base58";
|
|
111
|
+
encoding: "hexadecimal" | "base58" | "base32";
|
|
110
112
|
}, {
|
|
111
|
-
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
|
|
113
|
+
encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58" | "base32", {
|
|
112
114
|
hexadecimal: "hexadecimal";
|
|
113
115
|
base58: "base58";
|
|
116
|
+
base32: "base32";
|
|
114
117
|
}>;
|
|
115
118
|
}>>;
|
|
116
119
|
}>;
|
|
@@ -138,6 +141,7 @@ export declare const KeyringCapabilitiesStruct: import("@metamask/superstruct").
|
|
|
138
141
|
};
|
|
139
142
|
transactions?: boolean;
|
|
140
143
|
selectedAccounts?: boolean;
|
|
144
|
+
resolveAccountAddress?: boolean;
|
|
141
145
|
}, {
|
|
142
146
|
/**
|
|
143
147
|
* Asset-related capabilities.
|
|
@@ -167,6 +171,11 @@ export declare const KeyringCapabilitiesStruct: import("@metamask/superstruct").
|
|
|
167
171
|
* (`keyring_setSelectedAccounts`).
|
|
168
172
|
*/
|
|
169
173
|
selectedAccounts: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
174
|
+
/**
|
|
175
|
+
* Whether the keyring supports resolving the account address to use for
|
|
176
|
+
* routing a signing request (`keyring_resolveAccountAddress`).
|
|
177
|
+
*/
|
|
178
|
+
resolveAccountAddress: import("@metamask/superstruct").ExactOptionalStruct<boolean, null>;
|
|
170
179
|
}>;
|
|
171
180
|
}>;
|
|
172
181
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyring-capabilities.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAQnD;;GAEG;AACH,eAAO,MAAM,yBAAyB
|
|
1
|
+
{"version":3,"file":"keyring-capabilities.d.cts","sourceRoot":"","sources":["../../../src/v2/api/keyring-capabilities.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAQnD;;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;;;;;;IAQH;;;;OAIG;;;;;;;;;;QAGC;;WAEG;;;;;YAGC;;;eAGG;;YAEH;;;eAGG;;;QAIP;;;WAGG;;QAEH;;;WAGG;;QAEH;;;WAGG;;;EAIP,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
|