@metamask/keyring-api 12.0.0 → 13.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +12 -1
  2. package/dist/api/account.cjs +4 -0
  3. package/dist/api/account.cjs.map +1 -1
  4. package/dist/api/account.d.cts +5 -0
  5. package/dist/api/account.d.cts.map +1 -1
  6. package/dist/api/account.d.mts +5 -0
  7. package/dist/api/account.d.mts.map +1 -1
  8. package/dist/api/account.mjs +6 -2
  9. package/dist/api/account.mjs.map +1 -1
  10. package/dist/btc/constants.cjs +17 -0
  11. package/dist/btc/constants.cjs.map +1 -0
  12. package/dist/btc/constants.d.cts +12 -0
  13. package/dist/btc/constants.d.cts.map +1 -0
  14. package/dist/btc/constants.d.mts +12 -0
  15. package/dist/btc/constants.d.mts.map +1 -0
  16. package/dist/btc/constants.mjs +14 -0
  17. package/dist/btc/constants.mjs.map +1 -0
  18. package/dist/btc/index.cjs +1 -0
  19. package/dist/btc/index.cjs.map +1 -1
  20. package/dist/btc/index.d.cts +1 -0
  21. package/dist/btc/index.d.cts.map +1 -1
  22. package/dist/btc/index.d.mts +1 -0
  23. package/dist/btc/index.d.mts.map +1 -1
  24. package/dist/btc/index.mjs +1 -0
  25. package/dist/btc/index.mjs.map +1 -1
  26. package/dist/btc/types.d.cts +2 -0
  27. package/dist/btc/types.d.cts.map +1 -1
  28. package/dist/btc/types.d.mts +2 -0
  29. package/dist/btc/types.d.mts.map +1 -1
  30. package/dist/eth/constants.cjs +13 -0
  31. package/dist/eth/constants.cjs.map +1 -0
  32. package/dist/eth/constants.d.cts +8 -0
  33. package/dist/eth/constants.d.cts.map +1 -0
  34. package/dist/eth/constants.d.mts +8 -0
  35. package/dist/eth/constants.d.mts.map +1 -0
  36. package/dist/eth/constants.mjs +10 -0
  37. package/dist/eth/constants.mjs.map +1 -0
  38. package/dist/eth/index.cjs +1 -0
  39. package/dist/eth/index.cjs.map +1 -1
  40. package/dist/eth/index.d.cts +1 -0
  41. package/dist/eth/index.d.cts.map +1 -1
  42. package/dist/eth/index.d.mts +1 -0
  43. package/dist/eth/index.d.mts.map +1 -1
  44. package/dist/eth/index.mjs +1 -0
  45. package/dist/eth/index.mjs.map +1 -1
  46. package/dist/eth/types.cjs +5 -0
  47. package/dist/eth/types.cjs.map +1 -1
  48. package/dist/eth/types.d.cts +8 -0
  49. package/dist/eth/types.d.cts.map +1 -1
  50. package/dist/eth/types.d.mts +8 -0
  51. package/dist/eth/types.d.mts.map +1 -1
  52. package/dist/eth/types.mjs +6 -1
  53. package/dist/eth/types.mjs.map +1 -1
  54. package/dist/events.d.cts +8 -0
  55. package/dist/events.d.cts.map +1 -1
  56. package/dist/events.d.mts +8 -0
  57. package/dist/events.d.mts.map +1 -1
  58. package/dist/rpc.d.cts +11 -0
  59. package/dist/rpc.d.cts.map +1 -1
  60. package/dist/rpc.d.mts +11 -0
  61. package/dist/rpc.d.mts.map +1 -1
  62. package/dist/sol/constants.cjs +15 -0
  63. package/dist/sol/constants.cjs.map +1 -0
  64. package/dist/sol/constants.d.cts +10 -0
  65. package/dist/sol/constants.d.cts.map +1 -0
  66. package/dist/sol/constants.d.mts +10 -0
  67. package/dist/sol/constants.d.mts.map +1 -0
  68. package/dist/sol/constants.mjs +12 -0
  69. package/dist/sol/constants.mjs.map +1 -0
  70. package/dist/sol/index.cjs +1 -0
  71. package/dist/sol/index.cjs.map +1 -1
  72. package/dist/sol/index.d.cts +1 -0
  73. package/dist/sol/index.d.cts.map +1 -1
  74. package/dist/sol/index.d.mts +1 -0
  75. package/dist/sol/index.d.mts.map +1 -1
  76. package/dist/sol/index.mjs +1 -0
  77. package/dist/sol/index.mjs.map +1 -1
  78. package/dist/sol/types.d.cts +2 -0
  79. package/dist/sol/types.d.cts.map +1 -1
  80. package/dist/sol/types.d.mts +2 -0
  81. package/dist/sol/types.d.mts.map +1 -1
  82. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [13.0.0]
