@metamask-previews/keyring-internal-api 9.1.0-8202c83 → 9.1.1-412b185

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 (53) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/dist/compatibility/index.cjs +1 -1
  3. package/dist/compatibility/index.cjs.map +1 -1
  4. package/dist/compatibility/index.d.cts +1 -1
  5. package/dist/compatibility/index.d.cts.map +1 -1
  6. package/dist/compatibility/index.d.mts +1 -1
  7. package/dist/compatibility/index.d.mts.map +1 -1
  8. package/dist/compatibility/index.mjs +1 -1
  9. package/dist/compatibility/index.mjs.map +1 -1
  10. package/dist/compatibility/keyring-request.cjs +28 -0
  11. package/dist/compatibility/keyring-request.cjs.map +1 -0
  12. package/dist/compatibility/{v1.d.mts → keyring-request.d.cts} +7 -7
  13. package/dist/compatibility/keyring-request.d.cts.map +1 -0
  14. package/dist/compatibility/{v1.d.cts → keyring-request.d.mts} +7 -7
  15. package/dist/compatibility/keyring-request.d.mts.map +1 -0
  16. package/dist/compatibility/{v1.mjs → keyring-request.mjs} +8 -6
  17. package/dist/compatibility/keyring-request.mjs.map +1 -0
  18. package/dist/eth/EthKeyring.cjs +0 -1
  19. package/dist/eth/EthKeyring.cjs.map +1 -1
  20. package/dist/eth/EthKeyring.d.cts.map +1 -1
  21. package/dist/eth/EthKeyring.d.mts.map +1 -1
  22. package/dist/eth/EthKeyring.mjs +0 -1
  23. package/dist/eth/EthKeyring.mjs.map +1 -1
  24. package/dist/index.cjs +0 -1
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +0 -1
  27. package/dist/index.d.cts.map +1 -1
  28. package/dist/index.d.mts +0 -1
  29. package/dist/index.d.mts.map +1 -1
  30. package/dist/index.mjs +0 -1
  31. package/dist/index.mjs.map +1 -1
  32. package/dist/types.cjs +2 -7
  33. package/dist/types.cjs.map +1 -1
  34. package/dist/types.d.cts +62 -54
  35. package/dist/types.d.cts.map +1 -1
  36. package/dist/types.d.mts +62 -54
  37. package/dist/types.d.mts.map +1 -1
  38. package/dist/types.mjs +2 -7
  39. package/dist/types.mjs.map +1 -1
  40. package/package.json +2 -2
  41. package/dist/compatibility/v1.cjs +0 -26
  42. package/dist/compatibility/v1.cjs.map +0 -1
  43. package/dist/compatibility/v1.d.cts.map +0 -1
  44. package/dist/compatibility/v1.d.mts.map +0 -1
  45. package/dist/compatibility/v1.mjs.map +0 -1
  46. package/dist/versions.cjs +0 -16
  47. package/dist/versions.cjs.map +0 -1
  48. package/dist/versions.d.cts +0 -12
  49. package/dist/versions.d.cts.map +0 -1
  50. package/dist/versions.d.mts +0 -12
  51. package/dist/versions.d.mts.map +0 -1
  52. package/dist/versions.mjs +0 -13
  53. package/dist/versions.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Changed
