@metamask-previews/keyring-internal-api 10.1.1-7275dbc → 11.0.1-85a9ca9

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,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+
12
+ - Bump `@metamask/keyring-utils` from `^3.2.0` to `^3.3.1` ([#544](https://github.com/MetaMask/accounts/pull/544), [#546](https://github.com/MetaMask/accounts/pull/546))
13
+
14
+ ## [11.0.1]
15
+
16
+ ### Changed
17
+
18
+ - Bump `@metamask/keyring-api` from `^23.0.1` to `^23.1.0` ([#538](https://github.com/MetaMask/accounts/pull/538))
19
+
20
+ ## [11.0.0]
21
+
22
+ ### Removed
23
+
24
+ - **BREAKING:** Removed `InternalAccount.metadata.snap.{enabled,name}` ([#525](https://github.com/MetaMask/accounts/pull/525))
25
+ - Use `SnapController:getSnap` to get those information instead (in combination with `InternalAccount.metadata.snap.id`).
26
+
10
27
  ## [10.1.1]
11
28
 
12
29
  ### Changed
@@ -191,7 +208,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
191
208
  - This new version fixes a bug with CJS re-exports.
192
209
  - Initial release ([#24](https://github.com/MetaMask/accounts/pull/24))
193
210
 
194
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.1.1...HEAD
211
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@11.0.1...HEAD
212
+ [11.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@11.0.0...@metamask/keyring-internal-api@11.0.1
213
+ [11.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.1.1...@metamask/keyring-internal-api@11.0.0
195
214
  [10.1.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.1.0...@metamask/keyring-internal-api@10.1.1
196
215
  [10.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.0.1...@metamask/keyring-internal-api@10.1.0
197
216
  [10.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@10.0.0...@metamask/keyring-internal-api@10.0.1
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubmitRequestResponseV1Struct = exports.KeyringResponseWithoutOriginStruct = exports.KeyringRequestWithoutOriginStruct = void 0;
4
- exports.toKeyringRequestWithoutOrigin = toKeyringRequestWithoutOrigin;
3
+ exports.toKeyringRequestWithoutOrigin = exports.SubmitRequestResponseV1Struct = exports.KeyringResponseWithoutOriginStruct = exports.KeyringRequestWithoutOriginStruct = void 0;
5
4
  const keyring_api_1 = require("@metamask/keyring-api");
6
5
  const superstruct_1 = require("@metamask/superstruct");
7
6
  /**
@@ -25,4 +24,5 @@ function toKeyringRequestWithoutOrigin(request) {
25
24
  const { origin, ...requestV1 } = request;
26
25
  return requestV1;
27
26
  }
27
+ exports.toKeyringRequestWithoutOrigin = toKeyringRequestWithoutOrigin;
28
28
  //# sourceMappingURL=keyring-request.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyring-request.cjs","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":";;;AAoCA,sEAMC;AAzCD,uDAG+B;AAC/B,uDAA6C;AAG7C;;GAEG;AACU,QAAA,iCAAiC,GAAG,IAAA,kBAAI,EAAC,kCAAoB,EAAE;IAC1E,QAAQ;CACT,CAAC,CAAC;AAMH;;GAEG;AACU,QAAA,kCAAkC,GAAG,mCAAqB,CAAC;AAM3D,QAAA,6BAA6B,GAAG,0CAAkC,CAAC;AAEhF;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,OAAuB;IAEvB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAEzC,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { KeyringRequest } from '@metamask/keyring-api';\nimport {\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '@metamask/keyring-api';\nimport { omit } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\n/**\n * Keyring request without `origin` support.\n */\nexport const KeyringRequestWithoutOriginStruct = omit(KeyringRequestStruct, [\n 'origin',\n]);\n\nexport type KeyringRequestWithoutOrigin = Infer<\n typeof KeyringRequestWithoutOriginStruct\n>;\n\n/**\n * Response to a call to `submitRequest` (v1).\n */\nexport const KeyringResponseWithoutOriginStruct = KeyringResponseStruct;\n\nexport type KeyringResponseWithoutOrigin = Infer<\n typeof KeyringResponseWithoutOriginStruct\n>;\n\nexport const SubmitRequestResponseV1Struct = KeyringResponseWithoutOriginStruct;\n\n/**\n * Converts a keyring request to a keyring request v1.\n *\n * @param request - A keyring request.\n * @returns A keyring request v1.\n */\nexport function toKeyringRequestWithoutOrigin(\n request: KeyringRequest,\n): KeyringRequestWithoutOrigin {\n const { origin, ...requestV1 } = request;\n\n return requestV1;\n}\n"]}
1
+ {"version":3,"file":"keyring-request.cjs","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":";;;AACA,uDAG+B;AAC/B,uDAA6C;AAG7C;;GAEG;AACU,QAAA,iCAAiC,GAAG,IAAA,kBAAI,EAAC,kCAAoB,EAAE;IAC1E,QAAQ;CACT,CAAC,CAAC;AAMH;;GAEG;AACU,QAAA,kCAAkC,GAAG,mCAAqB,CAAC;AAM3D,QAAA,6BAA6B,GAAG,0CAAkC,CAAC;AAEhF;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,OAAuB;IAEvB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAEzC,OAAO,SAAS,CAAC;AACnB,CAAC;AAND,sEAMC","sourcesContent":["import type { KeyringRequest } from '@metamask/keyring-api';\nimport {\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '@metamask/keyring-api';\nimport { omit } from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\n\n/**\n * Keyring request without `origin` support.\n */\nexport const KeyringRequestWithoutOriginStruct = omit(KeyringRequestStruct, [\n 'origin',\n]);\n\nexport type KeyringRequestWithoutOrigin = Infer<\n typeof KeyringRequestWithoutOriginStruct\n>;\n\n/**\n * Response to a call to `submitRequest` (v1).\n */\nexport const KeyringResponseWithoutOriginStruct = KeyringResponseStruct;\n\nexport type KeyringResponseWithoutOrigin = Infer<\n typeof KeyringResponseWithoutOriginStruct\n>;\n\nexport const SubmitRequestResponseV1Struct = KeyringResponseWithoutOriginStruct;\n\n/**\n * Converts a keyring request to a keyring request v1.\n *\n * @param request - A keyring request.\n * @returns A keyring request v1.\n */\nexport function toKeyringRequestWithoutOrigin(\n request: KeyringRequest,\n): KeyringRequestWithoutOrigin {\n const { origin, ...requestV1 } = request;\n\n return requestV1;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"keyring-request.d.cts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAM5D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;cAyBL,CAAC;;;;;aAvBxC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;eAjBV,CAAC;WACxB,CAAA;;;;;QAgByD,CAAC;AAExE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;eAvBL,CAAC;WACxB,CAAA;;;;;QAsBiE,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,cAAc,GACtB,2BAA2B,CAI7B"}
1
+ {"version":3,"file":"keyring-request.d.cts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAM5D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;aAE5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;QAAwB,CAAC;AAExE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;QAAqC,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,cAAc,GACtB,2BAA2B,CAI7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"keyring-request.d.mts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAM5D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;cAyBL,CAAC;;;;;aAvBxC,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;eAjBV,CAAC;WACxB,CAAA;;;;;QAgByD,CAAC;AAExE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;eAvBL,CAAC;WACxB,CAAA;;;;;QAsBiE,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,cAAc,GACtB,2BAA2B,CAI7B"}
1
+ {"version":3,"file":"keyring-request.d.mts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAM5D,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAEnD;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;aAE5C,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;QAAwB,CAAC;AAExE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;QAAqC,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,cAAc,GACtB,2BAA2B,CAI7B"}
package/dist/types.cjs CHANGED
@@ -12,8 +12,6 @@ exports.InternalAccountMetadataStruct = (0, keyring_utils_1.object)({
12
12
  nameLastUpdatedAt: (0, keyring_utils_1.exactOptional)((0, superstruct_1.number)()),
13
13
  snap: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
14
14
  id: (0, superstruct_1.string)(),
15
- enabled: (0, superstruct_1.boolean)(),
16
- name: (0, superstruct_1.string)(),
17
15
  })),
18
16
  lastSelected: (0, keyring_utils_1.exactOptional)((0, superstruct_1.number)()),
19
17
  importTime: (0, superstruct_1.number)(),
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,6DAA6D;;;AAE7D,uDAgB+B;AAC/B,2DAAgE;AAEhE,uDAAgE;AASnD,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QA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complaning about our account union even if those accounts\n// types should all be different, so we disable this for now:\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 TrxAccountType,\n TrxEoaAccountStruct,\n XlmAccountType,\n XlmAccountStruct,\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 | TrxAccountType\n | XlmAccountType;\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 const InternalTrxEoaAccountStruct = object({\n ...TrxEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalXlmAccountStruct = object({\n ...XlmAccountStruct.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 type InternalTrxEoaAccount = Infer<typeof InternalTrxEoaAccountStruct>;\n\nexport type InternalXlmAccount = Infer<typeof InternalXlmAccountStruct>;\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 | Struct<InternalTrxEoaAccount>\n | Struct<InternalXlmAccount>\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 [`${TrxAccountType.Eoa}`]: InternalTrxEoaAccountStruct,\n [`${XlmAccountType.Account}`]: InternalXlmAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2pkhAccount\n | InternalBtcP2shAccount\n | InternalBtcP2wpkhAccount\n | InternalBtcP2trAccount\n | InternalSolDataAccount\n | InternalTrxEoaAccount\n | InternalXlmAccount;\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,6EAA6E;AAC7E,6DAA6D;;;AAE7D,uDAgB+B;AAC/B,2DAAgE;AAEhE,uDAAuD;AAS1C,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;SACb,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,C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AAK,EAAE,CAAC,EAAE,qCAA6B;IAC1D,CAAC,GAAG,4BAAc,CAAC,IAAI,EAAE,CAAC,EAAE,oCAA4B;IACxD,CAAC,GAAG,4BAAc,CAAC,MAAM,EAAE,CAAC,EAAE,sCAA8B;IAC5D,CAAC,GAAG,4BAAc,CAAC,IAAI,EAAE,CAAC,EAAE,oCAA4B;IACxD,CAAC,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC,EAAE,oCAA4B;IAC/D,CAAC,GAAG,4BAAc,CAAC,GAAG,EAAE,CAAC,EAAE,mCAA2B;IACtD,CAAC,GAAG,4BAAc,CAAC,OAAO,EAAE,CAAC,EAAE,gCAAwB;CACxD,CAAC;AAaW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["// FIXME: eslint is complaning about our account union even if those accounts\n// types should all be different, so we disable this for now:\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 TrxAccountType,\n TrxEoaAccountStruct,\n XlmAccountType,\n XlmAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType\n | TrxAccountType\n | XlmAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: 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 const InternalTrxEoaAccountStruct = object({\n ...TrxEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalXlmAccountStruct = object({\n ...XlmAccountStruct.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 type InternalTrxEoaAccount = Infer<typeof InternalTrxEoaAccountStruct>;\n\nexport type InternalXlmAccount = Infer<typeof InternalXlmAccountStruct>;\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 | Struct<InternalTrxEoaAccount>\n | Struct<InternalXlmAccount>\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 [`${TrxAccountType.Eoa}`]: InternalTrxEoaAccountStruct,\n [`${XlmAccountType.Account}`]: InternalXlmAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2pkhAccount\n | InternalBtcP2shAccount\n | InternalBtcP2wpkhAccount\n | InternalBtcP2trAccount\n | InternalSolDataAccount\n | InternalTrxEoaAccount\n | InternalXlmAccount;\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"]}