11
+
12
+ ### Added
13
+
14
+ - New scope constant values added for Ethereum, Bitcoin, and Solana ([#101](https://github.com/MetaMask/accounts/pull/101))
15
+
16
+ ### Changed
17
+
18
+ - **BREAKING:** Add `scopes` field to `KeyringAccount` ([#101](https://github.com/MetaMask/accounts/pull/101))
19
+
10
20
  ## [12.0.0]
11
21
 
12
22
  ### Changed
@@ -456,7 +466,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
456
466
  - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
457
467
  - Helper functions to create keyring handler in the snap.
458
468
 
459
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@12.0.0...HEAD
469
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@13.0.0...HEAD
470
+ [13.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@12.0.0...@metamask/keyring-api@13.0.0
460
471
  [12.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.1.0...@metamask/keyring-api@12.0.0
461
472
  [11.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@11.0.0...@metamask/keyring-api@11.1.0
462
473
  [11.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-api@10.1.0...@metamask/keyring-api@11.0.0
@@ -51,6 +51,10 @@ exports.KeyringAccountStruct = (0, keyring_utils_1.object)({
51
51
  * Account main address.
52
52
  */
53
53
  address: (0, superstruct_1.string)(),
54
+ /**
55
+ * Account supported scopes (CAIP-2 chain IDs).
56
+ */
57
+ scopes: (0, superstruct_1.nonempty)((0, superstruct_1.array)((0, superstruct_1.union)([utils_1.CaipNamespaceStruct, utils_1.CaipChainIdStruct]))),
54
58
  /**
55
59
  * Account options.
56
60
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAE7D,uDAAqE;AACrE,2CAA6C;AAE7C;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,0BAAU;IAEd;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
1
+ {"version":3,"file":"account.cjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":";;;AAAA,2DAA6D;AAE7D,uDAO+B;AAC/B,2CAIyB;AAEzB;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAED;;GAEG;AACH,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,8BAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,IAAA,sBAAM,EAAC;IACzC;;OAEG;IACH,EAAE,EAAE,0BAAU;IAEd;;OAEG;IACH,IAAI,EAAE,IAAA,mBAAK,EAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,GAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,IAAA,mBAAK,EAAC,CAAC,2BAAmB,EAAE,yBAAiB,CAAC,CAAC,CAAC,CAAC;IAExE;;OAEG;IACH,OAAO,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EAAC,IAAA,oBAAM,GAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n nonempty,\n array,\n enums,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -34,6 +34,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
34
34
  id: string;
35
35
  options: Record<string, import("@metamask/utils").Json>;
36
36
  address: string;
37
+ scopes: string[];
37
38
  methods: string[];
38
39
  }, {
39
40
  /**
@@ -53,6 +54,10 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
53
54
  * Account main address.
54
55
  */
55
56
  address: import("@metamask/superstruct").Struct<string, null>;
57
+ /**
58
+ * Account supported scopes (CAIP-2 chain IDs).
59
+ */
60
+ scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
56
61
  /**
57
62
  * Account options.
58
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"account.d.cts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -34,6 +34,7 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
34
34
  id: string;
35
35
  options: Record<string, import("@metamask/utils").Json>;
36
36
  address: string;
37
+ scopes: string[];
37
38
  methods: string[];
38
39
  }, {
39
40
  /**
@@ -53,6 +54,10 @@ export declare const KeyringAccountStruct: import("@metamask/superstruct").Struc
53
54
  * Account main address.
54
55
  */
55
56
  address: import("@metamask/superstruct").Struct<string, null>;
57
+ /**
58
+ * Account supported scopes (CAIP-2 chain IDs).
59
+ */
60
+ scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
56
61
  /**
57
62
  * Account options.
58
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAInD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"account.d.mts","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAenD;;GAEG;AACH,oBAAY,cAAc;IACxB,GAAG,eAAe;IAClB,OAAO,mBAAmB;CAC3B;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,MAAM,kBAAkB;CACzB;AAED;;GAEG;AACH,oBAAY,cAAc;IACxB,WAAW,wBAAwB;CACpC;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,GAAG,cAAc,CAAC,GAAG,EAAE,GACvB,GAAG,cAAc,CAAC,OAAO,EAAE,GAC3B,GAAG,cAAc,CAAC,MAAM,EAAE,GAC1B,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC;AAEpC;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;IAC/B;;OAEG;;IAGH;;OAEG;;;;;;;IAQH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;EAEH,CAAC;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { object, UuidStruct } from "@metamask/keyring-utils";
2
- import { array, enums, record, string } from "@metamask/superstruct";
3
- import { JsonStruct } from "@metamask/utils";
2
+ import { nonempty, array, enums, record, string, union } from "@metamask/superstruct";
3
+ import { CaipChainIdStruct, CaipNamespaceStruct, JsonStruct } from "@metamask/utils";
4
4
  /**
5
5
  * Supported Ethereum account types.
6
6
  */
@@ -48,6 +48,10 @@ export const KeyringAccountStruct = object({
48
48
  * Account main address.
49
49
  */
50
50
  address: string(),
51
+ /**
52
+ * Account supported scopes (CAIP-2 chain IDs).
53
+ */
54
+ scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),
51
55
  /**
52
56
  * Account options.
53
57
  */
@@ -1 +1 @@
1
- {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE7D,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACrE,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, record, string } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
1
+ {"version":3,"file":"account.mjs","sourceRoot":"","sources":["../../src/api/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,gCAAgC;AAE7D,OAAO,EACL,QAAQ,EACR,KAAK,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACN,8BAA8B;AAC/B,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,UAAU,EACX,wBAAwB;AAEzB;;GAEG;AACH,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,oCAAkB,CAAA;IAClB,4CAA0B,CAAA;AAC5B,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,0CAAwB,CAAA;AAC1B,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAED;;GAEG;AACH,MAAM,CAAN,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,qDAAmC,CAAA;AACrC,CAAC,EAFW,cAAc,KAAd,cAAc,QAEzB;AAWD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC;;OAEG;IACH,EAAE,EAAE,UAAU;IAEd;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC;QACV,GAAG,cAAc,CAAC,GAAG,EAAE;QACvB,GAAG,cAAc,CAAC,OAAO,EAAE;QAC3B,GAAG,cAAc,CAAC,MAAM,EAAE;QAC1B,GAAG,cAAc,CAAC,WAAW,EAAE;KAChC,CAAC;IAEF;;OAEG;IACH,OAAO,EAAE,MAAM,EAAE;IAEjB;;OAEG;IACH,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IAExE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC;IAErC;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;CACzB,CAAC,CAAC","sourcesContent":["import { object, UuidStruct } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport {\n nonempty,\n array,\n enums,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport {\n CaipChainIdStruct,\n CaipNamespaceStruct,\n JsonStruct,\n} from '@metamask/utils';\n\n/**\n * Supported Ethereum account types.\n */\nexport enum EthAccountType {\n Eoa = 'eip155:eoa',\n Erc4337 = 'eip155:erc4337',\n}\n\n/**\n * Supported Bitcoin account types.\n */\nexport enum BtcAccountType {\n P2wpkh = 'bip122:p2wpkh',\n}\n\n/**\n * Supported Solana account types.\n */\nexport enum SolAccountType {\n DataAccount = 'solana:data-account',\n}\n\n/**\n * Supported account types.\n */\nexport type KeyringAccountType =\n | `${EthAccountType.Eoa}`\n | `${EthAccountType.Erc4337}`\n | `${BtcAccountType.P2wpkh}`\n | `${SolAccountType.DataAccount}`;\n\n/**\n * A struct which represents a Keyring account object. It is abstract enough to\n * be used with any blockchain. Specific blockchain account types should extend\n * this struct.\n *\n * See {@link KeyringAccount}.\n */\nexport const KeyringAccountStruct = object({\n /**\n * Account ID (UUIDv4).\n */\n id: UuidStruct,\n\n /**\n * Account type.\n */\n type: enums([\n `${EthAccountType.Eoa}`,\n `${EthAccountType.Erc4337}`,\n `${BtcAccountType.P2wpkh}`,\n `${SolAccountType.DataAccount}`,\n ]),\n\n /**\n * Account main address.\n */\n address: string(),\n\n /**\n * Account supported scopes (CAIP-2 chain IDs).\n */\n scopes: nonempty(array(union([CaipNamespaceStruct, CaipChainIdStruct]))),\n\n /**\n * Account options.\n */\n options: record(string(), JsonStruct),\n\n /**\n * Account supported methods.\n */\n methods: array(string()),\n});\n\n/**\n * Keyring Account type represents an account and its properties from the\n * point of view of the keyring.\n */\nexport type KeyringAccount = Infer<typeof KeyringAccountStruct>;\n"]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ /* istanbul ignore file */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.BtcScopes = void 0;
5
+ /**
6
+ * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
7
+ */
8
+ var BtcScopes;
9
+ (function (BtcScopes) {
10
+ BtcScopes["Namespace"] = "bip122";
11
+ BtcScopes["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
12
+ BtcScopes["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
13
+ BtcScopes["Testnet4"] = "bip122:00000000da84f2bafbbc53dee25a72ae";
14
+ BtcScopes["Signet"] = "bip122:00000008819873e925422c1ff0f99f7c";
15
+ BtcScopes["Regtest"] = "bip122:regtest";
16
+ })(BtcScopes || (exports.BtcScopes = BtcScopes = {}));
17
+ //# sourceMappingURL=constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAE1B;;GAEG;AACH,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,gEAAmD,CAAA;IACnD,gEAAmD,CAAA;IACnD,iEAAoD,CAAA;IACpD,+DAAkD,CAAA;IAClD,uCAA0B,CAAA;AAC5B,CAAC,EAPW,SAAS,yBAAT,SAAS,QAOpB","sourcesContent":["/* istanbul ignore file */\n\n/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScopes {\n Namespace = 'bip122',\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n Testnet4 = 'bip122:00000000da84f2bafbbc53dee25a72ae',\n Signet = 'bip122:00000008819873e925422c1ff0f99f7c',\n Regtest = 'bip122:regtest',\n}\n"]}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
3
+ */
4
+ export declare enum BtcScopes {
5
+ Namespace = "bip122",
6
+ Mainnet = "bip122:000000000019d6689c085ae165831e93",
7
+ Testnet = "bip122:000000000933ea01ad0ee984209779ba",
8
+ Testnet4 = "bip122:00000000da84f2bafbbc53dee25a72ae",
9
+ Signet = "bip122:00000008819873e925422c1ff0f99f7c",
10
+ Regtest = "bip122:regtest"
11
+ }
12
+ //# sourceMappingURL=constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;IACnD,QAAQ,4CAA4C;IACpD,MAAM,4CAA4C;IAClD,OAAO,mBAAmB;CAC3B"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
3
+ */
4
+ export declare enum BtcScopes {
5
+ Namespace = "bip122",
6
+ Mainnet = "bip122:000000000019d6689c085ae165831e93",
7
+ Testnet = "bip122:000000000933ea01ad0ee984209779ba",
8
+ Testnet4 = "bip122:00000000da84f2bafbbc53dee25a72ae",
9
+ Signet = "bip122:00000008819873e925422c1ff0f99f7c",
10
+ Regtest = "bip122:regtest"
11
+ }
12
+ //# sourceMappingURL=constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,4CAA4C;IACnD,OAAO,4CAA4C;IACnD,QAAQ,4CAA4C;IACpD,MAAM,4CAA4C;IAClD,OAAO,mBAAmB;CAC3B"}
@@ -0,0 +1,14 @@
1
+ /* istanbul ignore file */
2
+ /**
3
+ * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.
4
+ */
5
+ export var BtcScopes;
6
+ (function (BtcScopes) {
7
+ BtcScopes["Namespace"] = "bip122";
8
+ BtcScopes["Mainnet"] = "bip122:000000000019d6689c085ae165831e93";
9
+ BtcScopes["Testnet"] = "bip122:000000000933ea01ad0ee984209779ba";
10
+ BtcScopes["Testnet4"] = "bip122:00000000da84f2bafbbc53dee25a72ae";
11
+ BtcScopes["Signet"] = "bip122:00000008819873e925422c1ff0f99f7c";
12
+ BtcScopes["Regtest"] = "bip122:regtest";
13
+ })(BtcScopes || (BtcScopes = {}));
14
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/btc/constants.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B;;GAEG;AACH,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,gEAAmD,CAAA;IACnD,gEAAmD,CAAA;IACnD,iEAAoD,CAAA;IACpD,+DAAkD,CAAA;IAClD,uCAA0B,CAAA;AAC5B,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB","sourcesContent":["/* istanbul ignore file */\n\n/**\n * Scopes for Bitcoin account type. See {@link KeyringAccount.scopes}.\n */\nexport enum BtcScopes {\n Namespace = 'bip122',\n Mainnet = 'bip122:000000000019d6689c085ae165831e93',\n Testnet = 'bip122:000000000933ea01ad0ee984209779ba',\n Testnet4 = 'bip122:00000000da84f2bafbbc53dee25a72ae',\n Signet = 'bip122:00000008819873e925422c1ff0f99f7c',\n Regtest = 'bip122:regtest',\n}\n"]}
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants.cjs"), exports);
17
18
  __exportStar(require("./types.cjs"), exports);
18
19
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB","sourcesContent":["export * from './types';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,8CAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -1,2 +1,3 @@
1
+ export * from "./constants.cjs";
1
2
  export * from "./types.cjs";
2
3
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
@@ -1,2 +1,3 @@
1
+ export * from "./constants.mjs";
1
2
  export * from "./types.mjs";
2
3
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB"}
@@ -1,2 +1,3 @@
1
+ export * from "./constants.mjs";
1
2
  export * from "./types.mjs";
2
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,4BAAwB","sourcesContent":["export * from './types';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/btc/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,4BAAwB","sourcesContent":["export * from './constants';\nexport * from './types';\n"]}
@@ -11,6 +11,7 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
11
11
  id: string;
12
12
  options: Record<string, import("@metamask/utils").Json>;
13
13
  address: string;
14
+ scopes: string[];
14
15
  methods: "sendBitcoin"[];
15
16
  }, {
16
17
  /**
@@ -28,6 +29,7 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
28
29
  sendBitcoin: "sendBitcoin";
29
30
  }>>;
30
31
  id: import("@metamask/superstruct").Struct<string, null>;
32
+ scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
31
33
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
32
34
  }>;
33
35
  export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -11,6 +11,7 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
11
11
  id: string;
12
12
  options: Record<string, import("@metamask/utils").Json>;
13
13
  address: string;
14
+ scopes: string[];
14
15
  methods: "sendBitcoin"[];
15
16
  }, {
16
17
  /**
@@ -28,6 +29,7 @@ export declare const BtcP2wpkhAccountStruct: import("@metamask/superstruct").Str
28
29
  sendBitcoin: "sendBitcoin";
29
30
  }>>;
30
31
  id: import("@metamask/superstruct").Struct<string, null>;
32
+ scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
31
33
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
32
34
  }>;
33
35
  export type BtcP2wpkhAccount = Infer<typeof BtcP2wpkhAccountStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/btc/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAMnD,eAAO,MAAM,sBAAsB,sDAalC,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,WAAW,gBAAgB;CAC5B;AAED,eAAO,MAAM,sBAAsB;;;;;;;;IAGjC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ /* istanbul ignore file */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.EthScopes = void 0;
5
+ /**
6
+ * Scopes for EVM account type. See {@link KeyringAccount.scopes}.
7
+ */
8
+ var EthScopes;
9
+ (function (EthScopes) {
10
+ EthScopes["Namespace"] = "eip155";
11
+ EthScopes["Mainnet"] = "eip155:1";
12
+ })(EthScopes || (exports.EthScopes = EthScopes = {}));
13
+ //# sourceMappingURL=constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../../src/eth/constants.ts"],"names":[],"mappings":";AAAA,0BAA0B;;;AAE1B;;GAEG;AACH,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,iCAAoB,CAAA;AACtB,CAAC,EAHW,SAAS,yBAAT,SAAS,QAGpB","sourcesContent":["/* istanbul ignore file */\n\n/**\n * Scopes for EVM account type. See {@link KeyringAccount.scopes}.\n */\nexport enum EthScopes {\n Namespace = 'eip155',\n Mainnet = 'eip155:1',\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Scopes for EVM account type. See {@link KeyringAccount.scopes}.
3
+ */
4
+ export declare enum EthScopes {
5
+ Namespace = "eip155",
6
+ Mainnet = "eip155:1"
7
+ }
8
+ //# sourceMappingURL=constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../../src/eth/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,aAAa;CACrB"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Scopes for EVM account type. See {@link KeyringAccount.scopes}.
3
+ */
4
+ export declare enum EthScopes {
5
+ Namespace = "eip155",
6
+ Mainnet = "eip155:1"
7
+ }
8
+ //# sourceMappingURL=constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../../src/eth/constants.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,SAAS;IACnB,SAAS,WAAW;IACpB,OAAO,aAAa;CACrB"}
@@ -0,0 +1,10 @@
1
+ /* istanbul ignore file */
2
+ /**
3
+ * Scopes for EVM account type. See {@link KeyringAccount.scopes}.
4
+ */
5
+ export var EthScopes;
6
+ (function (EthScopes) {
7
+ EthScopes["Namespace"] = "eip155";
8
+ EthScopes["Mainnet"] = "eip155:1";
9
+ })(EthScopes || (EthScopes = {}));
10
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../../src/eth/constants.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B;;GAEG;AACH,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,iCAAoB,CAAA;IACpB,iCAAoB,CAAA;AACtB,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB","sourcesContent":["/* istanbul ignore file */\n\n/**\n * Scopes for EVM account type. See {@link KeyringAccount.scopes}.\n */\nexport enum EthScopes {\n Namespace = 'eip155',\n Mainnet = 'eip155:1',\n}\n"]}
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./constants.cjs"), exports);
17
18
  __exportStar(require("./erc4337/index.cjs"), exports);
18
19
  __exportStar(require("./types.cjs"), exports);
19
20
  __exportStar(require("./utils.cjs"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAA0B;AAC1B,8CAAwB;AACxB,8CAAwB","sourcesContent":["export * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAA4B;AAC5B,sDAA0B;AAC1B,8CAAwB;AACxB,8CAAwB","sourcesContent":["export * from './constants';\nexport * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
@@ -1,3 +1,4 @@
1
+ export * from "./constants.cjs";
1
2
  export * from "./erc4337/index.cjs";
2
3
  export * from "./types.cjs";
3
4
  export * from "./utils.cjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
@@ -1,3 +1,4 @@
1
+ export * from "./constants.mjs";
1
2
  export * from "./erc4337/index.mjs";
2
3
  export * from "./types.mjs";
3
4
  export * from "./utils.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB"}
@@ -1,3 +1,4 @@
1
+ export * from "./constants.mjs";
1
2
  export * from "./erc4337/index.mjs";
2
3
  export * from "./types.mjs";
3
4
  export * from "./utils.mjs";
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB","sourcesContent":["export * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/eth/index.ts"],"names":[],"mappings":"AAAA,gCAA4B;AAC5B,oCAA0B;AAC1B,4BAAwB;AACxB,4BAAwB","sourcesContent":["export * from './constants';\nexport * from './erc4337';\nexport * from './types';\nexport * from './utils';\n"]}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EthErc4337AccountStruct = exports.EthEoaAccountStruct = exports.EthMethod = exports.EthUint256Struct = exports.EthAddressStruct = exports.EthBytesStruct = void 0;
4
4
  const keyring_utils_1 = require("@metamask/keyring-utils");
5
5
  const superstruct_1 = require("@metamask/superstruct");
6
+ const _1 = require("./index.cjs");
6
7
  const api_1 = require("../api/index.cjs");
7
8
  exports.EthBytesStruct = (0, keyring_utils_1.definePattern)('EthBytes', /^0x[0-9a-f]*$/iu);
8
9
  exports.EthAddressStruct = (0, keyring_utils_1.definePattern)('EthAddress', /^0x[0-9a-f]{40}$/iu);
@@ -34,6 +35,10 @@ exports.EthEoaAccountStruct = (0, keyring_utils_1.object)({
34
35
  * Account type.
35
36
  */
36
37
  type: (0, superstruct_1.literal)(`${api_1.EthAccountType.Eoa}`),
38
+ /**
39
+ * Account scopes (must be ['eip155']).
40
+ */
41
+ scopes: (0, superstruct_1.nonempty)((0, superstruct_1.array)((0, superstruct_1.literal)(_1.EthScopes.Namespace))),
37
42
  /**
38
43
  * Account supported methods.
39
44
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,uDAA8D;AAE9D,0CAA8D;AAEjD,QAAA,cAAc,GAAG,IAAA,6BAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,sBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;KAC/B,CAAC,CACH;CACF,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAG,IAAA,sBAAM,EAAC;IAC5C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,oBAAoB,EAAE;QACnC,GAAG,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import { object, definePattern } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { array, enums, literal } from '@metamask/superstruct';\n\nimport { EthAccountType, KeyringAccountStruct } from '../api';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":";;;AAAA,2DAAgE;AAEhE,uDAAwE;AAExE,kCAA8B;AAC9B,0CAA8D;AAEjD,QAAA,cAAc,GAAG,IAAA,6BAAa,EAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;AAE9D,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAC3C,YAAY,EACZ,oBAAoB,CACrB,CAAC;AAEW,QAAA,gBAAgB,GAAG,IAAA,6BAAa,EAC3C,YAAY,EACZ,6BAA6B,CAC9B,CAAC;AAEF;;GAEG;AACH,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,0BAA0B;IAC1B,2CAA8B,CAAA;IAC9B,8BAAiB,CAAA;IACjB,oDAAuC,CAAA;IACvC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,qDAAwC,CAAA;IACxC,mBAAmB;IACnB,8DAAiD,CAAA;IACjD,0DAA6C,CAAA;IAC7C,wDAA2C,CAAA;AAC7C,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAEY,QAAA,mBAAmB,GAAG,IAAA,sBAAM,EAAC;IACxC,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,GAAG,EAAE,CAAC;IAEtC;;OAEG;IACH,MAAM,EAAE,IAAA,sBAAQ,EAAC,IAAA,mBAAK,EAAC,IAAA,qBAAO,EAAC,YAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAErD;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;KAC/B,CAAC,CACH;CACF,CAAC,CAAC;AAIU,QAAA,uBAAuB,GAAG,IAAA,sBAAM,EAAC;IAC5C,GAAG,0BAAoB,CAAC,MAAM;IAE9B;;OAEG;IACH,OAAO,EAAE,wBAAgB;IAEzB;;OAEG;IACH,IAAI,EAAE,IAAA,qBAAO,EAAC,GAAG,oBAAc,CAAC,OAAO,EAAE,CAAC;IAE1C;;OAEG;IACH,OAAO,EAAE,IAAA,mBAAK,EACZ,IAAA,mBAAK,EAAC;QACJ,GAAG,SAAS,CAAC,YAAY,EAAE;QAC3B,GAAG,SAAS,CAAC,IAAI,EAAE;QACnB,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,eAAe,EAAE;QAC9B,GAAG,SAAS,CAAC,oBAAoB,EAAE;QACnC,GAAG,SAAS,CAAC,kBAAkB,EAAE;QACjC,GAAG,SAAS,CAAC,iBAAiB,EAAE;KACjC,CAAC,CACH;CACF,CAAC,CAAC","sourcesContent":["import { object, definePattern } from '@metamask/keyring-utils';\nimport type { Infer } from '@metamask/superstruct';\nimport { nonempty, array, enums, literal } from '@metamask/superstruct';\n\nimport { EthScopes } from '.';\nimport { EthAccountType, KeyringAccountStruct } from '../api';\n\nexport const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);\n\nexport const EthAddressStruct = definePattern(\n 'EthAddress',\n /^0x[0-9a-f]{40}$/iu,\n);\n\nexport const EthUint256Struct = definePattern(\n 'EthUint256',\n /^0x([1-9a-f][0-9a-f]*|0)$/iu,\n);\n\n/**\n * Supported Ethereum methods.\n */\nexport enum EthMethod {\n // General signing methods\n PersonalSign = 'personal_sign',\n Sign = 'eth_sign',\n SignTransaction = 'eth_signTransaction',\n SignTypedDataV1 = 'eth_signTypedData_v1',\n SignTypedDataV3 = 'eth_signTypedData_v3',\n SignTypedDataV4 = 'eth_signTypedData_v4',\n // ERC-4337 methods\n PrepareUserOperation = 'eth_prepareUserOperation',\n PatchUserOperation = 'eth_patchUserOperation',\n SignUserOperation = 'eth_signUserOperation',\n}\n\nexport const EthEoaAccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Eoa}`),\n\n /**\n * Account scopes (must be ['eip155']).\n */\n scopes: nonempty(array(literal(EthScopes.Namespace))),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTransaction}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n ]),\n ),\n});\n\nexport type EthEoaAccount = Infer<typeof EthEoaAccountStruct>;\n\nexport const EthErc4337AccountStruct = object({\n ...KeyringAccountStruct.schema,\n\n /**\n * Account address.\n */\n address: EthAddressStruct,\n\n /**\n * Account type.\n */\n type: literal(`${EthAccountType.Erc4337}`),\n\n /**\n * Account supported methods.\n */\n methods: array(\n enums([\n `${EthMethod.PersonalSign}`,\n `${EthMethod.Sign}`,\n `${EthMethod.SignTypedDataV1}`,\n `${EthMethod.SignTypedDataV3}`,\n `${EthMethod.SignTypedDataV4}`,\n `${EthMethod.PrepareUserOperation}`,\n `${EthMethod.PatchUserOperation}`,\n `${EthMethod.SignUserOperation}`,\n ]),\n ),\n});\n\nexport type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;\n"]}
@@ -1,4 +1,5 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
+ import { EthScopes } from "./index.cjs";
2
3
  export declare const EthBytesStruct: import("@metamask/superstruct").Struct<string, null>;
3
4
  export declare const EthAddressStruct: import("@metamask/superstruct").Struct<string, null>;
4
5
  export declare const EthUint256Struct: import("@metamask/superstruct").Struct<string, null>;
@@ -21,6 +22,7 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
21
22
  id: string;
22
23
  options: Record<string, import("@metamask/utils").Json>;
23
24
  address: string;
25
+ scopes: EthScopes.Namespace[];
24
26
  methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
25
27
  }, {
26
28
  /**
@@ -31,6 +33,10 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
31
33
  * Account type.
32
34
  */
33
35
  type: import("@metamask/superstruct").Struct<"eip155:eoa", "eip155:eoa">;
36
+ /**
37
+ * Account scopes (must be ['eip155']).
38
+ */
39
+ scopes: import("@metamask/superstruct").Struct<EthScopes.Namespace[], import("@metamask/superstruct").Struct<EthScopes.Namespace, EthScopes.Namespace>>;
34
40
  /**
35
41
  * Account supported methods.
36
42
  */
@@ -51,6 +57,7 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
51
57
  id: string;
52
58
  options: Record<string, import("@metamask/utils").Json>;
53
59
  address: string;
60
+ scopes: string[];
54
61
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
55
62
  }, {
56
63
  /**
@@ -75,6 +82,7 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
75
82
  eth_signUserOperation: "eth_signUserOperation";
76
83
  }>>;
77
84
  id: import("@metamask/superstruct").Struct<string, null>;
85
+ scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
78
86
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
79
87
  }>;
80
88
  export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD,OAAO,EAAE,SAAS,EAAE,oBAAU;AAG9B,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { Infer } from "@metamask/superstruct";
2
+ import { EthScopes } from "./index.mjs";
2
3
  export declare const EthBytesStruct: import("@metamask/superstruct").Struct<string, null>;
3
4
  export declare const EthAddressStruct: import("@metamask/superstruct").Struct<string, null>;
4
5
  export declare const EthUint256Struct: import("@metamask/superstruct").Struct<string, null>;
@@ -21,6 +22,7 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
21
22
  id: string;
22
23
  options: Record<string, import("@metamask/utils").Json>;
23
24
  address: string;
25
+ scopes: EthScopes.Namespace[];
24
26
  methods: ("personal_sign" | "eth_sign" | "eth_signTransaction" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4")[];
25
27
  }, {
26
28
  /**
@@ -31,6 +33,10 @@ export declare const EthEoaAccountStruct: import("@metamask/superstruct").Struct
31
33
  * Account type.
32
34
  */
33
35
  type: import("@metamask/superstruct").Struct<"eip155:eoa", "eip155:eoa">;
36
+ /**
37
+ * Account scopes (must be ['eip155']).
38
+ */
39
+ scopes: import("@metamask/superstruct").Struct<EthScopes.Namespace[], import("@metamask/superstruct").Struct<EthScopes.Namespace, EthScopes.Namespace>>;
34
40
  /**
35
41
  * Account supported methods.
36
42
  */
@@ -51,6 +57,7 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
51
57
  id: string;
52
58
  options: Record<string, import("@metamask/utils").Json>;
53
59
  address: string;
60
+ scopes: string[];
54
61
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
55
62
  }, {
56
63
  /**
@@ -75,6 +82,7 @@ export declare const EthErc4337AccountStruct: import("@metamask/superstruct").St
75
82
  eth_signUserOperation: "eth_signUserOperation";
76
83
  }>>;
77
84
  id: import("@metamask/superstruct").Struct<string, null>;
85
+ scopes: import("@metamask/superstruct").Struct<string[], import("@metamask/superstruct").Struct<string, null>>;
78
86
  options: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json>, null>;
79
87
  }>;
80
88
  export type EthErc4337Account = Infer<typeof EthErc4337AccountStruct>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../../src/eth/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAGnD,OAAO,EAAE,SAAS,EAAE,oBAAU;AAG9B,eAAO,MAAM,cAAc,sDAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDAG5B,CAAC;AAEF;;GAEG;AACH,oBAAY,SAAS;IAEnB,YAAY,kBAAkB;IAC9B,IAAI,aAAa;IACjB,eAAe,wBAAwB;IACvC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IACxC,eAAe,yBAAyB;IAExC,oBAAoB,6BAA6B;IACjD,kBAAkB,2BAA2B;IAC7C,iBAAiB,0BAA0B;CAC5C;AAED,eAAO,MAAM,mBAAmB;;;;;;;;IAG9B;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;EAWH,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAE9D,eAAO,MAAM,uBAAuB;;;;;;;;IAGlC;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;;;;;;;;;;;;;EAaH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { object, definePattern } from "@metamask/keyring-utils";
2
- import { array, enums, literal } from "@metamask/superstruct";
2
+ import { nonempty, array, enums, literal } from "@metamask/superstruct";
3
+ import { EthScopes } from "./index.mjs";
3
4
  import { EthAccountType, KeyringAccountStruct } from "../api/index.mjs";
4
5
  export const EthBytesStruct = definePattern('EthBytes', /^0x[0-9a-f]*$/iu);
5
6
  export const EthAddressStruct = definePattern('EthAddress', /^0x[0-9a-f]{40}$/iu);
@@ -31,6 +32,10 @@ export const EthEoaAccountStruct = object({
31
32
  * Account type.
32
33
  */
33
34
  type: literal(`${EthAccountType.Eoa}`),
35
+ /**
36
+ * Account scopes (must be ['eip155']).
37
+ */
38
+ scopes: nonempty(array(literal(EthScopes.Namespace))),
34
39
  /**
35
40
  * Account supported methods.
36
41
  */