@metamask/keyring-api 21.2.0 → 21.3.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.
Files changed (107) hide show
  1. package/CHANGELOG.md +14 -1
  2. package/README.md +7 -0
  3. package/dist/api/account.cjs +15 -1
  4. package/dist/api/account.cjs.map +1 -1
  5. package/dist/api/account.d.cts +14 -0
  6. package/dist/api/account.d.cts.map +1 -1
  7. package/dist/api/account.d.mts +14 -0
  8. package/dist/api/account.d.mts.map +1 -1
  9. package/dist/api/account.mjs +14 -0
  10. package/dist/api/account.mjs.map +1 -1
  11. package/dist/api/index.cjs +1 -0
  12. package/dist/api/index.cjs.map +1 -1
  13. package/dist/api/index.d.cts +1 -0
  14. package/dist/api/index.d.cts.map +1 -1
  15. package/dist/api/index.d.mts +1 -0
  16. package/dist/api/index.d.mts.map +1 -1
  17. package/dist/api/index.mjs +1 -0
  18. package/dist/api/index.mjs.map +1 -1
  19. package/dist/api/v2/create-account/bip44.cjs +57 -0
  20. package/dist/api/v2/create-account/bip44.cjs.map +1 -0
  21. package/dist/api/v2/create-account/bip44.d.cts +83 -0
  22. package/dist/api/v2/create-account/bip44.d.cts.map +1 -0
  23. package/dist/api/v2/create-account/bip44.d.mts +83 -0
  24. package/dist/api/v2/create-account/bip44.d.mts.map +1 -0
  25. package/dist/api/v2/create-account/bip44.mjs +54 -0
  26. package/dist/api/v2/create-account/bip44.mjs.map +1 -0
  27. package/dist/api/v2/create-account/index.cjs +72 -0
  28. package/dist/api/v2/create-account/index.cjs.map +1 -0
  29. package/dist/api/v2/create-account/index.d.cts +58 -0
  30. package/dist/api/v2/create-account/index.d.cts.map +1 -0
  31. package/dist/api/v2/create-account/index.d.mts +58 -0
  32. package/dist/api/v2/create-account/index.d.mts.map +1 -0
  33. package/dist/api/v2/create-account/index.mjs +55 -0
  34. package/dist/api/v2/create-account/index.mjs.map +1 -0
  35. package/dist/api/v2/create-account/private-key.cjs +28 -0
  36. package/dist/api/v2/create-account/private-key.cjs.map +1 -0
  37. package/dist/api/v2/create-account/private-key.d.cts +45 -0
  38. package/dist/api/v2/create-account/private-key.d.cts.map +1 -0
  39. package/dist/api/v2/create-account/private-key.d.mts +45 -0
  40. package/dist/api/v2/create-account/private-key.d.mts.map +1 -0
  41. package/dist/api/v2/create-account/private-key.mjs +25 -0
  42. package/dist/api/v2/create-account/private-key.mjs.map +1 -0
  43. package/dist/api/v2/export-account/index.cjs +38 -0
  44. package/dist/api/v2/export-account/index.cjs.map +1 -0
  45. package/dist/api/v2/export-account/index.d.cts +48 -0
  46. package/dist/api/v2/export-account/index.d.cts.map +1 -0
  47. package/dist/api/v2/export-account/index.d.mts +48 -0
  48. package/dist/api/v2/export-account/index.d.mts.map +1 -0
  49. package/dist/api/v2/export-account/index.mjs +21 -0
  50. package/dist/api/v2/export-account/index.mjs.map +1 -0
  51. package/dist/api/v2/export-account/private-key.cjs +36 -0
  52. package/dist/api/v2/export-account/private-key.cjs.map +1 -0
  53. package/dist/api/v2/export-account/private-key.d.cts +53 -0
  54. package/dist/api/v2/export-account/private-key.d.cts.map +1 -0
  55. package/dist/api/v2/export-account/private-key.d.mts +53 -0
  56. package/dist/api/v2/export-account/private-key.d.mts.map +1 -0
  57. package/dist/api/v2/export-account/private-key.mjs +33 -0
  58. package/dist/api/v2/export-account/private-key.mjs.map +1 -0
  59. package/dist/api/v2/index.cjs +22 -0
  60. package/dist/api/v2/index.cjs.map +1 -0
  61. package/dist/api/v2/index.d.cts +7 -0
  62. package/dist/api/v2/index.d.cts.map +1 -0
  63. package/dist/api/v2/index.d.mts +7 -0
  64. package/dist/api/v2/index.d.mts.map +1 -0
  65. package/dist/api/v2/index.mjs +6 -0
  66. package/dist/api/v2/index.mjs.map +1 -0
  67. package/dist/api/v2/keyring-capabilities.cjs +46 -0
  68. package/dist/api/v2/keyring-capabilities.cjs.map +1 -0
  69. package/dist/api/v2/keyring-capabilities.d.cts +128 -0
  70. package/dist/api/v2/keyring-capabilities.d.cts.map +1 -0
  71. package/dist/api/v2/keyring-capabilities.d.mts +128 -0
  72. package/dist/api/v2/keyring-capabilities.d.mts.map +1 -0
  73. package/dist/api/v2/keyring-capabilities.mjs +43 -0
  74. package/dist/api/v2/keyring-capabilities.mjs.map +1 -0
  75. package/dist/api/v2/keyring-type.cjs +44 -0
  76. package/dist/api/v2/keyring-type.cjs.map +1 -0
  77. package/dist/api/v2/keyring-type.d.cts +40 -0
  78. package/dist/api/v2/keyring-type.d.cts.map +1 -0
  79. package/dist/api/v2/keyring-type.d.mts +40 -0
  80. package/dist/api/v2/keyring-type.d.mts.map +1 -0
  81. package/dist/api/v2/keyring-type.mjs +41 -0
  82. package/dist/api/v2/keyring-type.mjs.map +1 -0
  83. package/dist/api/v2/keyring.cjs +3 -0
  84. package/dist/api/v2/keyring.cjs.map +1 -0
  85. package/dist/api/v2/keyring.d.cts +107 -0
  86. package/dist/api/v2/keyring.d.cts.map +1 -0
  87. package/dist/api/v2/keyring.d.mts +107 -0
  88. package/dist/api/v2/keyring.d.mts.map +1 -0
  89. package/dist/api/v2/keyring.mjs +2 -0
  90. package/dist/api/v2/keyring.mjs.map +1 -0
  91. package/dist/api/v2/private-key.cjs +53 -0
  92. package/dist/api/v2/private-key.cjs.map +1 -0
  93. package/dist/api/v2/private-key.d.cts +77 -0
  94. package/dist/api/v2/private-key.d.cts.map +1 -0
  95. package/dist/api/v2/private-key.d.mts +77 -0
  96. package/dist/api/v2/private-key.d.mts.map +1 -0
  97. package/dist/api/v2/private-key.mjs +50 -0
  98. package/dist/api/v2/private-key.mjs.map +1 -0
  99. package/dist/trx/types.cjs +4 -0
  100. package/dist/trx/types.cjs.map +1 -1
  101. package/dist/trx/types.d.cts +4 -0
  102. package/dist/trx/types.d.cts.map +1 -1
  103. package/dist/trx/types.d.mts +4 -0
  104. package/dist/trx/types.d.mts.map +1 -1
  105. package/dist/trx/types.mjs +4 -0
  106. package/dist/trx/types.mjs.map +1 -1
  107. package/package.json +1 -1
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.CreateAccountOptionsStruct = exports.AccountCreationType = void 0;
18
+ const keyring_utils_1 = require("@metamask/keyring-utils");
19
+ const bip44_1 = require("./bip44.cjs");
20
+ const private_key_1 = require("./private-key.cjs");
21
+ __exportStar(require("./bip44.cjs"), exports);
22
+ __exportStar(require("./private-key.cjs"), exports);
23
+ /**
24
+ * Enum representing the different ways an account can be created.
25
+ */
26
+ var AccountCreationType;
27
+ (function (AccountCreationType) {
28
+ /**
29
+ * Represents an account created using a BIP-44 derivation path.
30
+ */
31
+ AccountCreationType["Bip44DerivePath"] = "bip44:derive-path";
32
+ /**
33
+ * Represents accounts created using a BIP-44 account index.
34
+ *
35
+ * More than one account can be created, for example, the keyring can create
36
+ * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
37
+ * index.
38
+ */
39
+ AccountCreationType["Bip44DeriveIndex"] = "bip44:derive-index";
40
+ /**
41
+ * Represents accounts created through BIP-44 account discovery.
42
+ *
43
+ * More than one account can be created, for example, the keyring can create
44
+ * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
45
+ * index.
46
+ */
47
+ AccountCreationType["Bip44Discover"] = "bip44:discover";
48
+ /**
49
+ * Represents an account imported from a private key.
50
+ */
51
+ AccountCreationType["PrivateKeyImport"] = "private-key:import";
52
+ })(AccountCreationType || (exports.AccountCreationType = AccountCreationType = {}));
53
+ /**
54
+ * Struct for {@link CreateAccountOptions}.
55
+ */
56
+ exports.CreateAccountOptionsStruct = (0, keyring_utils_1.selectiveUnion)((value) => {
57
+ const accountCreationType = value?.type;
58
+ switch (accountCreationType) {
59
+ case AccountCreationType.Bip44DerivePath:
60
+ return bip44_1.CreateAccountBip44DerivePathOptionsStruct;
61
+ case AccountCreationType.Bip44DeriveIndex:
62
+ return bip44_1.CreateAccountBip44DeriveIndexOptionsStruct;
63
+ case AccountCreationType.Bip44Discover:
64
+ return bip44_1.CreateAccountBip44DiscoverOptionsStruct;
65
+ case AccountCreationType.PrivateKeyImport:
66
+ return private_key_1.CreateAccountPrivateKeyOptionsStruct;
67
+ default:
68
+ // Return first struct as fallback - validation will fail with proper error indicating the type mismatch
69
+ return bip44_1.CreateAccountBip44DerivePathOptionsStruct;
70
+ }
71
+ });
72
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2DAAyD;AAGzD,uCAIiB;AACjB,mDAAqE;AAErE,8CAAwB;AACxB,oDAA8B;AAE9B;;GAEG;AACH,IAAY,mBA4BX;AA5BD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,4DAAqC,CAAA;IAErC;;;;;;OAMG;IACH,8DAAuC,CAAA;IAEvC;;;;;;OAMG;IACH,uDAAgC,CAAA;IAEhC;;OAEG;IACH,8DAAuC,CAAA;AACzC,CAAC,EA5BW,mBAAmB,mCAAnB,mBAAmB,QA4B9B;AAED;;GAEG;AACU,QAAA,0BAA0B,GAAG,IAAA,8BAAc,EAAC,CAAC,KAAU,EAAE,EAAE;IACtE,MAAM,mBAAmB,GAAG,KAAK,EAAE,IAA2B,CAAC;IAC/D,QAAQ,mBAAmB,EAAE,CAAC;QAC5B,KAAK,mBAAmB,CAAC,eAAe;YACtC,OAAO,iDAAyC,CAAC;QACnD,KAAK,mBAAmB,CAAC,gBAAgB;YACvC,OAAO,kDAA0C,CAAC;QACpD,KAAK,mBAAmB,CAAC,aAAa;YACpC,OAAO,+CAAuC,CAAC;QACjD,KAAK,mBAAmB,CAAC,gBAAgB;YACvC,OAAO,kDAAoC,CAAC;QAC9C;YACE,wGAAwG;YACxG,OAAO,iDAAyC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { selectiveUnion } from '@metamask/keyring-utils';\nimport { type Infer } from '@metamask/superstruct';\n\nimport {\n CreateAccountBip44DiscoverOptionsStruct,\n CreateAccountBip44DeriveIndexOptionsStruct,\n CreateAccountBip44DerivePathOptionsStruct,\n} from './bip44';\nimport { CreateAccountPrivateKeyOptionsStruct } from './private-key';\n\nexport * from './bip44';\nexport * from './private-key';\n\n/**\n * Enum representing the different ways an account can be created.\n */\nexport enum AccountCreationType {\n /**\n * Represents an account created using a BIP-44 derivation path.\n */\n Bip44DerivePath = 'bip44:derive-path',\n\n /**\n * Represents accounts created using a BIP-44 account index.\n *\n * More than one account can be created, for example, the keyring can create\n * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account\n * index.\n */\n Bip44DeriveIndex = 'bip44:derive-index',\n\n /**\n * Represents accounts created through BIP-44 account discovery.\n *\n * More than one account can be created, for example, the keyring can create\n * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account\n * index.\n */\n Bip44Discover = 'bip44:discover',\n\n /**\n * Represents an account imported from a private key.\n */\n PrivateKeyImport = 'private-key:import',\n}\n\n/**\n * Struct for {@link CreateAccountOptions}.\n */\nexport const CreateAccountOptionsStruct = selectiveUnion((value: any) => {\n const accountCreationType = value?.type as AccountCreationType;\n switch (accountCreationType) {\n case AccountCreationType.Bip44DerivePath:\n return CreateAccountBip44DerivePathOptionsStruct;\n case AccountCreationType.Bip44DeriveIndex:\n return CreateAccountBip44DeriveIndexOptionsStruct;\n case AccountCreationType.Bip44Discover:\n return CreateAccountBip44DiscoverOptionsStruct;\n case AccountCreationType.PrivateKeyImport:\n return CreateAccountPrivateKeyOptionsStruct;\n default:\n // Return first struct as fallback - validation will fail with proper error indicating the type mismatch\n return CreateAccountBip44DerivePathOptionsStruct;\n }\n});\n\n/**\n * Represents the available options for creating a new account.\n */\nexport type CreateAccountOptions = Infer<typeof CreateAccountOptionsStruct>;\n"]}
@@ -0,0 +1,58 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ export * from "./bip44.cjs";
3
+ export * from "./private-key.cjs";
4
+ /**
5
+ * Enum representing the different ways an account can be created.
6
+ */
7
+ export declare enum AccountCreationType {
8
+ /**
9
+ * Represents an account created using a BIP-44 derivation path.
10
+ */
11
+ Bip44DerivePath = "bip44:derive-path",
12
+ /**
13
+ * Represents accounts created using a BIP-44 account index.
14
+ *
15
+ * More than one account can be created, for example, the keyring can create
16
+ * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
17
+ * index.
18
+ */
19
+ Bip44DeriveIndex = "bip44:derive-index",
20
+ /**
21
+ * Represents accounts created through BIP-44 account discovery.
22
+ *
23
+ * More than one account can be created, for example, the keyring can create
24
+ * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
25
+ * index.
26
+ */
27
+ Bip44Discover = "bip44:discover",
28
+ /**
29
+ * Represents an account imported from a private key.
30
+ */
31
+ PrivateKeyImport = "private-key:import"
32
+ }
33
+ /**
34
+ * Struct for {@link CreateAccountOptions}.
35
+ */
36
+ export declare const CreateAccountOptionsStruct: import("@metamask/superstruct").Struct<{
37
+ type: "bip44:derive-path";
38
+ derivationPath: `m/${string}`;
39
+ entropySource: string;
40
+ } | {
41
+ type: "bip44:derive-index";
42
+ groupIndex: number;
43
+ entropySource: string;
44
+ } | {
45
+ type: "bip44:discover";
46
+ groupIndex: number;
47
+ entropySource: string;
48
+ } | {
49
+ type: "private-key:import";
50
+ encoding: "hexadecimal" | "base58";
51
+ privateKey: string;
52
+ accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
53
+ }, null>;
54
+ /**
55
+ * Represents the available options for creating a new account.
56
+ */
57
+ export type CreateAccountOptions = Infer<typeof CreateAccountOptionsStruct>;
58
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/api/v2/create-account/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,8BAA8B;AASnD,4BAAwB;AACxB,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,mBAAmB;IAC7B;;OAEG;IACH,eAAe,sBAAsB;IAErC;;;;;;OAMG;IACH,gBAAgB,uBAAuB;IAEvC;;;;;;OAMG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,gBAAgB,uBAAuB;CACxC;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;QAerC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,58 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ export * from "./bip44.mjs";
3
+ export * from "./private-key.mjs";
4
+ /**
5
+ * Enum representing the different ways an account can be created.
6
+ */
7
+ export declare enum AccountCreationType {
8
+ /**
9
+ * Represents an account created using a BIP-44 derivation path.
10
+ */
11
+ Bip44DerivePath = "bip44:derive-path",
12
+ /**
13
+ * Represents accounts created using a BIP-44 account index.
14
+ *
15
+ * More than one account can be created, for example, the keyring can create
16
+ * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
17
+ * index.
18
+ */
19
+ Bip44DeriveIndex = "bip44:derive-index",
20
+ /**
21
+ * Represents accounts created through BIP-44 account discovery.
22
+ *
23
+ * More than one account can be created, for example, the keyring can create
24
+ * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
25
+ * index.
26
+ */
27
+ Bip44Discover = "bip44:discover",
28
+ /**
29
+ * Represents an account imported from a private key.
30
+ */
31
+ PrivateKeyImport = "private-key:import"
32
+ }
33
+ /**
34
+ * Struct for {@link CreateAccountOptions}.
35
+ */
36
+ export declare const CreateAccountOptionsStruct: import("@metamask/superstruct").Struct<{
37
+ type: "bip44:derive-path";
38
+ derivationPath: `m/${string}`;
39
+ entropySource: string;
40
+ } | {
41
+ type: "bip44:derive-index";
42
+ groupIndex: number;
43
+ entropySource: string;
44
+ } | {
45
+ type: "bip44:discover";
46
+ groupIndex: number;
47
+ entropySource: string;
48
+ } | {
49
+ type: "private-key:import";
50
+ encoding: "hexadecimal" | "base58";
51
+ privateKey: string;
52
+ accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
53
+ }, null>;
54
+ /**
55
+ * Represents the available options for creating a new account.
56
+ */
57
+ export type CreateAccountOptions = Infer<typeof CreateAccountOptionsStruct>;
58
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/api/v2/create-account/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,KAAK,EAAE,8BAA8B;AASnD,4BAAwB;AACxB,kCAA8B;AAE9B;;GAEG;AACH,oBAAY,mBAAmB;IAC7B;;OAEG;IACH,eAAe,sBAAsB;IAErC;;;;;;OAMG;IACH,gBAAgB,uBAAuB;IAEvC;;;;;;OAMG;IACH,aAAa,mBAAmB;IAEhC;;OAEG;IACH,gBAAgB,uBAAuB;CACxC;AAED;;GAEG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;QAerC,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { selectiveUnion } from "@metamask/keyring-utils";
2
+ import { CreateAccountBip44DiscoverOptionsStruct, CreateAccountBip44DeriveIndexOptionsStruct, CreateAccountBip44DerivePathOptionsStruct } from "./bip44.mjs";
3
+ import { CreateAccountPrivateKeyOptionsStruct } from "./private-key.mjs";
4
+ export * from "./bip44.mjs";
5
+ export * from "./private-key.mjs";
6
+ /**
7
+ * Enum representing the different ways an account can be created.
8
+ */
9
+ export var AccountCreationType;
10
+ (function (AccountCreationType) {
11
+ /**
12
+ * Represents an account created using a BIP-44 derivation path.
13
+ */
14
+ AccountCreationType["Bip44DerivePath"] = "bip44:derive-path";
15
+ /**
16
+ * Represents accounts created using a BIP-44 account index.
17
+ *
18
+ * More than one account can be created, for example, the keyring can create
19
+ * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
20
+ * index.
21
+ */
22
+ AccountCreationType["Bip44DeriveIndex"] = "bip44:derive-index";
23
+ /**
24
+ * Represents accounts created through BIP-44 account discovery.
25
+ *
26
+ * More than one account can be created, for example, the keyring can create
27
+ * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account
28
+ * index.
29
+ */
30
+ AccountCreationType["Bip44Discover"] = "bip44:discover";
31
+ /**
32
+ * Represents an account imported from a private key.
33
+ */
34
+ AccountCreationType["PrivateKeyImport"] = "private-key:import";
35
+ })(AccountCreationType || (AccountCreationType = {}));
36
+ /**
37
+ * Struct for {@link CreateAccountOptions}.
38
+ */
39
+ export const CreateAccountOptionsStruct = selectiveUnion((value) => {
40
+ const accountCreationType = value?.type;
41
+ switch (accountCreationType) {
42
+ case AccountCreationType.Bip44DerivePath:
43
+ return CreateAccountBip44DerivePathOptionsStruct;
44
+ case AccountCreationType.Bip44DeriveIndex:
45
+ return CreateAccountBip44DeriveIndexOptionsStruct;
46
+ case AccountCreationType.Bip44Discover:
47
+ return CreateAccountBip44DiscoverOptionsStruct;
48
+ case AccountCreationType.PrivateKeyImport:
49
+ return CreateAccountPrivateKeyOptionsStruct;
50
+ default:
51
+ // Return first struct as fallback - validation will fail with proper error indicating the type mismatch
52
+ return CreateAccountBip44DerivePathOptionsStruct;
53
+ }
54
+ });
55
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gCAAgC;AAGzD,OAAO,EACL,uCAAuC,EACvC,0CAA0C,EAC1C,yCAAyC,EAC1C,oBAAgB;AACjB,OAAO,EAAE,oCAAoC,EAAE,0BAAsB;AAErE,4BAAwB;AACxB,kCAA8B;AAE9B;;GAEG;AACH,MAAM,CAAN,IAAY,mBA4BX;AA5BD,WAAY,mBAAmB;IAC7B;;OAEG;IACH,4DAAqC,CAAA;IAErC;;;;;;OAMG;IACH,8DAAuC,CAAA;IAEvC;;;;;;OAMG;IACH,uDAAgC,CAAA;IAEhC;;OAEG;IACH,8DAAuC,CAAA;AACzC,CAAC,EA5BW,mBAAmB,KAAnB,mBAAmB,QA4B9B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,cAAc,CAAC,CAAC,KAAU,EAAE,EAAE;IACtE,MAAM,mBAAmB,GAAG,KAAK,EAAE,IAA2B,CAAC;IAC/D,QAAQ,mBAAmB,EAAE,CAAC;QAC5B,KAAK,mBAAmB,CAAC,eAAe;YACtC,OAAO,yCAAyC,CAAC;QACnD,KAAK,mBAAmB,CAAC,gBAAgB;YACvC,OAAO,0CAA0C,CAAC;QACpD,KAAK,mBAAmB,CAAC,aAAa;YACpC,OAAO,uCAAuC,CAAC;QACjD,KAAK,mBAAmB,CAAC,gBAAgB;YACvC,OAAO,oCAAoC,CAAC;QAC9C;YACE,wGAAwG;YACxG,OAAO,yCAAyC,CAAC;IACrD,CAAC;AACH,CAAC,CAAC,CAAC","sourcesContent":["import { selectiveUnion } from '@metamask/keyring-utils';\nimport { type Infer } from '@metamask/superstruct';\n\nimport {\n CreateAccountBip44DiscoverOptionsStruct,\n CreateAccountBip44DeriveIndexOptionsStruct,\n CreateAccountBip44DerivePathOptionsStruct,\n} from './bip44';\nimport { CreateAccountPrivateKeyOptionsStruct } from './private-key';\n\nexport * from './bip44';\nexport * from './private-key';\n\n/**\n * Enum representing the different ways an account can be created.\n */\nexport enum AccountCreationType {\n /**\n * Represents an account created using a BIP-44 derivation path.\n */\n Bip44DerivePath = 'bip44:derive-path',\n\n /**\n * Represents accounts created using a BIP-44 account index.\n *\n * More than one account can be created, for example, the keyring can create\n * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account\n * index.\n */\n Bip44DeriveIndex = 'bip44:derive-index',\n\n /**\n * Represents accounts created through BIP-44 account discovery.\n *\n * More than one account can be created, for example, the keyring can create\n * multiple account types (e.g., P2PKH, P2TR, P2WPKH) for the same account\n * index.\n */\n Bip44Discover = 'bip44:discover',\n\n /**\n * Represents an account imported from a private key.\n */\n PrivateKeyImport = 'private-key:import',\n}\n\n/**\n * Struct for {@link CreateAccountOptions}.\n */\nexport const CreateAccountOptionsStruct = selectiveUnion((value: any) => {\n const accountCreationType = value?.type as AccountCreationType;\n switch (accountCreationType) {\n case AccountCreationType.Bip44DerivePath:\n return CreateAccountBip44DerivePathOptionsStruct;\n case AccountCreationType.Bip44DeriveIndex:\n return CreateAccountBip44DeriveIndexOptionsStruct;\n case AccountCreationType.Bip44Discover:\n return CreateAccountBip44DiscoverOptionsStruct;\n case AccountCreationType.PrivateKeyImport:\n return CreateAccountPrivateKeyOptionsStruct;\n default:\n // Return first struct as fallback - validation will fail with proper error indicating the type mismatch\n return CreateAccountBip44DerivePathOptionsStruct;\n }\n});\n\n/**\n * Represents the available options for creating a new account.\n */\nexport type CreateAccountOptions = Infer<typeof CreateAccountOptionsStruct>;\n"]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateAccountPrivateKeyOptionsStruct = void 0;
4
+ const superstruct_1 = require("@metamask/superstruct");
5
+ const account_1 = require("../../account.cjs");
6
+ const private_key_1 = require("../private-key.cjs");
7
+ /**
8
+ * Struct for {@link CreateAccountPrivateKeyOptions}.
9
+ */
10
+ exports.CreateAccountPrivateKeyOptionsStruct = (0, superstruct_1.object)({
11
+ /**
12
+ * The type of the options.
13
+ */
14
+ type: (0, superstruct_1.literal)('private-key:import'),
15
+ /**
16
+ * The encoded private key to be imported.
17
+ */
18
+ privateKey: (0, superstruct_1.string)(),
19
+ /**
20
+ * The encoding of the private key.
21
+ */
22
+ encoding: private_key_1.PrivateKeyEncodingStruct,
23
+ /**
24
+ * The account type of the imported account.
25
+ */
26
+ accountType: (0, superstruct_1.exactOptional)(account_1.KeyringAccountTypeStruct),
27
+ });
28
+ //# sourceMappingURL=private-key.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-key.cjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/private-key.ts"],"names":[],"mappings":";;;AAAA,uDAM+B;AAE/B,+CAAyD;AACzD,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,oBAAM,GAAE;IACpB;;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 string,\n type Infer,\n} from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../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: 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"]}
@@ -0,0 +1,45 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Struct for {@link CreateAccountPrivateKeyOptions}.
4
+ */
5
+ export declare const CreateAccountPrivateKeyOptionsStruct: import("@metamask/superstruct").Struct<{
6
+ type: "private-key:import";
7
+ encoding: "hexadecimal" | "base58";
8
+ privateKey: string;
9
+ accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
10
+ }, {
11
+ /**
12
+ * The type of the options.
13
+ */
14
+ type: import("@metamask/superstruct").Struct<"private-key:import", "private-key:import">;
15
+ /**
16
+ * The encoded private key to be imported.
17
+ */
18
+ privateKey: import("@metamask/superstruct").Struct<string, null>;
19
+ /**
20
+ * The encoding of the private key.
21
+ */
22
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
23
+ hexadecimal: "hexadecimal";
24
+ base58: "base58";
25
+ }>;
26
+ /**
27
+ * The account type of the imported account.
28
+ */
29
+ accountType: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
30
+ "eip155:eoa": "eip155:eoa";
31
+ "eip155:erc4337": "eip155:erc4337";
32
+ "bip122:p2pkh": "bip122:p2pkh";
33
+ "bip122:p2sh": "bip122:p2sh";
34
+ "bip122:p2wpkh": "bip122:p2wpkh";
35
+ "bip122:p2tr": "bip122:p2tr";
36
+ "solana:data-account": "solana:data-account";
37
+ "tron:eoa": "tron:eoa";
38
+ "any:account": "any:account";
39
+ }>;
40
+ }>;
41
+ /**
42
+ * Options for importing an account from a private key.
43
+ */
44
+ export type CreateAccountPrivateKeyOptions = Infer<typeof CreateAccountPrivateKeyOptionsStruct>;
45
+ //# sourceMappingURL=private-key.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-key.d.cts","sourceRoot":"","sources":["../../../../src/api/v2/create-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,KAAK,EACX,8BAA8B;AAK/B;;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"}
@@ -0,0 +1,45 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Struct for {@link CreateAccountPrivateKeyOptions}.
4
+ */
5
+ export declare const CreateAccountPrivateKeyOptionsStruct: import("@metamask/superstruct").Struct<{
6
+ type: "private-key:import";
7
+ encoding: "hexadecimal" | "base58";
8
+ privateKey: string;
9
+ accountType?: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
10
+ }, {
11
+ /**
12
+ * The type of the options.
13
+ */
14
+ type: import("@metamask/superstruct").Struct<"private-key:import", "private-key:import">;
15
+ /**
16
+ * The encoded private key to be imported.
17
+ */
18
+ privateKey: import("@metamask/superstruct").Struct<string, null>;
19
+ /**
20
+ * The encoding of the private key.
21
+ */
22
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
23
+ hexadecimal: "hexadecimal";
24
+ base58: "base58";
25
+ }>;
26
+ /**
27
+ * The account type of the imported account.
28
+ */
29
+ accountType: import("@metamask/superstruct").ExactOptionalStruct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
30
+ "eip155:eoa": "eip155:eoa";
31
+ "eip155:erc4337": "eip155:erc4337";
32
+ "bip122:p2pkh": "bip122:p2pkh";
33
+ "bip122:p2sh": "bip122:p2sh";
34
+ "bip122:p2wpkh": "bip122:p2wpkh";
35
+ "bip122:p2tr": "bip122:p2tr";
36
+ "solana:data-account": "solana:data-account";
37
+ "tron:eoa": "tron:eoa";
38
+ "any:account": "any:account";
39
+ }>;
40
+ }>;
41
+ /**
42
+ * Options for importing an account from a private key.
43
+ */
44
+ export type CreateAccountPrivateKeyOptions = Infer<typeof CreateAccountPrivateKeyOptionsStruct>;
45
+ //# sourceMappingURL=private-key.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-key.d.mts","sourceRoot":"","sources":["../../../../src/api/v2/create-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,KAAK,EACX,8BAA8B;AAK/B;;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"}
@@ -0,0 +1,25 @@
1
+ import { exactOptional, literal, object, string } from "@metamask/superstruct";
2
+ import { KeyringAccountTypeStruct } from "../../account.mjs";
3
+ import { PrivateKeyEncodingStruct } from "../private-key.mjs";
4
+ /**
5
+ * Struct for {@link CreateAccountPrivateKeyOptions}.
6
+ */
7
+ export const CreateAccountPrivateKeyOptionsStruct = object({
8
+ /**
9
+ * The type of the options.
10
+ */
11
+ type: literal('private-key:import'),
12
+ /**
13
+ * The encoded private key to be imported.
14
+ */
15
+ privateKey: string(),
16
+ /**
17
+ * The encoding of the private key.
18
+ */
19
+ encoding: PrivateKeyEncodingStruct,
20
+ /**
21
+ * The account type of the imported account.
22
+ */
23
+ accountType: exactOptional(KeyringAccountTypeStruct),
24
+ });
25
+ //# sourceMappingURL=private-key.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"private-key.mjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/private-key.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,OAAO,EACP,MAAM,EACN,MAAM,EAEP,8BAA8B;AAE/B,OAAO,EAAE,wBAAwB,EAAE,0BAAsB;AACzD,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,MAAM,EAAE;IACpB;;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 string,\n type Infer,\n} from '@metamask/superstruct';\n\nimport { KeyringAccountTypeStruct } from '../../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: 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"]}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ExportedAccountStruct = exports.ExportAccountOptionsStruct = exports.AccountExportType = void 0;
18
+ const private_key_1 = require("./private-key.cjs");
19
+ __exportStar(require("./private-key.cjs"), exports);
20
+ /**
21
+ * Enum representing the different types of account export methods.
22
+ */
23
+ var AccountExportType;
24
+ (function (AccountExportType) {
25
+ /**
26
+ * Export account as a private key.
27
+ */
28
+ AccountExportType["PrivateKey"] = "private-key";
29
+ })(AccountExportType || (exports.AccountExportType = AccountExportType = {}));
30
+ /**
31
+ * Struct for {@link ExportAccountOptions}.
32
+ */
33
+ exports.ExportAccountOptionsStruct = private_key_1.ExportAccountPrivateKeyOptionsStruct;
34
+ /**
35
+ * Struct for {@link ExportedAccount}.
36
+ */
37
+ exports.ExportedAccountStruct = private_key_1.PrivateKeyExportedAccountStruct;
38
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../../../src/api/v2/export-account/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAEA,mDAGuB;AAEvB,oDAA8B;AAE9B;;GAEG;AACH,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,+CAA0B,CAAA;AAC5B,CAAC,EALW,iBAAiB,iCAAjB,iBAAiB,QAK5B;AAED;;GAEG;AACU,QAAA,0BAA0B,GAAG,kDAAoC,CAAC;AAO/E;;GAEG;AACU,QAAA,qBAAqB,GAAG,6CAA+B,CAAC","sourcesContent":["import { type Infer } from '@metamask/superstruct';\n\nimport {\n ExportAccountPrivateKeyOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './private-key';\n\nexport * from './private-key';\n\n/**\n * Enum representing the different types of account export methods.\n */\nexport enum AccountExportType {\n /**\n * Export account as a private key.\n */\n PrivateKey = 'private-key',\n}\n\n/**\n * Struct for {@link ExportAccountOptions}.\n */\nexport const ExportAccountOptionsStruct = ExportAccountPrivateKeyOptionsStruct;\n\n/**\n * Represents the options for exporting an account.\n */\nexport type ExportAccountOptions = Infer<typeof ExportAccountOptionsStruct>;\n\n/**\n * Struct for {@link ExportedAccount}.\n */\nexport const ExportedAccountStruct = PrivateKeyExportedAccountStruct;\n\n/**\n * Represents an account that has been exported.\n */\nexport type ExportedAccount = Infer<typeof ExportedAccountStruct>;\n"]}
@@ -0,0 +1,48 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ export * from "./private-key.cjs";
3
+ /**
4
+ * Enum representing the different types of account export methods.
5
+ */
6
+ export declare enum AccountExportType {
7
+ /**
8
+ * Export account as a private key.
9
+ */
10
+ PrivateKey = "private-key"
11
+ }
12
+ /**
13
+ * Struct for {@link ExportAccountOptions}.
14
+ */
15
+ export declare const ExportAccountOptionsStruct: import("@metamask/superstruct").Struct<{
16
+ type: "private-key";
17
+ encoding: "hexadecimal" | "base58";
18
+ }, {
19
+ type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
20
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
21
+ hexadecimal: "hexadecimal";
22
+ base58: "base58";
23
+ }>;
24
+ }>;
25
+ /**
26
+ * Represents the options for exporting an account.
27
+ */
28
+ export type ExportAccountOptions = Infer<typeof ExportAccountOptionsStruct>;
29
+ /**
30
+ * Struct for {@link ExportedAccount}.
31
+ */
32
+ export declare const ExportedAccountStruct: import("@metamask/superstruct").Struct<{
33
+ type: "private-key";
34
+ encoding: "hexadecimal" | "base58";
35
+ privateKey: string;
36
+ }, {
37
+ type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
38
+ privateKey: import("@metamask/superstruct").Struct<string, null>;
39
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
40
+ hexadecimal: "hexadecimal";
41
+ base58: "base58";
42
+ }>;
43
+ }>;
44
+ /**
45
+ * Represents an account that has been exported.
46
+ */
47
+ export type ExportedAccount = Infer<typeof ExportedAccountStruct>;
48
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../../src/api/v2/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,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;;;;;;;;;;;EAAkC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ export * from "./private-key.mjs";
3
+ /**
4
+ * Enum representing the different types of account export methods.
5
+ */
6
+ export declare enum AccountExportType {
7
+ /**
8
+ * Export account as a private key.
9
+ */
10
+ PrivateKey = "private-key"
11
+ }
12
+ /**
13
+ * Struct for {@link ExportAccountOptions}.
14
+ */
15
+ export declare const ExportAccountOptionsStruct: import("@metamask/superstruct").Struct<{
16
+ type: "private-key";
17
+ encoding: "hexadecimal" | "base58";
18
+ }, {
19
+ type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
20
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
21
+ hexadecimal: "hexadecimal";
22
+ base58: "base58";
23
+ }>;
24
+ }>;
25
+ /**
26
+ * Represents the options for exporting an account.
27
+ */
28
+ export type ExportAccountOptions = Infer<typeof ExportAccountOptionsStruct>;
29
+ /**
30
+ * Struct for {@link ExportedAccount}.
31
+ */
32
+ export declare const ExportedAccountStruct: import("@metamask/superstruct").Struct<{
33
+ type: "private-key";
34
+ encoding: "hexadecimal" | "base58";
35
+ privateKey: string;
36
+ }, {
37
+ type: import("@metamask/superstruct").Struct<"private-key", "private-key">;
38
+ privateKey: import("@metamask/superstruct").Struct<string, null>;
39
+ encoding: import("@metamask/superstruct").Struct<"hexadecimal" | "base58", {
40
+ hexadecimal: "hexadecimal";
41
+ base58: "base58";
42
+ }>;
43
+ }>;
44
+ /**
45
+ * Represents an account that has been exported.
46
+ */
47
+ export type ExportedAccount = Infer<typeof ExportedAccountStruct>;
48
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../../src/api/v2/export-account/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,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;;;;;;;;;;;EAAkC,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import { ExportAccountPrivateKeyOptionsStruct, PrivateKeyExportedAccountStruct } from "./private-key.mjs";
2
+ export * from "./private-key.mjs";
3
+ /**
4
+ * Enum representing the different types of account export methods.
5
+ */
6
+ export var AccountExportType;
7
+ (function (AccountExportType) {
8
+ /**
9
+ * Export account as a private key.
10
+ */
11
+ AccountExportType["PrivateKey"] = "private-key";
12
+ })(AccountExportType || (AccountExportType = {}));
13
+ /**
14
+ * Struct for {@link ExportAccountOptions}.
15
+ */
16
+ export const ExportAccountOptionsStruct = ExportAccountPrivateKeyOptionsStruct;
17
+ /**
18
+ * Struct for {@link ExportedAccount}.
19
+ */
20
+ export const ExportedAccountStruct = PrivateKeyExportedAccountStruct;
21
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../../src/api/v2/export-account/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,oCAAoC,EACpC,+BAA+B,EAChC,0BAAsB;AAEvB,kCAA8B;AAE9B;;GAEG;AACH,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B;;OAEG;IACH,+CAA0B,CAAA;AAC5B,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,oCAAoC,CAAC;AAO/E;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,+BAA+B,CAAC","sourcesContent":["import { type Infer } from '@metamask/superstruct';\n\nimport {\n ExportAccountPrivateKeyOptionsStruct,\n PrivateKeyExportedAccountStruct,\n} from './private-key';\n\nexport * from './private-key';\n\n/**\n * Enum representing the different types of account export methods.\n */\nexport enum AccountExportType {\n /**\n * Export account as a private key.\n */\n PrivateKey = 'private-key',\n}\n\n/**\n * Struct for {@link ExportAccountOptions}.\n */\nexport const ExportAccountOptionsStruct = ExportAccountPrivateKeyOptionsStruct;\n\n/**\n * Represents the options for exporting an account.\n */\nexport type ExportAccountOptions = Infer<typeof ExportAccountOptionsStruct>;\n\n/**\n * Struct for {@link ExportedAccount}.\n */\nexport const ExportedAccountStruct = PrivateKeyExportedAccountStruct;\n\n/**\n * Represents an account that has been exported.\n */\nexport type ExportedAccount = Infer<typeof ExportedAccountStruct>;\n"]}