@metamask-previews/keyring-internal-api 7.1.0-9cb78a8 → 8.1.0-a18c779

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,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [8.1.0]
11
+
12
+ ### Added
13
+
14
+ - Add Tron support ([#349](https://github.com/MetaMask/accounts/pull/349))
15
+
16
+ ## [8.0.0]
17
+
18
+ ### Changed
19
+
20
+ - **BREAKING:** Bump `@metamask/keyring-api` from `^19.1.0` to `^20.0.0` ([#347](https://github.com/MetaMask/accounts/pull/347))
21
+ - This change was not properly reported as breaking on the `7.1.0`.
22
+ - Add generic account type.
23
+
10
24
  ## [7.1.0]
11
25
 
12
26
  ### Changed
@@ -125,7 +139,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
125
139
  - This new version fixes a bug with CJS re-exports.
126
140
  - Initial release ([#24](https://github.com/MetaMask/accounts/pull/24))
127
141
 
128
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@7.1.0...HEAD
142
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@8.1.0...HEAD
143
+ [8.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@8.0.0...@metamask/keyring-internal-api@8.1.0
144
+ [8.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@7.1.0...@metamask/keyring-internal-api@8.0.0
129
145
  [7.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@7.0.0...@metamask/keyring-internal-api@7.1.0
130
146
  [7.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@6.2.0...@metamask/keyring-internal-api@7.0.0
131
147
  [6.2.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@6.1.0...@metamask/keyring-internal-api@6.2.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.InternalBtcP2trAccountStruct = exports.InternalBtcP2wpkhAccountStruct = exports.InternalBtcP2shAccountStruct = exports.InternalBtcP2pkhAccountStruct = exports.InternalEthErc4337AccountStruct = exports.InternalEthEoaAccountStruct = exports.InternalAccountMetadataStruct = void 0;
7
+ exports.InternalAccountStruct = exports.InternalAccountStructs = exports.InternalTrxEoaAccountStruct = 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");
@@ -52,6 +52,10 @@ exports.InternalSolDataAccountStruct = (0, keyring_utils_1.object)({
52
52
  ...keyring_api_1.SolDataAccountStruct.schema,
53
53
  ...exports.InternalAccountMetadataStruct.schema,
54
54
  });
55
+ exports.InternalTrxEoaAccountStruct = (0, keyring_utils_1.object)({
56
+ ...keyring_api_1.TrxEoaAccountStruct.schema,
57
+ ...exports.InternalAccountMetadataStruct.schema,
58
+ });
55
59
  exports.InternalAccountStructs = {
56
60
  [`${keyring_api_1.EthAccountType.Eoa}`]: exports.InternalEthEoaAccountStruct,
57
61
  [`${keyring_api_1.EthAccountType.Erc4337}`]: exports.InternalEthErc4337AccountStruct,
@@ -60,6 +64,7 @@ exports.InternalAccountStructs = {
60
64
  [`${keyring_api_1.BtcAccountType.P2wpkh}`]: exports.InternalBtcP2wpkhAccountStruct,
61
65
  [`${keyring_api_1.BtcAccountType.P2tr}`]: exports.InternalBtcP2trAccountStruct,
62
66
  [`${keyring_api_1.SolAccountType.DataAccount}`]: exports.InternalSolDataAccountStruct,
67
+ [`${keyring_api_1.TrxAccountType.Eoa}`]: exports.InternalTrxEoaAccountStruct,
63
68
  };
64
69
  exports.InternalAccountStruct = (0, keyring_utils_1.object)({
65
70
  ...keyring_api_1.KeyringAccountStruct.schema,
@@ -1 +1 @@
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;IAChD,GAAG,iCAAmB,CAAC,MAAM;IAC7B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,IAAA,sB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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"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;;;AAE9B,uDAc+B;AAC/B,2DAAgE;AAEhE,uDAAgE;AAQnD,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,6BAA6B,G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B;IAC/D,CAAC,GAAG,4BAAc,CAAC,GAAG,EAAE,CAAC,EAAE,mCAA2B;CACvD,CAAC;AAYW,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 TrxAccountType,\n TrxEoaAccountStruct,\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\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 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 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> = {\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};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2pkhAccount\n | InternalBtcP2shAccount\n | InternalBtcP2wpkhAccount\n | InternalBtcP2trAccount\n | InternalSolDataAccount\n | InternalTrxEoaAccount;\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
@@ -1,6 +1,6 @@
1
- import { BtcAccountType, EthAccountType, SolAccountType } from "@metamask/keyring-api";
1
+ import { BtcAccountType, EthAccountType, SolAccountType, TrxAccountType } from "@metamask/keyring-api";
2
2
  import type { Infer, Struct } from "@metamask/superstruct";
3
- export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType;
3
+ export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType | TrxAccountType;
4
4
  export declare const InternalAccountMetadataStruct: Struct<{
5
5
  metadata: {
6
6
  name: string;
@@ -655,6 +655,91 @@ export declare const InternalSolDataAccountStruct: Struct<{
655
655
  exportable?: boolean;
656
656
  }, null>;
657
657
  }>;
658
+ export declare const InternalTrxEoaAccountStruct: Struct<{
659
+ type: "tron:eoa";
660
+ id: string;
661
+ options: Record<string, import("@metamask/utils").Json> & {
662
+ entropy?: {
663
+ type: "mnemonic";
664
+ id: string;
665
+ derivationPath: string;
666
+ groupIndex: number;
667
+ } | {
668
+ type: "private-key";
669
+ };
670
+ exportable?: boolean;
671
+ };
672
+ metadata: {
673
+ name: string;
674
+ importTime: number;
675
+ keyring: {
676
+ type: string;
677
+ };
678
+ nameLastUpdatedAt?: number;
679
+ snap?: {
680
+ name: string;
681
+ id: string;
682
+ enabled: boolean;
683
+ };
684
+ lastSelected?: number;
685
+ };
686
+ address: string;
687
+ scopes: `${string}:${string}`[];
688
+ methods: import("@metamask/keyring-api").TrxMethod[];
689
+ }, {
690
+ metadata: Struct<{
691
+ name: string;
692
+ importTime: number;
693
+ keyring: {
694
+ type: string;
695
+ };
696
+ nameLastUpdatedAt?: number;
697
+ snap?: {
698
+ name: string;
699
+ id: string;
700
+ enabled: boolean;
701
+ };
702
+ lastSelected?: number;
703
+ }, {
704
+ name: Struct<string, null>;
705
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
706
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
707
+ name: string;
708
+ id: string;
709
+ enabled: boolean;
710
+ }, {
711
+ id: Struct<string, null>;
712
+ enabled: Struct<boolean, null>;
713
+ name: Struct<string, null>;
714
+ }>;
715
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
716
+ importTime: Struct<number, null>;
717
+ keyring: Struct<{
718
+ type: string;
719
+ }, {
720
+ type: Struct<string, null>;
721
+ }>;
722
+ }>;
723
+ address: import("@metamask/superstruct").Struct<string, null>;
724
+ type: import("@metamask/superstruct").Struct<"tron:eoa", "tron:eoa">;
725
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
726
+ methods: import("@metamask/superstruct").Struct<import("@metamask/keyring-api").TrxMethod[], import("@metamask/superstruct").Struct<import("@metamask/keyring-api").TrxMethod, {
727
+ signMessageV2: import("@metamask/keyring-api").TrxMethod.SignMessageV2;
728
+ verifyMessageV2: import("@metamask/keyring-api").TrxMethod.VerifyMessageV2;
729
+ }>>;
730
+ id: import("@metamask/superstruct").Struct<string, null>;
731
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
732
+ entropy?: {
733
+ type: "mnemonic";
734
+ id: string;
735
+ derivationPath: string;
736
+ groupIndex: number;
737
+ } | {
738
+ type: "private-key";
739
+ };
740
+ exportable?: boolean;
741
+ }, null>;
742
+ }>;
658
743
  export type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
659
744
  export type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
660
745
  export type InternalBtcP2pkhAccount = Infer<typeof InternalBtcP2pkhAccountStruct>;
@@ -662,10 +747,11 @@ export type InternalBtcP2shAccount = Infer<typeof InternalBtcP2shAccountStruct>;
662
747
  export type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStruct>;
663
748
  export type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;
664
749
  export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
665
- export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2pkhAccount> | Struct<InternalBtcP2shAccount> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalBtcP2trAccount> | Struct<InternalSolDataAccount>>;
666
- export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2pkhAccount | InternalBtcP2shAccount | InternalBtcP2wpkhAccount | InternalBtcP2trAccount | InternalSolDataAccount;
750
+ export type InternalTrxEoaAccount = Infer<typeof InternalTrxEoaAccountStruct>;
751
+ export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2pkhAccount> | Struct<InternalBtcP2shAccount> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalBtcP2trAccount> | Struct<InternalSolDataAccount> | Struct<InternalTrxEoaAccount>>;
752
+ export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2pkhAccount | InternalBtcP2shAccount | InternalBtcP2wpkhAccount | InternalBtcP2trAccount | InternalSolDataAccount | InternalTrxEoaAccount;
667
753
  export declare const InternalAccountStruct: Struct<{
668
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
754
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
669
755
  id: string;
670
756
  options: Record<string, import("@metamask/utils").Json> & {
671
757
  entropy?: {
@@ -730,7 +816,7 @@ export declare const InternalAccountStruct: Struct<{
730
816
  }>;
731
817
  }>;
732
818
  id: import("@metamask/superstruct").Struct<string, null>;
733
- type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account", {
819
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
734
820
  "eip155:eoa": "eip155:eoa";
735
821
  "eip155:erc4337": "eip155:erc4337";
736
822
  "bip122:p2pkh": "bip122:p2pkh";
@@ -738,6 +824,7 @@ export declare const InternalAccountStruct: Struct<{
738
824
  "bip122:p2wpkh": "bip122:p2wpkh";
739
825
  "bip122:p2tr": "bip122:p2tr";
740
826
  "solana:data-account": "solana:data-account";
827
+ "tron:eoa": "tron:eoa";
741
828
  "any:account": "any:account";
742
829
  }>;
743
830
  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,EAQf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B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BAAyB,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,GAC9B,MAAM,CAAC,qBAAqB,CAAC,CAUhC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,CAAC;AAE1B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA3BD,CAAC;;;;;;;;kBAOhB,CAAC;;;EAuBjB,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
package/dist/types.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { BtcAccountType, EthAccountType, SolAccountType } from "@metamask/keyring-api";
1
+ import { BtcAccountType, EthAccountType, SolAccountType, TrxAccountType } from "@metamask/keyring-api";
2
2
  import type { Infer, Struct } from "@metamask/superstruct";
3
- export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType;
3
+ export type InternalAccountType = EthAccountType | BtcAccountType | SolAccountType | TrxAccountType;
4
4
  export declare const InternalAccountMetadataStruct: Struct<{
5
5
  metadata: {
6
6
  name: string;
@@ -655,6 +655,91 @@ export declare const InternalSolDataAccountStruct: Struct<{
655
655
  exportable?: boolean;
656
656
  }, null>;
657
657
  }>;
658
+ export declare const InternalTrxEoaAccountStruct: Struct<{
659
+ type: "tron:eoa";
660
+ id: string;
661
+ options: Record<string, import("@metamask/utils").Json> & {
662
+ entropy?: {
663
+ type: "mnemonic";
664
+ id: string;
665
+ derivationPath: string;
666
+ groupIndex: number;
667
+ } | {
668
+ type: "private-key";
669
+ };
670
+ exportable?: boolean;
671
+ };
672
+ metadata: {
673
+ name: string;
674
+ importTime: number;
675
+ keyring: {
676
+ type: string;
677
+ };
678
+ nameLastUpdatedAt?: number;
679
+ snap?: {
680
+ name: string;
681
+ id: string;
682
+ enabled: boolean;
683
+ };
684
+ lastSelected?: number;
685
+ };
686
+ address: string;
687
+ scopes: `${string}:${string}`[];
688
+ methods: import("@metamask/keyring-api").TrxMethod[];
689
+ }, {
690
+ metadata: Struct<{
691
+ name: string;
692
+ importTime: number;
693
+ keyring: {
694
+ type: string;
695
+ };
696
+ nameLastUpdatedAt?: number;
697
+ snap?: {
698
+ name: string;
699
+ id: string;
700
+ enabled: boolean;
701
+ };
702
+ lastSelected?: number;
703
+ }, {
704
+ name: Struct<string, null>;
705
+ nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
706
+ snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
707
+ name: string;
708
+ id: string;
709
+ enabled: boolean;
710
+ }, {
711
+ id: Struct<string, null>;
712
+ enabled: Struct<boolean, null>;
713
+ name: Struct<string, null>;
714
+ }>;
715
+ lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
716
+ importTime: Struct<number, null>;
717
+ keyring: Struct<{
718
+ type: string;
719
+ }, {
720
+ type: Struct<string, null>;
721
+ }>;
722
+ }>;
723
+ address: import("@metamask/superstruct").Struct<string, null>;
724
+ type: import("@metamask/superstruct").Struct<"tron:eoa", "tron:eoa">;
725
+ scopes: import("@metamask/superstruct").Struct<`${string}:${string}`[], import("@metamask/superstruct").Struct<`${string}:${string}`, null>>;
726
+ methods: import("@metamask/superstruct").Struct<import("@metamask/keyring-api").TrxMethod[], import("@metamask/superstruct").Struct<import("@metamask/keyring-api").TrxMethod, {
727
+ signMessageV2: import("@metamask/keyring-api").TrxMethod.SignMessageV2;
728
+ verifyMessageV2: import("@metamask/keyring-api").TrxMethod.VerifyMessageV2;
729
+ }>>;
730
+ id: import("@metamask/superstruct").Struct<string, null>;
731
+ options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> & {
732
+ entropy?: {
733
+ type: "mnemonic";
734
+ id: string;
735
+ derivationPath: string;
736
+ groupIndex: number;
737
+ } | {
738
+ type: "private-key";
739
+ };
740
+ exportable?: boolean;
741
+ }, null>;
742
+ }>;
658
743
  export type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;
659
744
  export type InternalEthErc4337Account = Infer<typeof InternalEthErc4337AccountStruct>;
660
745
  export type InternalBtcP2pkhAccount = Infer<typeof InternalBtcP2pkhAccountStruct>;
@@ -662,10 +747,11 @@ export type InternalBtcP2shAccount = Infer<typeof InternalBtcP2shAccountStruct>;
662
747
  export type InternalBtcP2wpkhAccount = Infer<typeof InternalBtcP2wpkhAccountStruct>;
663
748
  export type InternalBtcP2trAccount = Infer<typeof InternalBtcP2trAccountStruct>;
664
749
  export type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;
665
- export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2pkhAccount> | Struct<InternalBtcP2shAccount> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalBtcP2trAccount> | Struct<InternalSolDataAccount>>;
666
- export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2pkhAccount | InternalBtcP2shAccount | InternalBtcP2wpkhAccount | InternalBtcP2trAccount | InternalSolDataAccount;
750
+ export type InternalTrxEoaAccount = Infer<typeof InternalTrxEoaAccountStruct>;
751
+ export declare const InternalAccountStructs: Record<string, Struct<InternalEthEoaAccount> | Struct<InternalEthErc4337Account> | Struct<InternalBtcP2pkhAccount> | Struct<InternalBtcP2shAccount> | Struct<InternalBtcP2wpkhAccount> | Struct<InternalBtcP2trAccount> | Struct<InternalSolDataAccount> | Struct<InternalTrxEoaAccount>>;
752
+ export type InternalAccountTypes = InternalEthEoaAccount | InternalEthErc4337Account | InternalBtcP2pkhAccount | InternalBtcP2shAccount | InternalBtcP2wpkhAccount | InternalBtcP2trAccount | InternalSolDataAccount | InternalTrxEoaAccount;
667
753
  export declare const InternalAccountStruct: Struct<{
668
- type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account";
754
+ type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
669
755
  id: string;
670
756
  options: Record<string, import("@metamask/utils").Json> & {
671
757
  entropy?: {
@@ -730,7 +816,7 @@ export declare const InternalAccountStruct: Struct<{
730
816
  }>;
731
817
  }>;
732
818
  id: import("@metamask/superstruct").Struct<string, null>;
733
- type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "any:account", {
819
+ type: import("@metamask/superstruct").Struct<"eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account", {
734
820
  "eip155:eoa": "eip155:eoa";
735
821
  "eip155:erc4337": "eip155:erc4337";
736
822
  "bip122:p2pkh": "bip122:p2pkh";
@@ -738,6 +824,7 @@ export declare const InternalAccountStruct: Struct<{
738
824
  "bip122:p2wpkh": "bip122:p2wpkh";
739
825
  "bip122:p2tr": "bip122:p2tr";
740
826
  "solana:data-account": "solana:data-account";
827
+ "tron:eoa": "tron:eoa";
741
828
  "any:account": "any:account";
742
829
  }>;
743
830
  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,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O,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,GAC9B,MAAM,CAAC,qBAAqB,CAAC,CAUhC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,CAAC;AAE1B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA3BD,CAAC;;;;;;;;kBAOhB,CAAC;;;EAuBjB,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, BtcP2pkhAccountStruct, BtcP2shAccountStruct, BtcP2wpkhAccountStruct, BtcP2trAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct } from "@metamask/keyring-api";
5
+ import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2pkhAccountStruct, BtcP2shAccountStruct, BtcP2wpkhAccountStruct, BtcP2trAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct, TrxAccountType, TrxEoaAccountStruct } 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({
@@ -49,6 +49,10 @@ export const InternalSolDataAccountStruct = object({
49
49
  ...SolDataAccountStruct.schema,
50
50
  ...InternalAccountMetadataStruct.schema,
51
51
  });
52
+ export const InternalTrxEoaAccountStruct = object({
53
+ ...TrxEoaAccountStruct.schema,
54
+ ...InternalAccountMetadataStruct.schema,
55
+ });
52
56
  export const InternalAccountStructs = {
53
57
  [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,
54
58
  [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,
@@ -57,6 +61,7 @@ export const InternalAccountStructs = {
57
61
  [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,
58
62
  [`${BtcAccountType.P2tr}`]: InternalBtcP2trAccountStruct,
59
63
  [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,
64
+ [`${TrxAccountType.Eoa}`]: InternalTrxEoaAccountStruct,
60
65
  };
61
66
  export const InternalAccountStruct = object({
62
67
  ...KeyringAccountStruct.schema,
@@ -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,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACrB,8BAA8B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAOhE,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;IAClD,QAAQ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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"]}
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,EACpB,cAAc,EACd,mBAAmB,EACpB,8BAA8B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,OAAO,EAAE,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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;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,GAAG,mBAAmB,CAAC,MAAM;IAC7B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAwBH,MAAM,CAAC,MAAM,sBAAsB,GAU/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;IAC/D,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,2BAA2B;CACvD,CAAC;AAYF,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 TrxAccountType,\n TrxEoaAccountStruct,\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\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 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 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> = {\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};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2pkhAccount\n | InternalBtcP2shAccount\n | InternalBtcP2wpkhAccount\n | InternalBtcP2trAccount\n | InternalSolDataAccount\n | InternalTrxEoaAccount;\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": "7.1.0-9cb78a8",
3
+ "version": "8.1.0-a18c779",
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": "19.1.0",
48
+ "@metamask/keyring-api": "20.1.0",
49
49
  "@metamask/keyring-utils": "3.1.0",
50
50
  "@metamask/superstruct": "^3.1.0"
51
51
  },