@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
package/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [21.3.0]
11
+
12
+ ### Added
13
+
14
+ - Add initial `Keyringv2` interface ([#397](https://github.com/MetaMask/accounts/pull/397))
15
+ - This is an on-going work and should not be used for now.
16
+ - Add new Tron methods `signMessage` and `signTransaction` ([#401](https://github.com/MetaMask/accounts/pull/401))
17
+
18
+ ### Changed
19
+
20
+ - Deprecate Tron methods `signMessageV2` and `verifyMessageV2` ([#401](https://github.com/MetaMask/accounts/pull/401))
21
+
10
22
  ## [21.2.0]
11
23
 
12
24
  ### Added
@@ -643,7 +655,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
643
655
  - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
644
656
  - Helper functions to create keyring handler in the snap.
645
657
 
646
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.2.0...HEAD
658
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.3.0...HEAD
659
+ [21.3.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.2.0...@metamask/keyring-api@21.3.0
647
660
  [21.2.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.1.0...@metamask/keyring-api@21.2.0
648
661
  [21.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@21.0.0...@metamask/keyring-api@21.1.0
649
662
  [21.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@20.1.1...@metamask/keyring-api@21.0.0
package/README.md CHANGED
@@ -223,6 +223,13 @@ these instruction assume that you are already familiar with the process of
223
223
  const accounts = await client.listAccounts();
224
224
  ```
225
225
 
226
+ ## KeyringV2 Interface (WIP, not implemented yet)
227
+
228
+ A unified keyring interface, designed to work for both native (EVM) keyrings and Snap keyrings, and to support non‑EVM chains and new features like backup & sync.
229
+
230
+ - Interface name: `KeyringV2`
231
+ - Location: `@metamask/keyring-api/src/api/v2/keyring.ts`
232
+
226
233
  ## Migrating from 0.1.x to 0.2.x
227
234
 
228
235
  The following changes were made to the API, which may require changes to your
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KeyringAccountStruct = exports.AnyAccountType = exports.TrxAccountType = exports.SolAccountType = exports.BtcAccountType = exports.EthAccountType = void 0;
3
+ exports.KeyringAccountStruct = exports.KeyringAccountTypeStruct = exports.AnyAccountType = exports.TrxAccountType = exports.SolAccountType = exports.BtcAccountType = exports.EthAccountType = void 0;
4
4
  const keyring_utils_1 = require("@metamask/keyring-utils");
5
5
  const superstruct_1 = require("@metamask/superstruct");
6
6
  const account_options_1 = require("./account-options.cjs");
@@ -45,6 +45,20 @@ var AnyAccountType;
45
45
  (function (AnyAccountType) {
46
46
  AnyAccountType["Account"] = "any:account";
47
47
  })(AnyAccountType || (exports.AnyAccountType = AnyAccountType = {}));
48
+ /**
49
+ * Struct for {@link KeyringAccountType}.
50
+ */
51
+ exports.KeyringAccountTypeStruct = (0, superstruct_1.enums)([
52
+ `${EthAccountType.Eoa}`,
53
+ `${EthAccountType.Erc4337}`,
54
+ `${BtcAccountType.P2pkh}`,
55
+ `${BtcAccountType.P2sh}`,
56
+ `${BtcAccountType.P2wpkh}`,
57
+ `${BtcAccountType.P2tr}`,
58
+ `${SolAccountType.DataAccount}`,
59
+ `${TrxAccountType.Eoa}`,
60
+ `${AnyAccountType.Account}`,
61
+ ]);
48
62
  /**
49
63
  * A struct which represents a Keyring account object. It is abstract enough to
50
64
  * be used with any blockchain. Specific blockchain account types should extend
@@ -1 +1 @@
1
- {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAAkE;AAElE,uDAAuE;AAEvE,2DAAgE;AAChE,qCAA2C;AAE3C;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;I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;;OAEG;IACH,OAAO,EAAE,6CAA2B;IAEpC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, string } from '@metamask/superstruct';\n\nimport { KeyringAccountOptionsStruct } from './account-options';\nimport { CaipChainIdStruct } from './caip';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2pkh = 'bip122:p2pkh',\n P2sh = 'bip122:p2sh',\n P2wpkh = 'bip122:p2wpkh',\n P2tr = 'bip122:p2tr',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported Tron account types.\n */\nexport enum TrxAccountType {\n Eoa = 'tron:eoa',\n}\n\n/**\n * A generic account type. It can be used to represent any account type that is\n * not covered by the other account types. It only applies to non-EVM chains.\n */\nexport enum AnyAccountType {\n Account = 'any:account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2pkh}`\n | `${BtcAccountType.P2sh}`\n | `${BtcAccountType.P2wpkh}`\n | `${BtcAccountType.P2tr}`\n | `${SolAccountType.DataAccount}`\n | `${TrxAccountType.Eoa}`\n | `${AnyAccountType.Account}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${AnyAccountType.Account}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account options.\n */\n options: KeyringAccountOptionsStruct,\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
1
+ {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAAkE;AAElE,uDAAuE;AAEvE,2DAAgE;AAChE,qCAA2C;AAE3C;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,wCAAsB,CAAA;IACtB,sCAAoB,CAAA;IACpB,0CAAwB,CAAA;IACxB,sCAAoB,CAAA;AACtB,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,kCAAgB,CAAA;AAClB,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;;GAGG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,yCAAuB,CAAA;AACzB,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAgBD;;GAEG;AACU,QAAA,wBAAwB,GAAG,IAAA,mBAAK,EAAC;IAC5C,GAAG,cAAc,CAAC,GAAG,EAAE;IACvB,GAAG,cAAc,CAAC,OAAO,EAAE;IAC3B,GAAG,cAAc,CAAC,KAAK,EAAE;IACzB,GAAG,cAAc,CAAC,IAAI,EAAE;IACxB,GAAG,cAAc,CAAC,MAAM,EAAE;IAC1B,GAAG,cAAc,CAAC,IAAI,EAAE;IACxB,GAAG,cAAc,CAAC,WAAW,EAAE;IAC/B,GAAG,cAAc,CAAC,GAAG,EAAE;IACvB,GAAG,cAAc,CAAC,OAAO,EAAE;CAC5B,CAAC,CAAC;AAEH;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,+BAAe;IAEnB;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,KAAK,EAAE;QACzB,GAAG,cAAc,CAAC,IAAI,EAAE;QACxB,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,IAAI,EAAE;QACxB,GAAG,cAAc,CAAC,WAAW,EAAE;QAC/B,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;KAC5B,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,wBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,6CAA2B;IAEpC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, string } from '@metamask/superstruct';\n\nimport { KeyringAccountOptionsStruct } from './account-options';\nimport { CaipChainIdStruct } from './caip';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2pkh = 'bip122:p2pkh',\n P2sh = 'bip122:p2sh',\n P2wpkh = 'bip122:p2wpkh',\n P2tr = 'bip122:p2tr',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported Tron account types.\n */\nexport enum TrxAccountType {\n Eoa = 'tron:eoa',\n}\n\n/**\n * A generic account type. It can be used to represent any account type that is\n * not covered by the other account types. It only applies to non-EVM chains.\n */\nexport enum AnyAccountType {\n Account = 'any:account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2pkh}`\n | `${BtcAccountType.P2sh}`\n | `${BtcAccountType.P2wpkh}`\n | `${BtcAccountType.P2tr}`\n | `${SolAccountType.DataAccount}`\n | `${TrxAccountType.Eoa}`\n | `${AnyAccountType.Account}`;\n\n/**\n * Struct for {@link KeyringAccountType}.\n */\nexport const KeyringAccountTypeStruct = enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${AnyAccountType.Account}`,\n]);\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${AnyAccountType.Account}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account options.\n */\n options: KeyringAccountOptionsStruct,\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -38,6 +38,20 @@ export declare enum AnyAccountType {
38
38
  * Supported account types.
39
39
  */
40
40
  export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc4337}` | `${BtcAccountType.P2pkh}` | `${BtcAccountType.P2sh}` | `${BtcAccountType.P2wpkh}` | `${BtcAccountType.P2tr}` | `${SolAccountType.DataAccount}` | `${TrxAccountType.Eoa}` | `${AnyAccountType.Account}`;
41
+ /**
42
+ * Struct for {@link KeyringAccountType}.
43
+ */
44
+ export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
45
+ "eip155:eoa": "eip155:eoa";
46
+ "eip155:erc4337": "eip155:erc4337";
47
+ "bip122:p2pkh": "bip122:p2pkh";
48
+ "bip122:p2sh": "bip122:p2sh";
49
+ "bip122:p2wpkh": "bip122:p2wpkh";
50
+ "bip122:p2tr": "bip122:p2tr";
51
+ "solana:data-account": "solana:data-account";
52
+ "tron:eoa": "tron:eoa";
53
+ "any:account": "any:account";
54
+ }>;
41
55
  /**
42
56
  * A struct which represents a Keyring account object. It is abstract enough to
43
57
  * be used with any blockchain. Specific blockchain account types should extend
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,KAAK,iBAAiB;IACtB,IAAI,gBAAgB;IACpB,MAAM,kBAAkB;IACxB,IAAI,gBAAgB;CACrB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,aAAa;CACjB;AAED;;;GAGG;AACH,oBAAY,cAAc;IACxB,OAAO,gBAAgB;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,KAAK,EAAE,GACzB,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,WAAW,EAAE,GAC/B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;AAEhC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;IAaH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,KAAK,iBAAiB;IACtB,IAAI,gBAAgB;IACpB,MAAM,kBAAkB;IACxB,IAAI,gBAAgB;CACrB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,aAAa;CACjB;AAED;;;GAGG;AACH,oBAAY,cAAc;IACxB,OAAO,gBAAgB;CACxB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,KAAK,EAAE,GACzB,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,WAAW,EAAE,GAC/B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;EAUnC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;IAaH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -38,6 +38,20 @@ export declare enum AnyAccountType {
38
38
  * Supported account types.
39
39
  */
40
40
  export type KeyringAccountType = `${EthAccountType.Eoa}` | `${EthAccountType.Erc4337}` | `${BtcAccountType.P2pkh}` | `${BtcAccountType.P2sh}` | `${BtcAccountType.P2wpkh}` | `${BtcAccountType.P2tr}` | `${SolAccountType.DataAccount}` | `${TrxAccountType.Eoa}` | `${AnyAccountType.Account}`;
41
+ /**
42
+ * Struct for {@link KeyringAccountType}.
43
+ */
44
+ export declare const KeyringAccountTypeStruct: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
45
+ "eip155:eoa": "eip155:eoa";
46
+ "eip155:erc4337": "eip155:erc4337";
47
+ "bip122:p2pkh": "bip122:p2pkh";
48
+ "bip122:p2sh": "bip122:p2sh";
49
+ "bip122:p2wpkh": "bip122:p2wpkh";
50
+ "bip122:p2tr": "bip122:p2tr";
51
+ "solana:data-account": "solana:data-account";
52
+ "tron:eoa": "tron:eoa";
53
+ "any:account": "any:account";
54
+ }>;
41
55
  /**
42
56
  * A struct which represents a Keyring account object. It is abstract enough to
43
57
  * be used with any blockchain. Specific blockchain account types should extend
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,KAAK,iBAAiB;IACtB,IAAI,gBAAgB;IACpB,MAAM,kBAAkB;IACxB,IAAI,gBAAgB;CACrB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,aAAa;CACjB;AAED;;;GAGG;AACH,oBAAY,cAAc;IACxB,OAAO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AAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,KAAK,EAAE,GACzB,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,IAAI,EAAE,GACxB,GAAG,cAAc,CAAC,WAAW,EAAE,GAC/B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC;AAEhC;;GAEG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;EAUnC,CAAC;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;IAaH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -42,6 +42,20 @@ export var AnyAccountType;
42
42
  (function (AnyAccountType) {
43
43
  AnyAccountType["Account"] = "any:account";
44
44
  })(AnyAccountType || (AnyAccountType = {}));
45
+ /**
46
+ * Struct for {@link KeyringAccountType}.
47
+ */
48
+ export const KeyringAccountTypeStruct = enums([
49
+ `${EthAccountType.Eoa}`,
50
+ `${EthAccountType.Erc4337}`,
51
+ `${BtcAccountType.P2pkh}`,
52
+ `${BtcAccountType.P2sh}`,
53
+ `${BtcAccountType.P2wpkh}`,
54
+ `${BtcAccountType.P2tr}`,
55
+ `${SolAccountType.DataAccount}`,
56
+ `${TrxAccountType.Eoa}`,
57
+ `${AnyAccountType.Account}`,
58
+ ]);
45
59
  /**
46
60
  * A struct which represents a Keyring account object. It is abstract enough to
47
61
  * be used with any blockchain. Specific blockchain account types should extend
@@ -1 +1 @@
1
- {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAA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CAAC,IAAI,EAAE;QACxB,GAAG,cAAc,CAAC,WAAW,EAAE;QAC/B,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;KAC5B,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,2BAA2B;IAEpC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, string } from '@metamask/superstruct';\n\nimport { KeyringAccountOptionsStruct } from './account-options';\nimport { CaipChainIdStruct } from './caip';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2pkh = 'bip122:p2pkh',\n P2sh = 'bip122:p2sh',\n P2wpkh = 'bip122:p2wpkh',\n P2tr = 'bip122:p2tr',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported Tron account types.\n */\nexport enum TrxAccountType {\n Eoa = 'tron:eoa',\n}\n\n/**\n * A generic account type. It can be used to represent any account type that is\n * not covered by the other account types. It only applies to non-EVM chains.\n */\nexport enum AnyAccountType {\n Account = 'any:account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2pkh}`\n | `${BtcAccountType.P2sh}`\n | `${BtcAccountType.P2wpkh}`\n | `${BtcAccountType.P2tr}`\n | `${SolAccountType.DataAccount}`\n | `${TrxAccountType.Eoa}`\n | `${AnyAccountType.Account}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${AnyAccountType.Account}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account options.\n */\n options: KeyringAccountOptionsStruct,\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
1
+ {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,gCAAgC;AAElE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAEvE,OAAO,EAAE,2BAA2B,EAAE,8BAA0B;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAe;AAE3C;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,wCAAsB,CAAA;IACtB,sCAAoB,CAAA;IACpB,0CAAwB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c,CAAC,WAAW,EAAE;QAC/B,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;KAC5B,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,2BAA2B;IAEpC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { AccountIdStruct, object } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, string } from '@metamask/superstruct';\n\nimport { KeyringAccountOptionsStruct } from './account-options';\nimport { CaipChainIdStruct } from './caip';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2pkh = 'bip122:p2pkh',\n P2sh = 'bip122:p2sh',\n P2wpkh = 'bip122:p2wpkh',\n P2tr = 'bip122:p2tr',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported Tron account types.\n */\nexport enum TrxAccountType {\n Eoa = 'tron:eoa',\n}\n\n/**\n * A generic account type. It can be used to represent any account type that is\n * not covered by the other account types. It only applies to non-EVM chains.\n */\nexport enum AnyAccountType {\n Account = 'any:account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2pkh}`\n | `${BtcAccountType.P2sh}`\n | `${BtcAccountType.P2wpkh}`\n | `${BtcAccountType.P2tr}`\n | `${SolAccountType.DataAccount}`\n | `${TrxAccountType.Eoa}`\n | `${AnyAccountType.Account}`;\n\n/**\n * Struct for {@link KeyringAccountType}.\n */\nexport const KeyringAccountTypeStruct = enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${AnyAccountType.Account}`,\n]);\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: AccountIdStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2pkh}`,\n `${BtcAccountType.P2sh}`,\n `${BtcAccountType.P2wpkh}`,\n `${BtcAccountType.P2tr}`,\n `${SolAccountType.DataAccount}`,\n `${TrxAccountType.Eoa}`,\n `${AnyAccountType.Account}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(CaipChainIdStruct)),\n\n /**\n * Account options.\n */\n options: KeyringAccountOptionsStruct,\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -27,4 +27,5 @@ __exportStar(require("./response.cjs"), exports);
27
27
  __exportStar(require("./transaction.cjs"), exports);
28
28
  __exportStar(require("./pagination.cjs"), exports);
29
29
  __exportStar(require("./options.cjs"), exports);
30
+ __exportStar(require("./v2/index.cjs"), exports);
30
31
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,wDAAkC;AAClC,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,6CAAuB;AACvB,kDAA4B;AAE5B,+CAAyB;AACzB,gDAA0B;AAC1B,iDAA2B;AAC3B,oDAA8B;AAC9B,mDAA6B;AAC7B,gDAA0B","sourcesContent":["export * from './account';\nexport * from './account-options';\nexport * from './address';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './discovery';\nexport type * from './entropy';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport * from './options';\nexport type * from './keyring';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,wDAAkC;AAClC,gDAA0B;AAC1B,8CAAwB;AACxB,gDAA0B;AAC1B,6CAAuB;AACvB,kDAA4B;AAE5B,+CAAyB;AACzB,gDAA0B;AAC1B,iDAA2B;AAC3B,oDAA8B;AAC9B,mDAA6B;AAC7B,gDAA0B;AAE1B,iDAAqB","sourcesContent":["export * from './account';\nexport * from './account-options';\nexport * from './address';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './discovery';\nexport type * from './entropy';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport * from './options';\nexport type * from './keyring';\nexport * from './v2';\n"]}
@@ -13,4 +13,5 @@ export * from "./transaction.cjs";
13
13
  export * from "./pagination.cjs";
14
14
  export * from "./options.cjs";
15
15
  export type * from "./keyring.cjs";
16
+ export * from "./v2/index.cjs";
16
17
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAC5B,mCAA+B;AAC/B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAC1B,mCAA+B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAC5B,mCAA+B;AAC/B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAC1B,mCAA+B;AAC/B,+BAAqB"}
@@ -13,4 +13,5 @@ export * from "./transaction.mjs";
13
13
  export * from "./pagination.mjs";
14
14
  export * from "./options.mjs";
15
15
  export type * from "./keyring.mjs";
16
+ export * from "./v2/index.mjs";
16
17
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAC5B,mCAA+B;AAC/B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAC1B,mCAA+B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAC5B,mCAA+B;AAC/B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAC1B,mCAA+B;AAC/B,+BAAqB"}
@@ -11,4 +11,5 @@ export * from "./response.mjs";
11
11
  export * from "./transaction.mjs";
12
12
  export * from "./pagination.mjs";
13
13
  export * from "./options.mjs";
14
+ export * from "./v2/index.mjs";
14
15
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAE5B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B","sourcesContent":["export * from './account';\nexport * from './account-options';\nexport * from './address';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './discovery';\nexport type * from './entropy';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport * from './options';\nexport type * from './keyring';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,8BAA0B;AAC1B,sCAAkC;AAClC,8BAA0B;AAC1B,4BAAwB;AACxB,8BAA0B;AAC1B,2BAAuB;AACvB,gCAA4B;AAE5B,6BAAyB;AACzB,8BAA0B;AAC1B,+BAA2B;AAC3B,kCAA8B;AAC9B,iCAA6B;AAC7B,8BAA0B;AAE1B,+BAAqB","sourcesContent":["export * from './account';\nexport * from './account-options';\nexport * from './address';\nexport * from './asset';\nexport * from './balance';\nexport * from './caip';\nexport * from './discovery';\nexport type * from './entropy';\nexport * from './export';\nexport * from './request';\nexport * from './response';\nexport * from './transaction';\nexport * from './pagination';\nexport * from './options';\nexport type * from './keyring';\nexport * from './v2';\n"]}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateAccountBip44DiscoverOptionsStruct = exports.CreateAccountBip44DeriveIndexOptionsStruct = exports.CreateAccountBip44DerivePathOptionsStruct = void 0;
4
+ const superstruct_1 = require("@metamask/superstruct");
5
+ const derivation_1 = require("../../derivation.cjs");
6
+ /**
7
+ * Struct for {@link CreateAccountBip44DerivePathOptions}.
8
+ */
9
+ exports.CreateAccountBip44DerivePathOptionsStruct = (0, superstruct_1.object)({
10
+ /**
11
+ * Type of the options.
12
+ */
13
+ type: (0, superstruct_1.literal)('bip44:derive-path'),
14
+ /**
15
+ * ID of the entropy source to be used to derive the account.
16
+ */
17
+ entropySource: (0, superstruct_1.string)(),
18
+ /**
19
+ * BIP-44 derivation path to be used to derive the account.
20
+ */
21
+ derivationPath: derivation_1.DerivationPathStruct,
22
+ });
23
+ /**
24
+ * Struct for {@link CreateAccountBip44DeriveIndexOptions}.
25
+ */
26
+ exports.CreateAccountBip44DeriveIndexOptionsStruct = (0, superstruct_1.object)({
27
+ /**
28
+ * The type of the options.
29
+ */
30
+ type: (0, superstruct_1.literal)('bip44:derive-index'),
31
+ /**
32
+ * ID of the entropy source to be used to derive the account.
33
+ */
34
+ entropySource: (0, superstruct_1.string)(),
35
+ /**
36
+ * The index of the account group to be derived.
37
+ */
38
+ groupIndex: (0, superstruct_1.number)(),
39
+ });
40
+ /**
41
+ * Struct for {@link CreateAccountBip44DiscoverOptions}.
42
+ */
43
+ exports.CreateAccountBip44DiscoverOptionsStruct = (0, superstruct_1.object)({
44
+ /**
45
+ * The type of the options.
46
+ */
47
+ type: (0, superstruct_1.literal)('bip44:discover'),
48
+ /**
49
+ * ID of the entropy source to be used to derive the account.
50
+ */
51
+ entropySource: (0, superstruct_1.string)(),
52
+ /**
53
+ * The index of the account group to be derived.
54
+ */
55
+ groupIndex: (0, superstruct_1.number)(),
56
+ });
57
+ //# sourceMappingURL=bip44.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bip44.cjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/bip44.ts"],"names":[],"mappings":";;;AAAA,uDAM+B;AAE/B,qDAAwD;AAExD;;GAEG;AACU,QAAA,yCAAyC,GAAG,IAAA,oBAAM,EAAC;IAC9D;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,mBAAmB,CAAC;IAClC;;OAEG;IACH,aAAa,EAAE,IAAA,oBAAM,GAAE;IACvB;;OAEG;IACH,cAAc,EAAE,iCAAoB;CACrC,CAAC,CAAC;AASH;;GAEG;AACU,QAAA,0CAA0C,GAAG,IAAA,oBAAM,EAAC;IAC/D;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,oBAAoB,CAAC;IACnC;;OAEG;IACH,aAAa,EAAE,IAAA,oBAAM,GAAE;IACvB;;OAEG;IACH,UAAU,EAAE,IAAA,oBAAM,GAAE;CACrB,CAAC,CAAC;AAYH;;GAEG;AACU,QAAA,uCAAuC,GAAG,IAAA,oBAAM,EAAC;IAC5D;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,gBAAgB,CAAC;IAC/B;;OAEG;IACH,aAAa,EAAE,IAAA,oBAAM,GAAE;IACvB;;OAEG;IACH,UAAU,EAAE,IAAA,oBAAM,GAAE;CACrB,CAAC,CAAC","sourcesContent":["import {\n literal,\n number,\n object,\n string,\n type Infer,\n} from '@metamask/superstruct';\n\nimport { DerivationPathStruct } from '../../derivation';\n\n/**\n * Struct for {@link CreateAccountBip44DerivePathOptions}.\n */\nexport const CreateAccountBip44DerivePathOptionsStruct = object({\n /**\n * Type of the options.\n */\n type: literal('bip44:derive-path'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * BIP-44 derivation path to be used to derive the account.\n */\n derivationPath: DerivationPathStruct,\n});\n\n/**\n * Options for creating an account using the given BIP-44 derivation path.\n */\nexport type CreateAccountBip44DerivePathOptions = Infer<\n typeof CreateAccountBip44DerivePathOptionsStruct\n>;\n\n/**\n * Struct for {@link CreateAccountBip44DeriveIndexOptions}.\n */\nexport const CreateAccountBip44DeriveIndexOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('bip44:derive-index'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * The index of the account group to be derived.\n */\n groupIndex: number(),\n});\n\n/**\n * Options for creating an account using the given BIP-44 account group index.\n *\n * Note that the keyring can support non-standard BIP-44 paths for\n * compatibility with other wallets.\n */\nexport type CreateAccountBip44DeriveIndexOptions = Infer<\n typeof CreateAccountBip44DeriveIndexOptionsStruct\n>;\n\n/**\n * Struct for {@link CreateAccountBip44DiscoverOptions}.\n */\nexport const CreateAccountBip44DiscoverOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('bip44:discover'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * The index of the account group to be derived.\n */\n groupIndex: number(),\n});\n\n/**\n * Options for creating accounts by performing a BIP-44 account discovery.\n *\n * Note that the keyring can support non-standard BIP-44 paths for\n * compatibility with other wallets.\n */\nexport type CreateAccountBip44DiscoverOptions = Infer<\n typeof CreateAccountBip44DiscoverOptionsStruct\n>;\n"]}
@@ -0,0 +1,83 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Struct for {@link CreateAccountBip44DerivePathOptions}.
4
+ */
5
+ export declare const CreateAccountBip44DerivePathOptionsStruct: import("@metamask/superstruct").Struct<{
6
+ type: "bip44:derive-path";
7
+ derivationPath: `m/${string}`;
8
+ entropySource: string;
9
+ }, {
10
+ /**
11
+ * Type of the options.
12
+ */
13
+ type: import("@metamask/superstruct").Struct<"bip44:derive-path", "bip44:derive-path">;
14
+ /**
15
+ * ID of the entropy source to be used to derive the account.
16
+ */
17
+ entropySource: import("@metamask/superstruct").Struct<string, null>;
18
+ /**
19
+ * BIP-44 derivation path to be used to derive the account.
20
+ */
21
+ derivationPath: import("@metamask/superstruct").Struct<`m/${string}`, null>;
22
+ }>;
23
+ /**
24
+ * Options for creating an account using the given BIP-44 derivation path.
25
+ */
26
+ export type CreateAccountBip44DerivePathOptions = Infer<typeof CreateAccountBip44DerivePathOptionsStruct>;
27
+ /**
28
+ * Struct for {@link CreateAccountBip44DeriveIndexOptions}.
29
+ */
30
+ export declare const CreateAccountBip44DeriveIndexOptionsStruct: import("@metamask/superstruct").Struct<{
31
+ type: "bip44:derive-index";
32
+ groupIndex: number;
33
+ entropySource: string;
34
+ }, {
35
+ /**
36
+ * The type of the options.
37
+ */
38
+ type: import("@metamask/superstruct").Struct<"bip44:derive-index", "bip44:derive-index">;
39
+ /**
40
+ * ID of the entropy source to be used to derive the account.
41
+ */
42
+ entropySource: import("@metamask/superstruct").Struct<string, null>;
43
+ /**
44
+ * The index of the account group to be derived.
45
+ */
46
+ groupIndex: import("@metamask/superstruct").Struct<number, null>;
47
+ }>;
48
+ /**
49
+ * Options for creating an account using the given BIP-44 account group index.
50
+ *
51
+ * Note that the keyring can support non-standard BIP-44 paths for
52
+ * compatibility with other wallets.
53
+ */
54
+ export type CreateAccountBip44DeriveIndexOptions = Infer<typeof CreateAccountBip44DeriveIndexOptionsStruct>;
55
+ /**
56
+ * Struct for {@link CreateAccountBip44DiscoverOptions}.
57
+ */
58
+ export declare const CreateAccountBip44DiscoverOptionsStruct: import("@metamask/superstruct").Struct<{
59
+ type: "bip44:discover";
60
+ groupIndex: number;
61
+ entropySource: string;
62
+ }, {
63
+ /**
64
+ * The type of the options.
65
+ */
66
+ type: import("@metamask/superstruct").Struct<"bip44:discover", "bip44:discover">;
67
+ /**
68
+ * ID of the entropy source to be used to derive the account.
69
+ */
70
+ entropySource: import("@metamask/superstruct").Struct<string, null>;
71
+ /**
72
+ * The index of the account group to be derived.
73
+ */
74
+ groupIndex: import("@metamask/superstruct").Struct<number, null>;
75
+ }>;
76
+ /**
77
+ * Options for creating accounts by performing a BIP-44 account discovery.
78
+ *
79
+ * Note that the keyring can support non-standard BIP-44 paths for
80
+ * compatibility with other wallets.
81
+ */
82
+ export type CreateAccountBip44DiscoverOptions = Infer<typeof CreateAccountBip44DiscoverOptionsStruct>;
83
+ //# sourceMappingURL=bip44.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bip44.d.cts","sourceRoot":"","sources":["../../../../src/api/v2/create-account/bip44.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,KAAK,EACX,8BAA8B;AAI/B;;GAEG;AACH,eAAO,MAAM,yCAAyC;;;;;IACpD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,KAAK,CACrD,OAAO,yCAAyC,CACjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0CAA0C;;;;;IACrD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG,KAAK,CACtD,OAAO,0CAA0C,CAClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uCAAuC;;;;;IAClD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG,KAAK,CACnD,OAAO,uCAAuC,CAC/C,CAAC"}
@@ -0,0 +1,83 @@
1
+ import { type Infer } from "@metamask/superstruct";
2
+ /**
3
+ * Struct for {@link CreateAccountBip44DerivePathOptions}.
4
+ */
5
+ export declare const CreateAccountBip44DerivePathOptionsStruct: import("@metamask/superstruct").Struct<{
6
+ type: "bip44:derive-path";
7
+ derivationPath: `m/${string}`;
8
+ entropySource: string;
9
+ }, {
10
+ /**
11
+ * Type of the options.
12
+ */
13
+ type: import("@metamask/superstruct").Struct<"bip44:derive-path", "bip44:derive-path">;
14
+ /**
15
+ * ID of the entropy source to be used to derive the account.
16
+ */
17
+ entropySource: import("@metamask/superstruct").Struct<string, null>;
18
+ /**
19
+ * BIP-44 derivation path to be used to derive the account.
20
+ */
21
+ derivationPath: import("@metamask/superstruct").Struct<`m/${string}`, null>;
22
+ }>;
23
+ /**
24
+ * Options for creating an account using the given BIP-44 derivation path.
25
+ */
26
+ export type CreateAccountBip44DerivePathOptions = Infer<typeof CreateAccountBip44DerivePathOptionsStruct>;
27
+ /**
28
+ * Struct for {@link CreateAccountBip44DeriveIndexOptions}.
29
+ */
30
+ export declare const CreateAccountBip44DeriveIndexOptionsStruct: import("@metamask/superstruct").Struct<{
31
+ type: "bip44:derive-index";
32
+ groupIndex: number;
33
+ entropySource: string;
34
+ }, {
35
+ /**
36
+ * The type of the options.
37
+ */
38
+ type: import("@metamask/superstruct").Struct<"bip44:derive-index", "bip44:derive-index">;
39
+ /**
40
+ * ID of the entropy source to be used to derive the account.
41
+ */
42
+ entropySource: import("@metamask/superstruct").Struct<string, null>;
43
+ /**
44
+ * The index of the account group to be derived.
45
+ */
46
+ groupIndex: import("@metamask/superstruct").Struct<number, null>;
47
+ }>;
48
+ /**
49
+ * Options for creating an account using the given BIP-44 account group index.
50
+ *
51
+ * Note that the keyring can support non-standard BIP-44 paths for
52
+ * compatibility with other wallets.
53
+ */
54
+ export type CreateAccountBip44DeriveIndexOptions = Infer<typeof CreateAccountBip44DeriveIndexOptionsStruct>;
55
+ /**
56
+ * Struct for {@link CreateAccountBip44DiscoverOptions}.
57
+ */
58
+ export declare const CreateAccountBip44DiscoverOptionsStruct: import("@metamask/superstruct").Struct<{
59
+ type: "bip44:discover";
60
+ groupIndex: number;
61
+ entropySource: string;
62
+ }, {
63
+ /**
64
+ * The type of the options.
65
+ */
66
+ type: import("@metamask/superstruct").Struct<"bip44:discover", "bip44:discover">;
67
+ /**
68
+ * ID of the entropy source to be used to derive the account.
69
+ */
70
+ entropySource: import("@metamask/superstruct").Struct<string, null>;
71
+ /**
72
+ * The index of the account group to be derived.
73
+ */
74
+ groupIndex: import("@metamask/superstruct").Struct<number, null>;
75
+ }>;
76
+ /**
77
+ * Options for creating accounts by performing a BIP-44 account discovery.
78
+ *
79
+ * Note that the keyring can support non-standard BIP-44 paths for
80
+ * compatibility with other wallets.
81
+ */
82
+ export type CreateAccountBip44DiscoverOptions = Infer<typeof CreateAccountBip44DiscoverOptionsStruct>;
83
+ //# sourceMappingURL=bip44.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bip44.d.mts","sourceRoot":"","sources":["../../../../src/api/v2/create-account/bip44.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,KAAK,EACX,8BAA8B;AAI/B;;GAEG;AACH,eAAO,MAAM,yCAAyC;;;;;IACpD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,KAAK,CACrD,OAAO,yCAAyC,CACjD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0CAA0C;;;;;IACrD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,oCAAoC,GAAG,KAAK,CACtD,OAAO,0CAA0C,CAClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uCAAuC;;;;;IAClD;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,iCAAiC,GAAG,KAAK,CACnD,OAAO,uCAAuC,CAC/C,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { literal, number, object, string } from "@metamask/superstruct";
2
+ import { DerivationPathStruct } from "../../derivation.mjs";
3
+ /**
4
+ * Struct for {@link CreateAccountBip44DerivePathOptions}.
5
+ */
6
+ export const CreateAccountBip44DerivePathOptionsStruct = object({
7
+ /**
8
+ * Type of the options.
9
+ */
10
+ type: literal('bip44:derive-path'),
11
+ /**
12
+ * ID of the entropy source to be used to derive the account.
13
+ */
14
+ entropySource: string(),
15
+ /**
16
+ * BIP-44 derivation path to be used to derive the account.
17
+ */
18
+ derivationPath: DerivationPathStruct,
19
+ });
20
+ /**
21
+ * Struct for {@link CreateAccountBip44DeriveIndexOptions}.
22
+ */
23
+ export const CreateAccountBip44DeriveIndexOptionsStruct = object({
24
+ /**
25
+ * The type of the options.
26
+ */
27
+ type: literal('bip44:derive-index'),
28
+ /**
29
+ * ID of the entropy source to be used to derive the account.
30
+ */
31
+ entropySource: string(),
32
+ /**
33
+ * The index of the account group to be derived.
34
+ */
35
+ groupIndex: number(),
36
+ });
37
+ /**
38
+ * Struct for {@link CreateAccountBip44DiscoverOptions}.
39
+ */
40
+ export const CreateAccountBip44DiscoverOptionsStruct = object({
41
+ /**
42
+ * The type of the options.
43
+ */
44
+ type: literal('bip44:discover'),
45
+ /**
46
+ * ID of the entropy source to be used to derive the account.
47
+ */
48
+ entropySource: string(),
49
+ /**
50
+ * The index of the account group to be derived.
51
+ */
52
+ groupIndex: number(),
53
+ });
54
+ //# sourceMappingURL=bip44.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bip44.mjs","sourceRoot":"","sources":["../../../../src/api/v2/create-account/bip44.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EAEP,8BAA8B;AAE/B,OAAO,EAAE,oBAAoB,EAAE,6BAAyB;AAExD;;GAEG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,MAAM,CAAC;IAC9D;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAClC;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE;IACvB;;OAEG;IACH,cAAc,EAAE,oBAAoB;CACrC,CAAC,CAAC;AASH;;GAEG;AACH,MAAM,CAAC,MAAM,0CAA0C,GAAG,MAAM,CAAC;IAC/D;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,oBAAoB,CAAC;IACnC;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE;IACvB;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE;CACrB,CAAC,CAAC;AAYH;;GAEG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,MAAM,CAAC;IAC5D;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC;IAC/B;;OAEG;IACH,aAAa,EAAE,MAAM,EAAE;IACvB;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE;CACrB,CAAC,CAAC","sourcesContent":["import {\n literal,\n number,\n object,\n string,\n type Infer,\n} from '@metamask/superstruct';\n\nimport { DerivationPathStruct } from '../../derivation';\n\n/**\n * Struct for {@link CreateAccountBip44DerivePathOptions}.\n */\nexport const CreateAccountBip44DerivePathOptionsStruct = object({\n /**\n * Type of the options.\n */\n type: literal('bip44:derive-path'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * BIP-44 derivation path to be used to derive the account.\n */\n derivationPath: DerivationPathStruct,\n});\n\n/**\n * Options for creating an account using the given BIP-44 derivation path.\n */\nexport type CreateAccountBip44DerivePathOptions = Infer<\n typeof CreateAccountBip44DerivePathOptionsStruct\n>;\n\n/**\n * Struct for {@link CreateAccountBip44DeriveIndexOptions}.\n */\nexport const CreateAccountBip44DeriveIndexOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('bip44:derive-index'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * The index of the account group to be derived.\n */\n groupIndex: number(),\n});\n\n/**\n * Options for creating an account using the given BIP-44 account group index.\n *\n * Note that the keyring can support non-standard BIP-44 paths for\n * compatibility with other wallets.\n */\nexport type CreateAccountBip44DeriveIndexOptions = Infer<\n typeof CreateAccountBip44DeriveIndexOptionsStruct\n>;\n\n/**\n * Struct for {@link CreateAccountBip44DiscoverOptions}.\n */\nexport const CreateAccountBip44DiscoverOptionsStruct = object({\n /**\n * The type of the options.\n */\n type: literal('bip44:discover'),\n /**\n * ID of the entropy source to be used to derive the account.\n */\n entropySource: string(),\n /**\n * The index of the account group to be derived.\n */\n groupIndex: number(),\n});\n\n/**\n * Options for creating accounts by performing a BIP-44 account discovery.\n *\n * Note that the keyring can support non-standard BIP-44 paths for\n * compatibility with other wallets.\n */\nexport type CreateAccountBip44DiscoverOptions = Infer<\n typeof CreateAccountBip44DiscoverOptionsStruct\n>;\n"]}