11
+
12
+ - **BREAKING:** Rename `KeyringRequestV1` type to `KeyringRequestWithoutOrigin` ([#423](https://github.com/MetaMask/accounts/pull/423))
13
+ - **BREAKING:** Rename `toKeyringRequestV1` method to `toKeyringRequestWithoutOrigin` ([#423](https://github.com/MetaMask/accounts/pull/423))
14
+
15
+ ### Removed
16
+
17
+ - **BREAKING:** Remove `KeyringVersion` support ([#423](https://github.com/MetaMask/accounts/pull/423))
18
+
19
+ ## [9.1.1]
20
+
21
+ ### Changed
22
+
23
+ - Bump `@metamask/keyring-api` from `^21.1.0` to `^21.2.0` ([#395](https://github.com/MetaMask/accounts/pull/395))
24
+
10
25
  ## [9.1.0]
11
26
 
12
27
  ### Changed
@@ -151,7 +166,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
151
166
  - This new version fixes a bug with CJS re-exports.
152
167
  - Initial release ([#24](https://github.com/MetaMask/accounts/pull/24))
153
168
 
154
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@9.1.0...HEAD
169
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@9.1.1...HEAD
170
+ [9.1.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@9.1.0...@metamask/keyring-internal-api@9.1.1
155
171
  [9.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@9.0.0...@metamask/keyring-internal-api@9.1.0
156
172
  [9.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@8.1.0...@metamask/keyring-internal-api@9.0.0
157
173
  [8.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-internal-api@8.0.0...@metamask/keyring-internal-api@8.1.0
@@ -14,5 +14,5 @@ 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("./v1.cjs"), exports);
17
+ __exportStar(require("./keyring-request.cjs"), exports);
18
18
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAqB","sourcesContent":["export * from './v1';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAkC","sourcesContent":["export * from './keyring-request';\n"]}
@@ -1,2 +1,2 @@
1
- export * from "./v1.cjs";
1
+ export * from "./keyring-request.cjs";
2
2
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,yBAAqB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,sCAAkC"}
@@ -1,2 +1,2 @@
1
- export * from "./v1.mjs";
1
+ export * from "./keyring-request.mjs";
2
2
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,yBAAqB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,sCAAkC"}
@@ -1,2 +1,2 @@
1
- export * from "./v1.mjs";
1
+ export * from "./keyring-request.mjs";
2
2
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,yBAAqB","sourcesContent":["export * from './v1';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,sCAAkC","sourcesContent":["export * from './keyring-request';\n"]}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SubmitRequestResponseV1Struct = exports.KeyringResponseWithoutOriginStruct = exports.KeyringRequestWithoutOriginStruct = void 0;
4
+ exports.toKeyringRequestWithoutOrigin = toKeyringRequestWithoutOrigin;
5
+ const keyring_api_1 = require("@metamask/keyring-api");
6
+ const superstruct_1 = require("@metamask/superstruct");
7
+ /**
8
+ * Keyring request without `origin` support.
9
+ */
10
+ exports.KeyringRequestWithoutOriginStruct = (0, superstruct_1.omit)(keyring_api_1.KeyringRequestStruct, [
11
+ 'origin',
12
+ ]);
13
+ /**
14
+ * Response to a call to `submitRequest` (v1).
15
+ */
16
+ exports.KeyringResponseWithoutOriginStruct = keyring_api_1.KeyringResponseStruct;
17
+ exports.SubmitRequestResponseV1Struct = exports.KeyringResponseWithoutOriginStruct;
18
+ /**
19
+ * Converts a keyring request to a keyring request v1.
20
+ *
21
+ * @param request - A keyring request.
22
+ * @returns A keyring request v1.
23
+ */
24
+ function toKeyringRequestWithoutOrigin(request) {
25
+ const { origin, ...requestV1 } = request;
26
+ return requestV1;
27
+ }
28
+ //# sourceMappingURL=keyring-request.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring-request.cjs","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":";;;AAmCA,sEAMC;AAxCD,uDAG+B;AAC/B,uDAAyD;AAEzD;;GAEG;AACU,QAAA,iCAAiC,GAAG,IAAA,kBAAI,EAAC,kCAAoB,EAAE;IAC1E,QAAQ;CACT,CAAC,CAAC;AAMH;;GAEG;AACU,QAAA,kCAAkC,GAAG,mCAAqB,CAAC;AAM3D,QAAA,6BAA6B,GAAG,0CAAkC,CAAC;AAEhF;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,OAAuB;IAEvB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAEzC,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { KeyringRequest } from '@metamask/keyring-api';\nimport {\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '@metamask/keyring-api';\nimport { omit, type Infer } from '@metamask/superstruct';\n\n/**\n * Keyring request without `origin` support.\n */\nexport const KeyringRequestWithoutOriginStruct = omit(KeyringRequestStruct, [\n 'origin',\n]);\n\nexport type KeyringRequestWithoutOrigin = Infer<\n typeof KeyringRequestWithoutOriginStruct\n>;\n\n/**\n * Response to a call to `submitRequest` (v1).\n */\nexport const KeyringResponseWithoutOriginStruct = KeyringResponseStruct;\n\nexport type KeyringResponseWithoutOrigin = Infer<\n typeof KeyringResponseWithoutOriginStruct\n>;\n\nexport const SubmitRequestResponseV1Struct = KeyringResponseWithoutOriginStruct;\n\n/**\n * Converts a keyring request to a keyring request v1.\n *\n * @param request - A keyring request.\n * @returns A keyring request v1.\n */\nexport function toKeyringRequestWithoutOrigin(\n request: KeyringRequest,\n): KeyringRequestWithoutOrigin {\n const { origin, ...requestV1 } = request;\n\n return requestV1;\n}\n"]}
@@ -1,9 +1,9 @@
1
1
  import type { KeyringRequest } from "@metamask/keyring-api";
2
2
  import { type Infer } from "@metamask/superstruct";
3
3
  /**
4
- * Keyring request (v1).
4
+ * Keyring request without `origin` support.
5
5
  */
6
- export declare const KeyringRequestV1Struct: import("@metamask/superstruct").Struct<{
6
+ export declare const KeyringRequestWithoutOriginStruct: import("@metamask/superstruct").Struct<{
7
7
  id: string;
8
8
  request: {
9
9
  method: string;
@@ -24,11 +24,11 @@ export declare const KeyringRequestV1Struct: import("@metamask/superstruct").Str
24
24
  params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
25
25
  }>;
26
26
  }, "origin">>;
27
- export type KeyringRequestV1 = Infer<typeof KeyringRequestV1Struct>;
27
+ export type KeyringRequestWithoutOrigin = Infer<typeof KeyringRequestWithoutOriginStruct>;
28
28
  /**
29
29
  * Response to a call to `submitRequest` (v1).
30
30
  */
31
- export declare const KeyringResponseV1Struct: import("@metamask/superstruct").Struct<{
31
+ export declare const KeyringResponseWithoutOriginStruct: import("@metamask/superstruct").Struct<{
32
32
  pending: true;
33
33
  redirect?: {
34
34
  message?: string;
@@ -38,7 +38,7 @@ export declare const KeyringResponseV1Struct: import("@metamask/superstruct").St
38
38
  result: import("@metamask/utils").Json;
39
39
  pending: false;
40
40
  }, null>;
41
- export type KeyringResponseV1 = Infer<typeof KeyringResponseV1Struct>;
41
+ export type KeyringResponseWithoutOrigin = Infer<typeof KeyringResponseWithoutOriginStruct>;
42
42
  export declare const SubmitRequestResponseV1Struct: import("@metamask/superstruct").Struct<{
43
43
  pending: true;
44
44
  redirect?: {
@@ -55,5 +55,5 @@ export declare const SubmitRequestResponseV1Struct: import("@metamask/superstruc
55
55
  * @param request - A keyring request.
56
56
  * @returns A keyring request v1.
57
57
  */
58
- export declare function toKeyringRequestV1(request: KeyringRequest): KeyringRequestV1;
59
- //# sourceMappingURL=v1.d.mts.map
58
+ export declare function toKeyringRequestWithoutOrigin(request: KeyringRequest): KeyringRequestWithoutOrigin;
59
+ //# sourceMappingURL=keyring-request.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring-request.d.cts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAK5D,OAAO,EAAQ,KAAK,KAAK,EAAE,8BAA8B;AAEzD;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;cA2BvC,CAAC;;;;;aAzBN,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;eAhBV,CAAC;WAKtC,CAHC;;;;;QAcsE,CAAC;AAExE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;eAtBL,CAAC;WAKtC,CAHC;;;;;QAoB8E,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,cAAc,GACtB,2BAA2B,CAI7B"}
@@ -1,9 +1,9 @@
1
1
  import type { KeyringRequest } from "@metamask/keyring-api";
2
2
  import { type Infer } from "@metamask/superstruct";
3
3
  /**
4
- * Keyring request (v1).
4
+ * Keyring request without `origin` support.
5
5
  */
6
- export declare const KeyringRequestV1Struct: import("@metamask/superstruct").Struct<{
6
+ export declare const KeyringRequestWithoutOriginStruct: import("@metamask/superstruct").Struct<{
7
7
  id: string;
8
8
  request: {
9
9
  method: string;
@@ -24,11 +24,11 @@ export declare const KeyringRequestV1Struct: import("@metamask/superstruct").Str
24
24
  params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
25
25
  }>;
26
26
  }, "origin">>;
27
- export type KeyringRequestV1 = Infer<typeof KeyringRequestV1Struct>;
27
+ export type KeyringRequestWithoutOrigin = Infer<typeof KeyringRequestWithoutOriginStruct>;
28
28
  /**
29
29
  * Response to a call to `submitRequest` (v1).
30
30
  */
31
- export declare const KeyringResponseV1Struct: import("@metamask/superstruct").Struct<{
31
+ export declare const KeyringResponseWithoutOriginStruct: import("@metamask/superstruct").Struct<{
32
32
  pending: true;
33
33
  redirect?: {
34
34
  message?: string;
@@ -38,7 +38,7 @@ export declare const KeyringResponseV1Struct: import("@metamask/superstruct").St
38
38
  result: import("@metamask/utils").Json;
39
39
  pending: false;
40
40
  }, null>;
41
- export type KeyringResponseV1 = Infer<typeof KeyringResponseV1Struct>;
41
+ export type KeyringResponseWithoutOrigin = Infer<typeof KeyringResponseWithoutOriginStruct>;
42
42
  export declare const SubmitRequestResponseV1Struct: import("@metamask/superstruct").Struct<{
43
43
  pending: true;
44
44
  redirect?: {
@@ -55,5 +55,5 @@ export declare const SubmitRequestResponseV1Struct: import("@metamask/superstruc
55
55
  * @param request - A keyring request.
56
56
  * @returns A keyring request v1.
57
57
  */
58
- export declare function toKeyringRequestV1(request: KeyringRequest): KeyringRequestV1;
59
- //# sourceMappingURL=v1.d.cts.map
58
+ export declare function toKeyringRequestWithoutOrigin(request: KeyringRequest): KeyringRequestWithoutOrigin;
59
+ //# sourceMappingURL=keyring-request.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring-request.d.mts","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAK5D,OAAO,EAAQ,KAAK,KAAK,EAAE,8BAA8B;AAEzD;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;cA2BvC,CAAC;;;;;aAzBN,CAAC;AAEH,MAAM,MAAM,2BAA2B,GAAG,KAAK,CAC7C,OAAO,iCAAiC,CACzC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kCAAkC;;;eAhBV,CAAC;WAKtC,CAHC;;;;;QAcsE,CAAC;AAExE,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAC9C,OAAO,kCAAkC,CAC1C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;eAtBL,CAAC;WAKtC,CAHC;;;;;QAoB8E,CAAC;AAEhF;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,cAAc,GACtB,2BAA2B,CAI7B"}
@@ -1,22 +1,24 @@
1
1
  import { KeyringRequestStruct, KeyringResponseStruct } from "@metamask/keyring-api";
2
2
  import { omit } from "@metamask/superstruct";
3
3
  /**
4
- * Keyring request (v1).
4
+ * Keyring request without `origin` support.
5
5
  */
6
- export const KeyringRequestV1Struct = omit(KeyringRequestStruct, ['origin']);
6
+ export const KeyringRequestWithoutOriginStruct = omit(KeyringRequestStruct, [
7
+ 'origin',
8
+ ]);
7
9
  /**
8
10
  * Response to a call to `submitRequest` (v1).
9
11
  */
10
- export const KeyringResponseV1Struct = KeyringResponseStruct;
11
- export const SubmitRequestResponseV1Struct = KeyringResponseV1Struct;
12
+ export const KeyringResponseWithoutOriginStruct = KeyringResponseStruct;
13
+ export const SubmitRequestResponseV1Struct = KeyringResponseWithoutOriginStruct;
12
14
  /**
13
15
  * Converts a keyring request to a keyring request v1.
14
16
  *
15
17
  * @param request - A keyring request.
16
18
  * @returns A keyring request v1.
17
19
  */
18
- export function toKeyringRequestV1(request) {
20
+ export function toKeyringRequestWithoutOrigin(request) {
19
21
  const { origin, ...requestV1 } = request;
20
22
  return requestV1;
21
23
  }
22
- //# sourceMappingURL=v1.mjs.map
24
+ //# sourceMappingURL=keyring-request.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyring-request.mjs","sourceRoot":"","sources":["../../src/compatibility/keyring-request.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACtB,8BAA8B;AAC/B,OAAO,EAAE,IAAI,EAAc,8BAA8B;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC,oBAAoB,EAAE;IAC1E,QAAQ;CACT,CAAC,CAAC;AAMH;;GAEG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,qBAAqB,CAAC;AAMxE,MAAM,CAAC,MAAM,6BAA6B,GAAG,kCAAkC,CAAC;AAEhF;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B,CAC3C,OAAuB;IAEvB,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC;IAEzC,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import type { KeyringRequest } from '@metamask/keyring-api';\nimport {\n KeyringRequestStruct,\n KeyringResponseStruct,\n} from '@metamask/keyring-api';\nimport { omit, type Infer } from '@metamask/superstruct';\n\n/**\n * Keyring request without `origin` support.\n */\nexport const KeyringRequestWithoutOriginStruct = omit(KeyringRequestStruct, [\n 'origin',\n]);\n\nexport type KeyringRequestWithoutOrigin = Infer<\n typeof KeyringRequestWithoutOriginStruct\n>;\n\n/**\n * Response to a call to `submitRequest` (v1).\n */\nexport const KeyringResponseWithoutOriginStruct = KeyringResponseStruct;\n\nexport type KeyringResponseWithoutOrigin = Infer<\n typeof KeyringResponseWithoutOriginStruct\n>;\n\nexport const SubmitRequestResponseV1Struct = KeyringResponseWithoutOriginStruct;\n\n/**\n * Converts a keyring request to a keyring request v1.\n *\n * @param request - A keyring request.\n * @returns A keyring request v1.\n */\nexport function toKeyringRequestWithoutOrigin(\n request: KeyringRequest,\n): KeyringRequestWithoutOrigin {\n const { origin, ...requestV1 } = request;\n\n return requestV1;\n}\n"]}
@@ -1,4 +1,3 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
3
2
  Object.defineProperty(exports, "__esModule", { value: true });
4
3
  //# sourceMappingURL=EthKeyring.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthKeyring.cjs","sourceRoot":"","sources":["../../src/eth/EthKeyring.ts"],"names":[],"mappings":";AAAA,sEAAsE","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n\nimport type {\n KeyringExecutionContext,\n EthBaseTransaction,\n EthBaseUserOperation,\n EthUserOperation,\n EthUserOperationPatch,\n} from '@metamask/keyring-api';\nimport type { Keyring } from '@metamask/keyring-utils';\n\nexport type EthKeyring = Keyring & {\n /**\n * Convert a base transaction to a base UserOperation.\n *\n * @param address - Address of the sender.\n * @param transactions - Base transactions to include in the UserOperation.\n * @param context - Keyring execution context.\n * @returns A pseudo-UserOperation that can be used to construct a real.\n */\n prepareUserOperation?(\n address: string,\n transactions: EthBaseTransaction[],\n context: KeyringExecutionContext,\n ): Promise<EthBaseUserOperation>;\n\n /**\n * Patches properties of a UserOperation. Currently, only the\n * `paymasterAndData` can be patched.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to patch.\n * @param context - Keyring execution context.\n * @returns A patch to apply to the UserOperation.\n */\n patchUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<EthUserOperationPatch>;\n\n /**\n * Signs an UserOperation.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to sign.\n * @param context - Keyring execution context.\n * @returns The signature of the UserOperation.\n */\n signUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<string>;\n};\n"]}
1
+ {"version":3,"file":"EthKeyring.cjs","sourceRoot":"","sources":["../../src/eth/EthKeyring.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n KeyringExecutionContext,\n EthBaseTransaction,\n EthBaseUserOperation,\n EthUserOperation,\n EthUserOperationPatch,\n} from '@metamask/keyring-api';\nimport type { Keyring } from '@metamask/keyring-utils';\n\nexport type EthKeyring = Keyring & {\n /**\n * Convert a base transaction to a base UserOperation.\n *\n * @param address - Address of the sender.\n * @param transactions - Base transactions to include in the UserOperation.\n * @param context - Keyring execution context.\n * @returns A pseudo-UserOperation that can be used to construct a real.\n */\n prepareUserOperation?(\n address: string,\n transactions: EthBaseTransaction[],\n context: KeyringExecutionContext,\n ): Promise<EthBaseUserOperation>;\n\n /**\n * Patches properties of a UserOperation. Currently, only the\n * `paymasterAndData` can be patched.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to patch.\n * @param context - Keyring execution context.\n * @returns A patch to apply to the UserOperation.\n */\n patchUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<EthUserOperationPatch>;\n\n /**\n * Signs an UserOperation.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to sign.\n * @param context - Keyring execution context.\n * @returns The signature of the UserOperation.\n */\n signUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<string>;\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EthKeyring.d.cts","sourceRoot":"","sources":["../../src/eth/EthKeyring.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACtB,8BAA8B;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,gCAAgC;AAEvD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG;IACjC;;;;;;;OAOG;IACH,oBAAoB,CAAC,CACnB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,kBAAkB,EAAE,EAClC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,CACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAElC;;;;;;;OAOG;IACH,iBAAiB,CAAC,CAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"EthKeyring.d.cts","sourceRoot":"","sources":["../../src/eth/EthKeyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACtB,8BAA8B;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,gCAAgC;AAEvD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG;IACjC;;;;;;;OAOG;IACH,oBAAoB,CAAC,CACnB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,kBAAkB,EAAE,EAClC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,CACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAElC;;;;;;;OAOG;IACH,iBAAiB,CAAC,CAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"EthKeyring.d.mts","sourceRoot":"","sources":["../../src/eth/EthKeyring.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACtB,8BAA8B;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,gCAAgC;AAEvD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG;IACjC;;;;;;;OAOG;IACH,oBAAoB,CAAC,CACnB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,kBAAkB,EAAE,EAClC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,CACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAElC;;;;;;;OAOG;IACH,iBAAiB,CAAC,CAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB,CAAC"}
1
+ {"version":3,"file":"EthKeyring.d.mts","sourceRoot":"","sources":["../../src/eth/EthKeyring.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACtB,8BAA8B;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,gCAAgC;AAEvD,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG;IACjC;;;;;;;OAOG;IACH,oBAAoB,CAAC,CACnB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,kBAAkB,EAAE,EAClC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC;;;;;;;;OAQG;IACH,kBAAkB,CAAC,CACjB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAElC;;;;;;;OAOG;IACH,iBAAiB,CAAC,CAChB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB,CAAC"}
@@ -1,3 +1,2 @@
1
- /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
2
1
  export {};
3
2
  //# sourceMappingURL=EthKeyring.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"EthKeyring.mjs","sourceRoot":"","sources":["../../src/eth/EthKeyring.ts"],"names":[],"mappings":"AAAA,sEAAsE","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n\nimport type {\n KeyringExecutionContext,\n EthBaseTransaction,\n EthBaseUserOperation,\n EthUserOperation,\n EthUserOperationPatch,\n} from '@metamask/keyring-api';\nimport type { Keyring } from '@metamask/keyring-utils';\n\nexport type EthKeyring = Keyring & {\n /**\n * Convert a base transaction to a base UserOperation.\n *\n * @param address - Address of the sender.\n * @param transactions - Base transactions to include in the UserOperation.\n * @param context - Keyring execution context.\n * @returns A pseudo-UserOperation that can be used to construct a real.\n */\n prepareUserOperation?(\n address: string,\n transactions: EthBaseTransaction[],\n context: KeyringExecutionContext,\n ): Promise<EthBaseUserOperation>;\n\n /**\n * Patches properties of a UserOperation. Currently, only the\n * `paymasterAndData` can be patched.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to patch.\n * @param context - Keyring execution context.\n * @returns A patch to apply to the UserOperation.\n */\n patchUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<EthUserOperationPatch>;\n\n /**\n * Signs an UserOperation.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to sign.\n * @param context - Keyring execution context.\n * @returns The signature of the UserOperation.\n */\n signUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<string>;\n};\n"]}
1
+ {"version":3,"file":"EthKeyring.mjs","sourceRoot":"","sources":["../../src/eth/EthKeyring.ts"],"names":[],"mappings":"","sourcesContent":["import type {\n KeyringExecutionContext,\n EthBaseTransaction,\n EthBaseUserOperation,\n EthUserOperation,\n EthUserOperationPatch,\n} from '@metamask/keyring-api';\nimport type { Keyring } from '@metamask/keyring-utils';\n\nexport type EthKeyring = Keyring & {\n /**\n * Convert a base transaction to a base UserOperation.\n *\n * @param address - Address of the sender.\n * @param transactions - Base transactions to include in the UserOperation.\n * @param context - Keyring execution context.\n * @returns A pseudo-UserOperation that can be used to construct a real.\n */\n prepareUserOperation?(\n address: string,\n transactions: EthBaseTransaction[],\n context: KeyringExecutionContext,\n ): Promise<EthBaseUserOperation>;\n\n /**\n * Patches properties of a UserOperation. Currently, only the\n * `paymasterAndData` can be patched.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to patch.\n * @param context - Keyring execution context.\n * @returns A patch to apply to the UserOperation.\n */\n patchUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<EthUserOperationPatch>;\n\n /**\n * Signs an UserOperation.\n *\n * @param address - Address of the sender.\n * @param userOp - UserOperation to sign.\n * @param context - Keyring execution context.\n * @returns The signature of the UserOperation.\n */\n signUserOperation?(\n address: string,\n userOp: EthUserOperation,\n context: KeyringExecutionContext,\n ): Promise<string>;\n};\n"]}
package/dist/index.cjs CHANGED
@@ -16,5 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./compatibility/index.cjs"), exports);
18
18
  __exportStar(require("./types.cjs"), exports);
19
- __exportStar(require("./versions.cjs"), exports);
20
19
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAgC;AAEhC,8CAAwB;AACxB,iDAA2B","sourcesContent":["export * from './compatibility';\nexport type * from './eth';\nexport * from './types';\nexport * from './versions';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAgC;AAEhC,8CAAwB","sourcesContent":["export * from './compatibility';\nexport type * from './eth';\nexport * from './types';\n"]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from "./compatibility/index.cjs";
2
2
  export type * from "./eth/index.cjs";
3
3
  export * from "./types.cjs";
4
- export * from "./versions.cjs";
5
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAAgC;AAChC,qCAA2B;AAC3B,4BAAwB;AACxB,+BAA2B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAAgC;AAChC,qCAA2B;AAC3B,4BAAwB"}
package/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from "./compatibility/index.mjs";
2
2
  export type * from "./eth/index.mjs";
3
3
  export * from "./types.mjs";
4
- export * from "./versions.mjs";
5
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAAgC;AAChC,qCAA2B;AAC3B,4BAAwB;AACxB,+BAA2B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAAgC;AAChC,qCAA2B;AAC3B,4BAAwB"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from "./compatibility/index.mjs";
2
2
  export * from "./types.mjs";
3
- export * from "./versions.mjs";
4
3
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAAgC;AAEhC,4BAAwB;AACxB,+BAA2B","sourcesContent":["export * from './compatibility';\nexport type * from './eth';\nexport * from './types';\nexport * from './versions';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAAgC;AAEhC,4BAAwB","sourcesContent":["export * from './compatibility';\nexport type * from './eth';\nexport * from './types';\n"]}
package/dist/types.cjs CHANGED
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
- /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
2
+ // FIXME: eslint is complaning about our account union even if those accounts
3
+ // types should all be different, so we disable this for now:
3
4
  /* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
4
- // FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`
5
- // and `InternalAccountTypes`.
6
5
  Object.defineProperty(exports, "__esModule", { value: true });
7
6
  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
7
  const keyring_api_1 = require("@metamask/keyring-api");
@@ -12,10 +11,6 @@ exports.InternalAccountMetadataStruct = (0, keyring_utils_1.object)({
12
11
  metadata: (0, keyring_utils_1.object)({
13
12
  name: (0, superstruct_1.string)(),
14
13
  nameLastUpdatedAt: (0, keyring_utils_1.exactOptional)((0, superstruct_1.number)()),
15
- // We use `disabled` here instead of `enabled` since this can be optional
16
- // and better match this kind of expression: !disabled (which covers both
17
- // the `false` and `undefined` values.
18
- disabled: (0, keyring_utils_1.exactOptional)((0, superstruct_1.boolean)()),
19
14
  snap: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
20
15
  id: (0, superstruct_1.string)(),
21
16
  enabled: (0, superstruct_1.boolean)(),
@@ -1 +1 @@
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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ript-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 // We use `disabled` here instead of `enabled` since this can be optional\n // and better match this kind of expression: !disabled (which covers both\n // the `false` and `undefined` values.\n disabled: exactOptional(boolean()),\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"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,6EAA6E;AAC7E,6DAA6D;AAC7D,sEAAsE;;;AAEtE,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,C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M,EAAE,CAAC,EAAE,sCAA8B;IAC5D,CAAC,GAAG,4BAAc,CAAC,IAAI,EAAE,CAAC,EAAE,oCAA4B;IACxD,CAAC,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC,EAAE,oCAA4B;IAC/D,CAAC,GAAG,4BAAc,CAAC,GAAG,EAAE,CAAC,EAAE,mCAA2B;CACvD,CAAC;AAYW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["// FIXME: eslint is complaning about our account union even if those accounts\n// types should all be different, so we disable this for now:\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\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"]}