@metamask-previews/keyring-internal-api 6.0.1-2d7389c → 6.1.0-1e1233a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.1.0]
11
+
12
+ ### Added
13
+
14
+ - Add support for Bitcoin account type: p2pkh, p2sh, p2tr ([#284](https://github.com/MetaMask/accounts/pull/284))
15
+ - Bump `@metamask/keyring-api` from `^17.4.0` to `^17.6.0` ([#277](https://github.com/MetaMask/accounts/pull/277)), ([#288](https://github.com/MetaMask/accounts/pull/288))
16
+
10
17
  ## [6.0.1]
11
18
 
12
19
  ### Changed
@@ -92,7 +99,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
92
99
  - This new version fixes a bug with CJS re-exports.
93
100
  - Initial release ([#24](https://github.com/MetaMask/accounts/pull/24))
94
101
 
95
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@6.0.1...HEAD
102
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@6.1.0...HEAD
103
+ [6.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@6.0.1...@metamask/keyring-internal-api@6.1.0
96
104
  [6.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@6.0.0...@metamask/keyring-internal-api@6.0.1
97
105
  [6.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@5.0.0...@metamask/keyring-internal-api@6.0.0
98
106
  [5.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@4.0.3...@metamask/keyring-internal-api@5.0.0
package/dist/types.cjs CHANGED
@@ -4,7 +4,7 @@
4
4
  // FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`
5
5
  // and `InternalAccountTypes`.
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.InternalAccountStruct = exports.InternalAccountStructs = exports.InternalSolDataAccountStruct = exports.InternalBtcP2wpkhAccountStruct = exports.InternalEthErc4337AccountStruct = exports.InternalEthEoaAccountStruct = exports.InternalAccountMetadataStruct = void 0;
7
+ exports.InternalAccountStruct = exports.InternalAccountStructs = exports.InternalSolDataAccountStruct = exports.InternalBtcP2trAccountStruct = exports.InternalBtcP2wpkhAccountStruct = exports.InternalBtcP2shAccountStruct = exports.InternalBtcP2pkhAccountStruct = exports.InternalEthErc4337AccountStruct = exports.InternalEthEoaAccountStruct = exports.InternalAccountMetadataStruct = void 0;
8
8
  const keyring_api_1 = require("@metamask/keyring-api");
9
9
  const keyring_utils_1 = require("@metamask/keyring-utils");
10
10
  const superstruct_1 = require("@metamask/superstruct");
@@ -32,10 +32,22 @@ exports.InternalEthErc4337AccountStruct = (0, keyring_utils_1.object)({
32
32
  ...keyring_api_1.EthErc4337AccountStruct.schema,
33
33
  ...exports.InternalAccountMetadataStruct.schema,
34
34
  });
35
+ exports.InternalBtcP2pkhAccountStruct = (0, keyring_utils_1.object)({
36
+ ...keyring_api_1.BtcP2pkhAccountStruct.schema,
37
+ ...exports.InternalAccountMetadataStruct.schema,
38
+ });
39
+ exports.InternalBtcP2shAccountStruct = (0, keyring_utils_1.object)({
40
+ ...keyring_api_1.BtcP2shAccountStruct.schema,
41
+ ...exports.InternalAccountMetadataStruct.schema,
42
+ });
35
43
  exports.InternalBtcP2wpkhAccountStruct = (0, keyring_utils_1.object)({
36
44
  ...keyring_api_1.BtcP2wpkhAccountStruct.schema,
37
45
  ...exports.InternalAccountMetadataStruct.schema,
38
46
  });
47
+ exports.InternalBtcP2trAccountStruct = (0, keyring_utils_1.object)({
48
+ ...keyring_api_1.BtcP2trAccountStruct.schema,
49
+ ...exports.InternalAccountMetadataStruct.schema,
50
+ });
39
51
  exports.InternalSolDataAccountStruct = (0, keyring_utils_1.object)({
40
52
  ...keyring_api_1.SolDataAccountStruct.schema,
41
53
  ...exports.InternalAccountMetadataStruct.schema,
@@ -43,7 +55,10 @@ exports.InternalSolDataAccountStruct = (0, keyring_utils_1.object)({
43
55
  exports.InternalAccountStructs = {
44
56
  [`${keyring_api_1.EthAccountType.Eoa}`]: exports.InternalEthEoaAccountStruct,
45
57
  [`${keyring_api_1.EthAccountType.Erc4337}`]: exports.InternalEthErc4337AccountStruct,
58
+ [`${keyring_api_1.BtcAccountType.P2pkh}`]: exports.InternalBtcP2pkhAccountStruct,
59
+ [`${keyring_api_1.BtcAccountType.P2sh}`]: exports.InternalBtcP2shAccountStruct,
46
60
  [`${keyring_api_1.BtcAccountType.P2wpkh}`]: exports.InternalBtcP2wpkhAccountStruct,
61
+ [`${keyring_api_1.BtcAccountType.P2tr}`]: exports.InternalBtcP2trAccountStruct,
47
62
  [`${keyring_api_1.SolAccountType.DataAccount}`]: exports.InternalSolDataAccountStruct,
48
63
  };
49
64
  exports.InternalAccountStruct = (0, keyring_utils_1.object)({
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;;;AAE9B,uDAS+B;AAC/B,2DAAgE;AAEhE,uDAAgE;AAOnD,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QAAQ,EAAE,IAAA,sBAAM,EAAC;QACf,IAAI,EAAE,IAAA,oBAAM,GAAE;QACd,iBAAiB,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAC1C,IAAI,EAAE,IAAA,6BAAa,EACjB,IAAA,sBAAM,EAAC;YACL,EAAE,EAAE,IAAA,oBAAM,GAAE;YACZ,OAAO,EAAE,IAAA,qBAAO,GAAE;YAClB,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC,CACH;QACD,YAAY,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QACrC,UAAU,EAAE,IAAA,oBAAM,GAAE;QACpB,OAAO,EAAE,IAAA,sBAAM,EAAC;YACd,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,GAAG,iCAAmB,CAAC,MAAM;IAC7B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,IAAA,sBAAM,EAAC;IACpD,GAAG,qCAAuB,CAAC,MAAM;IACjC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,IAAA,sBAAM,EAAC;IACnD,GAAG,oCAAsB,CAAC,MAAM;IAChC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,IAAA,sBAAM,EAAC;IACjD,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAcU,QAAA,sBAAsB,GAM/B;IACF,CAAC,GAAG,4BAAc,CAAC,GAAG,EAAE,CAAC,EAAE,mCAA2B;IACtD,CAAC,GAAG,4BAAc,CAAC,OAAO,EAAE,CAAC,EAAE,uCAA+B;IAC9D,CAAC,GAAG,4BAAc,CAAC,MAAM,EAAE,CAAC,EAAE,sCAA8B;IAC5D,CAAC,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC,EAAE,oCAA4B;CAChE,CAAC;AAQW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2wpkhAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2wpkhAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;;;AAE9B,uDAY+B;AAC/B,2DAAgE;AAEhE,uDAAgE;AAOnD,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QAAQ,EAAE,IAAA,sBAAM,EAAC;QACf,IAAI,EAAE,IAAA,oBAAM,GAAE;QACd,iBAAiB,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAC1C,IAAI,EAAE,IAAA,6BAAa,EACjB,IAAA,sBAAM,EAAC;YACL,EAAE,EAAE,IAAA,oBAAM,GAAE;YACZ,OAAO,EAAE,IAAA,qBAAO,GAAE;YAClB,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC,CACH;QACD,YAAY,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QACrC,UAAU,EAAE,IAAA,oBAAM,GAAE;QACpB,OAAO,EAAE,IAAA,sBAAM,EAAC;YACd,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC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BAAc,CAAC,IAAI,EAAE,CAAC,EAAE,oCAA4B;IACxD,CAAC,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC,EAAE,oCAA4B;CAChE,CAAC;AAWW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2pkhAccountStruct,\n BtcP2shAccountStruct,\n BtcP2wpkhAccountStruct,\n BtcP2trAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2pkhAccountStruct = object({\n ...BtcP2pkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2shAccountStruct = object({\n ...BtcP2shAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2trAccountStruct = object({\n ...BtcP2trAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2pkhAccount = Infer<\n typeof InternalBtcP2pkhAccountStruct\n>;\n\nexport type InternalBtcP2shAccount = Infer<typeof InternalBtcP2shAccountStruct>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2pkhAccount>\n | Struct<InternalBtcP2shAccount>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalBtcP2trAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2pkh}`]: InternalBtcP2pkhAccountStruct,\n [`${BtcAccountType.P2sh}`]: InternalBtcP2shAccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${BtcAccountType.P2tr}`]: InternalBtcP2trAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2pkhAccount\n | InternalBtcP2shAccount\n | InternalBtcP2wpkhAccount\n | InternalBtcP2trAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
package/dist/types.d.cts CHANGED
@@ -191,6 +191,134 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
191
191
  id: import("@metamask/superstruct").Struct<string, null>;
192
192
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
193
193
  }>;
194
+ export declare const InternalBtcP2pkhAccountStruct: Struct<{
195
+ type: "bip122:p2pkh";
196
+ id: string;
197
+ options: Record<string, import("@metamask/utils").Json>;
198
+ metadata: {
199
+ name: string;
200
+ importTime: number;
201
+ keyring: {
202
+ type: string;
203
+ };
204
+ nameLastUpdatedAt?: number;
205
+ snap?: {
206
+ name: string;
207
+ id: string;
208
+ enabled: boolean;
209
+ };
210
+ lastSelected?: number;
211
+ };
212
+ address: string;
213
+ scopes: `${string}:${string}`[];
214
+ methods: "sendBitcoin"[];
215
+ }, {
216
+ metadata: Struct<{
217
+ name: string;
218
+ importTime: number;
219
+ keyring: {
220
+ type: string;
221
+ };
222
+ nameLastUpdatedAt?: number;
223
+ snap?: {
224
+ name: string;
225
+ id: string;
226
+ enabled: boolean;
227
+ };
228
+ lastSelected?: number;
229
+ }, {
230
+ name: Struct<string, null>;
231
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
232
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
233
+ name: string;
234
+ id: string;
235
+ enabled: boolean;
236
+ }, {
237
+ id: Struct<string, null>;
238
+ enabled: Struct<boolean, null>;
239
+ name: Struct<string, null>;
240
+ }>;
241
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
242
+ importTime: Struct<number, null>;
243
+ keyring: Struct<{
244
+ type: string;
245
+ }, {
246
+ type: Struct<string, null>;
247
+ }>;
248
+ }>;
249
+ address: import("@metamask/superstruct").Struct<string, null>;
250
+ type: import("@metamask/superstruct").Struct<"bip122:p2pkh", "bip122:p2pkh">;
251
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
252
+ methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
253
+ sendBitcoin: "sendBitcoin";
254
+ }>>;
255
+ id: import("@metamask/superstruct").Struct<string, null>;
256
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
257
+ }>;
258
+ export declare const InternalBtcP2shAccountStruct: Struct<{
259
+ type: "bip122:p2sh";
260
+ id: string;
261
+ options: Record<string, import("@metamask/utils").Json>;
262
+ metadata: {
263
+ name: string;
264
+ importTime: number;
265
+ keyring: {
266
+ type: string;
267
+ };
268
+ nameLastUpdatedAt?: number;
269
+ snap?: {
270
+ name: string;
271
+ id: string;
272
+ enabled: boolean;
273
+ };
274
+ lastSelected?: number;
275
+ };
276
+ address: string;
277
+ scopes: `${string}:${string}`[];
278
+ methods: "sendBitcoin"[];
279
+ }, {
280
+ metadata: Struct<{
281
+ name: string;
282
+ importTime: number;
283
+ keyring: {
284
+ type: string;
285
+ };
286
+ nameLastUpdatedAt?: number;
287
+ snap?: {
288
+ name: string;
289
+ id: string;
290
+ enabled: boolean;
291
+ };
292
+ lastSelected?: number;
293
+ }, {
294
+ name: Struct<string, null>;
295
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
296
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
297
+ name: string;
298
+ id: string;
299
+ enabled: boolean;
300
+ }, {
301
+ id: Struct<string, null>;
302
+ enabled: Struct<boolean, null>;
303
+ name: Struct<string, null>;
304
+ }>;
305
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
306
+ importTime: Struct<number, null>;
307
+ keyring: Struct<{
308
+ type: string;
309
+ }, {
310
+ type: Struct<string, null>;
311
+ }>;
312
+ }>;
313
+ address: import("@metamask/superstruct").Struct<string, null>;
314
+ type: import("@metamask/superstruct").Struct<"bip122:p2sh", "bip122:p2sh">;
315
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
316
+ methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
317
+ sendBitcoin: "sendBitcoin";
318
+ }>>;
319
+ id: import("@metamask/superstruct").Struct<string, null>;
320
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
321
+ }>;
194
322
  export declare const InternalBtcP2wpkhAccountStruct: Struct<{
195
323
  type: "bip122:p2wpkh";
196
324
  id: string;
@@ -255,6 +383,70 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
255
383
  id: import("@metamask/superstruct").Struct<string, null>;
256
384
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
257
385
  }>;
386
+ export declare const InternalBtcP2trAccountStruct: Struct<{
387
+ type: "bip122:p2tr";
388
+ id: string;
389
+ options: Record<string, import("@metamask/utils").Json>;
390
+ metadata: {
391
+ name: string;
392
+ importTime: number;
393
+ keyring: {
394
+ type: string;
395
+ };
396
+ nameLastUpdatedAt?: number;
397
+ snap?: {
398
+ name: string;
399
+ id: string;
400
+ enabled: boolean;
401
+ };
402
+ lastSelected?: number;
403
+ };
404
+ address: string;
405
+ scopes: `${string}:${string}`[];
406
+ methods: "sendBitcoin"[];
407
+ }, {
408
+ metadata: Struct<{
409
+ name: string;
410
+ importTime: number;
411
+ keyring: {
412
+ type: string;
413
+ };
414
+ nameLastUpdatedAt?: number;
415
+ snap?: {
416
+ name: string;
417
+ id: string;
418
+ enabled: boolean;
419
+ };
420
+ lastSelected?: number;
421
+ }, {
422
+ name: Struct<string, null>;
423
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
424
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
425
+ name: string;
426
+ id: string;
427
+ enabled: boolean;
428
+ }, {
429
+ id: Struct<string, null>;
430
+ enabled: Struct<boolean, null>;
431
+ name: Struct<string, null>;
432
+ }>;
433
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
434
+ importTime: Struct<number, null>;
435
+ keyring: Struct<{
436
+ type: string;
437
+ }, {
438
+ type: Struct<string, null>;
439
+ }>;
440
+ }>;
441
+ address: import("@metamask/superstruct").Struct<string, null>;
442
+ type: import("@metamask/superstruct").Struct<"bip122:p2tr", "bip122:p2tr">;
443
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
444
+ methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
445
+ sendBitcoin: "sendBitcoin";
446
+ }>>;
447
+ id: import("@metamask/superstruct").Struct<string, null>;
448
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
449
+ }>;
258
450
  export declare const InternalSolDataAccountStruct: Struct<{
259
451
  type: "solana:data-account";
260
452
  id: string;
@@ -325,12 +517,15 @@ export declare const InternalSolDataAccountStruct: Struct<{
325
517
  }>;
326
518
  export type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
327
519
  export type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
520
+ export type InternalBtcP2pkhAccount = Infer<typeof InternalBtcP2pkhAccountStruct>;
521
+ export type InternalBtcP2shAccount = Infer<typeof InternalBtcP2shAccountStruct>;
328
522
  export type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStruct>;
523
+ export type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;
329
524
  export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
330
- export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalSolDataAccount>>;
331
- export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2wpkhAccount | InternalSolDataAccount;
525
+ export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2pkhAccount> | Struct<InternalBtcP2shAccount> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalBtcP2trAccount> | Struct<InternalSolDataAccount>>;
526
+ export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2pkhAccount | InternalBtcP2shAccount | InternalBtcP2wpkhAccount | InternalBtcP2trAccount | InternalSolDataAccount;
332
527
  export declare const InternalAccountStruct: Struct<{
333
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
528
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
334
529
  id: string;
335
530
  options: Record<string, import("@metamask/utils").Json>;
336
531
  metadata: {
@@ -385,10 +580,13 @@ export declare const InternalAccountStruct: Struct<{
385
580
  }>;
386
581
  }>;
387
582
  id: import("@metamask/superstruct").Struct<string, null>;
388
- type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
583
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account", {
389
584
  "eip155:eoa": "eip155:eoa";
390
585
  "eip155:erc4337": "eip155:erc4337";
586
+ "bip122:p2pkh": "bip122:p2pkh";
587
+ "bip122:p2sh": "bip122:p2sh";
391
588
  "bip122:p2wpkh": "bip122:p2wpkh";
589
+ "bip122:p2tr": "bip122:p2tr";
392
590
  "solana:data-account": "solana:data-account";
393
591
  }>;
394
592
  address: import("@metamask/superstruct").Struct<string, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EAKf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAG3D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG1C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGzC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,MAAM,MAAM,yBAAyB,GAAG,KAAK,CAC3C,OAAO,+BAA+B,CACvC,CAAC;AAEF,MAAM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AAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,wBAAwB,CAAC,GAChC,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,sBAAsB,CAAC,CASjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGhC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
package/dist/types.d.mts CHANGED
@@ -191,6 +191,134 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
191
191
  id: import("@metamask/superstruct").Struct<string, null>;
192
192
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
193
193
  }>;
194
+ export declare const InternalBtcP2pkhAccountStruct: Struct<{
195
+ type: "bip122:p2pkh";
196
+ id: string;
197
+ options: Record<string, import("@metamask/utils").Json>;
198
+ metadata: {
199
+ name: string;
200
+ importTime: number;
201
+ keyring: {
202
+ type: string;
203
+ };
204
+ nameLastUpdatedAt?: number;
205
+ snap?: {
206
+ name: string;
207
+ id: string;
208
+ enabled: boolean;
209
+ };
210
+ lastSelected?: number;
211
+ };
212
+ address: string;
213
+ scopes: `${string}:${string}`[];
214
+ methods: "sendBitcoin"[];
215
+ }, {
216
+ metadata: Struct<{
217
+ name: string;
218
+ importTime: number;
219
+ keyring: {
220
+ type: string;
221
+ };
222
+ nameLastUpdatedAt?: number;
223
+ snap?: {
224
+ name: string;
225
+ id: string;
226
+ enabled: boolean;
227
+ };
228
+ lastSelected?: number;
229
+ }, {
230
+ name: Struct<string, null>;
231
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
232
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
233
+ name: string;
234
+ id: string;
235
+ enabled: boolean;
236
+ }, {
237
+ id: Struct<string, null>;
238
+ enabled: Struct<boolean, null>;
239
+ name: Struct<string, null>;
240
+ }>;
241
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
242
+ importTime: Struct<number, null>;
243
+ keyring: Struct<{
244
+ type: string;
245
+ }, {
246
+ type: Struct<string, null>;
247
+ }>;
248
+ }>;
249
+ address: import("@metamask/superstruct").Struct<string, null>;
250
+ type: import("@metamask/superstruct").Struct<"bip122:p2pkh", "bip122:p2pkh">;
251
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
252
+ methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
253
+ sendBitcoin: "sendBitcoin";
254
+ }>>;
255
+ id: import("@metamask/superstruct").Struct<string, null>;
256
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
257
+ }>;
258
+ export declare const InternalBtcP2shAccountStruct: Struct<{
259
+ type: "bip122:p2sh";
260
+ id: string;
261
+ options: Record<string, import("@metamask/utils").Json>;
262
+ metadata: {
263
+ name: string;
264
+ importTime: number;
265
+ keyring: {
266
+ type: string;
267
+ };
268
+ nameLastUpdatedAt?: number;
269
+ snap?: {
270
+ name: string;
271
+ id: string;
272
+ enabled: boolean;
273
+ };
274
+ lastSelected?: number;
275
+ };
276
+ address: string;
277
+ scopes: `${string}:${string}`[];
278
+ methods: "sendBitcoin"[];
279
+ }, {
280
+ metadata: Struct<{
281
+ name: string;
282
+ importTime: number;
283
+ keyring: {
284
+ type: string;
285
+ };
286
+ nameLastUpdatedAt?: number;
287
+ snap?: {
288
+ name: string;
289
+ id: string;
290
+ enabled: boolean;
291
+ };
292
+ lastSelected?: number;
293
+ }, {
294
+ name: Struct<string, null>;
295
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
296
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
297
+ name: string;
298
+ id: string;
299
+ enabled: boolean;
300
+ }, {
301
+ id: Struct<string, null>;
302
+ enabled: Struct<boolean, null>;
303
+ name: Struct<string, null>;
304
+ }>;
305
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
306
+ importTime: Struct<number, null>;
307
+ keyring: Struct<{
308
+ type: string;
309
+ }, {
310
+ type: Struct<string, null>;
311
+ }>;
312
+ }>;
313
+ address: import("@metamask/superstruct").Struct<string, null>;
314
+ type: import("@metamask/superstruct").Struct<"bip122:p2sh", "bip122:p2sh">;
315
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
316
+ methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
317
+ sendBitcoin: "sendBitcoin";
318
+ }>>;
319
+ id: import("@metamask/superstruct").Struct<string, null>;
320
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
321
+ }>;
194
322
  export declare const InternalBtcP2wpkhAccountStruct: Struct<{
195
323
  type: "bip122:p2wpkh";
196
324
  id: string;
@@ -255,6 +383,70 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
255
383
  id: import("@metamask/superstruct").Struct<string, null>;
256
384
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
257
385
  }>;
386
+ export declare const InternalBtcP2trAccountStruct: Struct<{
387
+ type: "bip122:p2tr";
388
+ id: string;
389
+ options: Record<string, import("@metamask/utils").Json>;
390
+ metadata: {
391
+ name: string;
392
+ importTime: number;
393
+ keyring: {
394
+ type: string;
395
+ };
396
+ nameLastUpdatedAt?: number;
397
+ snap?: {
398
+ name: string;
399
+ id: string;
400
+ enabled: boolean;
401
+ };
402
+ lastSelected?: number;
403
+ };
404
+ address: string;
405
+ scopes: `${string}:${string}`[];
406
+ methods: "sendBitcoin"[];
407
+ }, {
408
+ metadata: Struct<{
409
+ name: string;
410
+ importTime: number;
411
+ keyring: {
412
+ type: string;
413
+ };
414
+ nameLastUpdatedAt?: number;
415
+ snap?: {
416
+ name: string;
417
+ id: string;
418
+ enabled: boolean;
419
+ };
420
+ lastSelected?: number;
421
+ }, {
422
+ name: Struct<string, null>;
423
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
424
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
425
+ name: string;
426
+ id: string;
427
+ enabled: boolean;
428
+ }, {
429
+ id: Struct<string, null>;
430
+ enabled: Struct<boolean, null>;
431
+ name: Struct<string, null>;
432
+ }>;
433
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
434
+ importTime: Struct<number, null>;
435
+ keyring: Struct<{
436
+ type: string;
437
+ }, {
438
+ type: Struct<string, null>;
439
+ }>;
440
+ }>;
441
+ address: import("@metamask/superstruct").Struct<string, null>;
442
+ type: import("@metamask/superstruct").Struct<"bip122:p2tr", "bip122:p2tr">;
443
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
444
+ methods: import("@metamask/superstruct").Struct<"sendBitcoin"[], import("@metamask/superstruct").Struct<"sendBitcoin", {
445
+ sendBitcoin: "sendBitcoin";
446
+ }>>;
447
+ id: import("@metamask/superstruct").Struct<string, null>;
448
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
449
+ }>;
258
450
  export declare const InternalSolDataAccountStruct: Struct<{
259
451
  type: "solana:data-account";
260
452
  id: string;
@@ -325,12 +517,15 @@ export declare const InternalSolDataAccountStruct: Struct<{
325
517
  }>;
326
518
  export type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
327
519
  export type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
520
+ export type InternalBtcP2pkhAccount = Infer<typeof InternalBtcP2pkhAccountStruct>;
521
+ export type InternalBtcP2shAccount = Infer<typeof InternalBtcP2shAccountStruct>;
328
522
  export type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStruct>;
523
+ export type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;
329
524
  export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
330
- export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalSolDataAccount>>;
331
- export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2wpkhAccount | InternalSolDataAccount;
525
+ export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2pkhAccount> | Struct<InternalBtcP2shAccount> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalBtcP2trAccount> | Struct<InternalSolDataAccount>>;
526
+ export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2pkhAccount | InternalBtcP2shAccount | InternalBtcP2wpkhAccount | InternalBtcP2trAccount | InternalSolDataAccount;
332
527
  export declare const InternalAccountStruct: Struct<{
333
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account";
528
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account";
334
529
  id: string;
335
530
  options: Record<string, import("@metamask/utils").Json>;
336
531
  metadata: {
@@ -385,10 +580,13 @@ export declare const InternalAccountStruct: Struct<{
385
580
  }>;
386
581
  }>;
387
582
  id: import("@metamask/superstruct").Struct<string, null>;
388
- type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2wpkh" | "solana:data-account", {
583
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account", {
389
584
  "eip155:eoa": "eip155:eoa";
390
585
  "eip155:erc4337": "eip155:erc4337";
586
+ "bip122:p2pkh": "bip122:p2pkh";
587
+ "bip122:p2sh": "bip122:p2sh";
391
588
  "bip122:p2wpkh": "bip122:p2wpkh";
589
+ "bip122:p2tr": "bip122:p2tr";
392
590
  "solana:data-account": "solana:data-account";
393
591
  }>;
394
592
  address: import("@metamask/superstruct").Struct<string, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EAKf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAG3D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG1C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGzC,CAAC;AAEH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGvC,CAAC;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AO,MAAM,sBAAsB,EAAE,MAAM,CACzC,MAAM,EACJ,MAAM,CAAC,qBAAqB,CAAC,GAC7B,MAAM,CAAC,yBAAyB,CAAC,GACjC,MAAM,CAAC,uBAAuB,CAAC,GAC/B,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,wBAAwB,CAAC,GAChC,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,sBAAsB,CAAC,CASjC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGhC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
package/dist/types.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
3
3
  // FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`
4
4
  // and `InternalAccountTypes`.
5
- import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2wpkhAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct } from "@metamask/keyring-api";
5
+ import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2pkhAccountStruct, BtcP2shAccountStruct, BtcP2wpkhAccountStruct, BtcP2trAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct } from "@metamask/keyring-api";
6
6
  import { exactOptional, object } from "@metamask/keyring-utils";
7
7
  import { boolean, string, number } from "@metamask/superstruct";
8
8
  export const InternalAccountMetadataStruct = object({
@@ -29,10 +29,22 @@ export const InternalEthErc4337AccountStruct = object({
29
29
  ...EthErc4337AccountStruct.schema,
30
30
  ...InternalAccountMetadataStruct.schema,
31
31
  });
32
+ export const InternalBtcP2pkhAccountStruct = object({
33
+ ...BtcP2pkhAccountStruct.schema,
34
+ ...InternalAccountMetadataStruct.schema,
35
+ });
36
+ export const InternalBtcP2shAccountStruct = object({
37
+ ...BtcP2shAccountStruct.schema,
38
+ ...InternalAccountMetadataStruct.schema,
39
+ });
32
40
  export const InternalBtcP2wpkhAccountStruct = object({
33
41
  ...BtcP2wpkhAccountStruct.schema,
34
42
  ...InternalAccountMetadataStruct.schema,
35
43
  });
44
+ export const InternalBtcP2trAccountStruct = object({
45
+ ...BtcP2trAccountStruct.schema,
46
+ ...InternalAccountMetadataStruct.schema,
47
+ });
36
48
  export const InternalSolDataAccountStruct = object({
37
49
  ...SolDataAccountStruct.schema,
38
50
  ...InternalAccountMetadataStruct.schema,
@@ -40,7 +52,10 @@ export const InternalSolDataAccountStruct = object({
40
52
  export const InternalAccountStructs = {
41
53
  [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,
42
54
  [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,
55
+ [`${BtcAccountType.P2pkh}`]: InternalBtcP2pkhAccountStruct,
56
+ [`${BtcAccountType.P2sh}`]: InternalBtcP2shAccountStruct,
43
57
  [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,
58
+ [`${BtcAccountType.P2tr}`]: InternalBtcP2trAccountStruct,
44
59
  [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,
45
60
  };
46
61
  export const InternalAccountStruct = object({
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;AAE9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,oB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AAE,CAAC,EAAE,2BAA2B;IACtD,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,+BAA+B;IAC9D,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,8BAA8B;IAC5D,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,EAAE,4BAA4B;CAChE,CAAC;AAQF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;IAC1C,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2wpkhAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2wpkhAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;AAE9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACrB,8BAA8B;AAC/B,OAAO,EAAE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M;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAsBH,MAAM,CAAC,MAAM,sBAAsB,GAS/B;IACF,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,2BAA2B;IACtD,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,+BAA+B;IAC9D,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,6BAA6B;IAC1D,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,4BAA4B;IACxD,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,8BAA8B;IAC5D,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,4BAA4B;IACxD,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,EAAE,4BAA4B;CAChE,CAAC;AAWF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;IAC1C,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2pkhAccountStruct,\n BtcP2shAccountStruct,\n BtcP2wpkhAccountStruct,\n BtcP2trAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2pkhAccountStruct = object({\n ...BtcP2pkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2shAccountStruct = object({\n ...BtcP2shAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2trAccountStruct = object({\n ...BtcP2trAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2pkhAccount = Infer<\n typeof InternalBtcP2pkhAccountStruct\n>;\n\nexport type InternalBtcP2shAccount = Infer<typeof InternalBtcP2shAccountStruct>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2pkhAccount>\n | Struct<InternalBtcP2shAccount>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalBtcP2trAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2pkh}`]: InternalBtcP2pkhAccountStruct,\n [`${BtcAccountType.P2sh}`]: InternalBtcP2shAccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${BtcAccountType.P2tr}`]: InternalBtcP2trAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2pkhAccount\n | InternalBtcP2shAccount\n | InternalBtcP2wpkhAccount\n | InternalBtcP2trAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/keyring-internal-api",
3
- "version": "6.0.1-2d7389c",
3
+ "version": "6.1.0-1e1233a",
4
4
  "description": "MetaMask Keyring Internal API",
5
5
  "keywords": [
6
6
  "metamask",
@@ -45,7 +45,7 @@
45
45
  "test:watch": "jest --watch"
46
46
  },
47
47
  "dependencies": {
48
- "@metamask/keyring-api": "17.5.0",
48
+ "@metamask/keyring-api": "17.6.0",
49
49
  "@metamask/keyring-utils": "3.0.0",
50
50
  "@metamask/superstruct": "^3.1.0"
51
51
  },