@metamask-previews/keyring-internal-api 9.1.1-e40d1ad → 9.1.1-feb98c5

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 (47) hide show
  1. package/CHANGELOG.md +9 -0
  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/index.cjs +0 -1
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +0 -1
  21. package/dist/index.d.cts.map +1 -1
  22. package/dist/index.d.mts +0 -1
  23. package/dist/index.d.mts.map +1 -1
  24. package/dist/index.mjs +0 -1
  25. package/dist/index.mjs.map +1 -1
  26. package/dist/types.cjs +3 -0
  27. package/dist/types.cjs.map +1 -1
  28. package/dist/types.d.cts +36 -0
  29. package/dist/types.d.cts.map +1 -1
  30. package/dist/types.d.mts +36 -0
  31. package/dist/types.d.mts.map +1 -1
  32. package/dist/types.mjs +3 -0
  33. package/dist/types.mjs.map +1 -1
  34. package/package.json +1 -1
  35. package/dist/compatibility/v1.cjs +0 -26
  36. package/dist/compatibility/v1.cjs.map +0 -1
  37. package/dist/compatibility/v1.d.cts.map +0 -1
  38. package/dist/compatibility/v1.d.mts.map +0 -1
  39. package/dist/compatibility/v1.mjs.map +0 -1
  40. package/dist/versions.cjs +0 -16
  41. package/dist/versions.cjs.map +0 -1
  42. package/dist/versions.d.cts +0 -12
  43. package/dist/versions.d.cts.map +0 -1
  44. package/dist/versions.d.mts +0 -12
  45. package/dist/versions.d.mts.map +0 -1
  46. package/dist/versions.mjs +0 -13
  47. package/dist/versions.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ 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
+
10
19
  ## [9.1.1]
11
20
 
12
21
  ### Changed
@@ -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"]}
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,4 +1,7 @@
1
1
  "use strict";
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:
4
+ /* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
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;
4
7
  const keyring_api_1 = require("@metamask/keyring-api");
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,uDAc+B;AAC/B,2DAAgE;AAEhE,uDAAgE;AAQnD,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QAAQ,EAAE,IAAA,sBAAM,EAAC;QACf,IAAI,EAAE,IAAA,oBAAM,GAAE;QACd,iBAAiB,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAC1C,IAAI,EAAE,IAAA,6BAAa,EACjB,IAAA,sBAAM,EAAC;YACL,EAAE,EAAE,IAAA,oBAAM,GAAE;YACZ,OAAO,EAAE,IAAA,qBAAO,GAAE;YAClB,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC,CACH;QACD,YAAY,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QACrC,UAAU,EAAE,IAAA,oBAAM,GAAE;QACpB,OAAO,EAAE,IAAA,sBAAM,EAAC;YACd,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,GAAG,iCAAmB,CAAC,MAAM;IAC7B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,IAAA,sBAAM,EAAC;IACpD,GAAG,qCAAuB,CAAC,MAAM;IACjC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,GAAG,mCAAqB,CAAC,MAAM;IAC/B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,IAAA,sBAAM,EAAC;IACjD,GAAG,kCAAoB,CAAC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,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["import {\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"]}
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,CAAC;AAEU,QAAA,+BAA+B,GAAG,IAAA,sBAAM,EAAC;IACpD,GAAG,qCAAuB,CAAC,MAAM;IACjC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,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AE,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"]}
package/dist/types.d.cts CHANGED
@@ -62,6 +62,8 @@ export declare const InternalEthEoaAccountStruct: Struct<{
62
62
  groupIndex: number;
63
63
  } | {
64
64
  type: "private-key";
65
+ } | {
66
+ type: "custom";
65
67
  };
66
68
  exportable?: boolean;
67
69
  };
@@ -136,6 +138,8 @@ export declare const InternalEthEoaAccountStruct: Struct<{
136
138
  groupIndex: number;
137
139
  } | {
138
140
  type: "private-key";
141
+ } | {
142
+ type: "custom";
139
143
  };
140
144
  exportable?: boolean;
141
145
  }, null>;
@@ -151,6 +155,8 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
151
155
  groupIndex: number;
152
156
  } | {
153
157
  type: "private-key";
158
+ } | {
159
+ type: "custom";
154
160
  };
155
161
  exportable?: boolean;
156
162
  };
@@ -227,6 +233,8 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
227
233
  groupIndex: number;
228
234
  } | {
229
235
  type: "private-key";
236
+ } | {
237
+ type: "custom";
230
238
  };
231
239
  exportable?: boolean;
232
240
  }, null>;
@@ -242,6 +250,8 @@ export declare const InternalBtcP2pkhAccountStruct: Struct<{
242
250
  groupIndex: number;
243
251
  } | {
244
252
  type: "private-key";
253
+ } | {
254
+ type: "custom";
245
255
  };
246
256
  exportable?: boolean;
247
257
  };
@@ -319,6 +329,8 @@ export declare const InternalBtcP2pkhAccountStruct: Struct<{
319
329
  groupIndex: number;
320
330
  } | {
321
331
  type: "private-key";
332
+ } | {
333
+ type: "custom";
322
334
  };
323
335
  exportable?: boolean;
324
336
  }, null>;
@@ -334,6 +346,8 @@ export declare const InternalBtcP2shAccountStruct: Struct<{
334
346
  groupIndex: number;
335
347
  } | {
336
348
  type: "private-key";
349
+ } | {
350
+ type: "custom";
337
351
  };
338
352
  exportable?: boolean;
339
353
  };
@@ -411,6 +425,8 @@ export declare const InternalBtcP2shAccountStruct: Struct<{
411
425
  groupIndex: number;
412
426
  } | {
413
427
  type: "private-key";
428
+ } | {
429
+ type: "custom";
414
430
  };
415
431
  exportable?: boolean;
416
432
  }, null>;
@@ -426,6 +442,8 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
426
442
  groupIndex: number;
427
443
  } | {
428
444
  type: "private-key";
445
+ } | {
446
+ type: "custom";
429
447
  };
430
448
  exportable?: boolean;
431
449
  };
@@ -503,6 +521,8 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
503
521
  groupIndex: number;
504
522
  } | {
505
523
  type: "private-key";
524
+ } | {
525
+ type: "custom";
506
526
  };
507
527
  exportable?: boolean;
508
528
  }, null>;
@@ -518,6 +538,8 @@ export declare const InternalBtcP2trAccountStruct: Struct<{
518
538
  groupIndex: number;
519
539
  } | {
520
540
  type: "private-key";
541
+ } | {
542
+ type: "custom";
521
543
  };
522
544
  exportable?: boolean;
523
545
  };
@@ -595,6 +617,8 @@ export declare const InternalBtcP2trAccountStruct: Struct<{
595
617
  groupIndex: number;
596
618
  } | {
597
619
  type: "private-key";
620
+ } | {
621
+ type: "custom";
598
622
  };
599
623
  exportable?: boolean;
600
624
  }, null>;
@@ -610,6 +634,8 @@ export declare const InternalSolDataAccountStruct: Struct<{
610
634
  groupIndex: number;
611
635
  } | {
612
636
  type: "private-key";
637
+ } | {
638
+ type: "custom";
613
639
  };
614
640
  exportable?: boolean;
615
641
  };
@@ -683,6 +709,8 @@ export declare const InternalSolDataAccountStruct: Struct<{
683
709
  groupIndex: number;
684
710
  } | {
685
711
  type: "private-key";
712
+ } | {
713
+ type: "custom";
686
714
  };
687
715
  exportable?: boolean;
688
716
  }, null>;
@@ -698,6 +726,8 @@ export declare const InternalTrxEoaAccountStruct: Struct<{
698
726
  groupIndex: number;
699
727
  } | {
700
728
  type: "private-key";
729
+ } | {
730
+ type: "custom";
701
731
  };
702
732
  exportable?: boolean;
703
733
  };
@@ -770,6 +800,8 @@ export declare const InternalTrxEoaAccountStruct: Struct<{
770
800
  groupIndex: number;
771
801
  } | {
772
802
  type: "private-key";
803
+ } | {
804
+ type: "custom";
773
805
  };
774
806
  exportable?: boolean;
775
807
  }, null>;
@@ -795,6 +827,8 @@ export declare const InternalAccountStruct: Struct<{
795
827
  groupIndex: number;
796
828
  } | {
797
829
  type: "private-key";
830
+ } | {
831
+ type: "custom";
798
832
  };
799
833
  exportable?: boolean;
800
834
  };
@@ -871,6 +905,8 @@ export declare const InternalAccountStruct: Struct<{
871
905
  groupIndex: number;
872
906
  } | {
873
907
  type: "private-key";
908
+ } | {
909
+ type: "custom";
874
910
  };
875
911
  exportable?: boolean;
876
912
  }, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EAQd,cAAc,EAEf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAG3D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiBxC,CAAC;AAEH,eAAO,MAAM,2BA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GAAG,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAEhF,MAAM,MAAM,qBAAqB,GAAG,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC;AAE9E,eAAO,MAAM,sBAAsB,EAAE,MAAM,CACzC,MAAM,EACJ,MAAM,CAAC,qBAAqB,CAAC,GAC7B,MAAM,CAAC,yBAAyB,CAAC,GACjC,MAAM,CAAC,uBAAuB,CAAC,GAC/B,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,wBAAwB,CAAC,GAChC,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,sBAAsB,CAAC,GAC9B,MAAM,CAAC,qBAAqB,CAAC,CAUhC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,uBAAuB,GACvB,sBAAsB,GACtB,wBAAwB,GACxB,sBAAsB,GACtB,sBAAsB,GACtB,qBAAqB,CAAC;AAE1B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAThC,CAAF;;;;;;;;;;kBASsB,CAAC;;;EAGrB,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
package/dist/types.d.mts CHANGED
@@ -62,6 +62,8 @@ export declare const InternalEthEoaAccountStruct: Struct<{
62
62
  groupIndex: number;
63
63
  } | {
64
64
  type: "private-key";
65
+ } | {
66
+ type: "custom";
65
67
  };
66
68
  exportable?: boolean;
67
69
  };
@@ -136,6 +138,8 @@ export declare const InternalEthEoaAccountStruct: Struct<{
136
138
  groupIndex: number;
137
139
  } | {
138
140
  type: "private-key";
141
+ } | {
142
+ type: "custom";
139
143
  };
140
144
  exportable?: boolean;
141
145
  }, null>;
@@ -151,6 +155,8 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
151
155
  groupIndex: number;
152
156
  } | {
153
157
  type: "private-key";
158
+ } | {
159
+ type: "custom";
154
160
  };
155
161
  exportable?: boolean;
156
162
  };
@@ -227,6 +233,8 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
227
233
  groupIndex: number;
228
234
  } | {
229
235
  type: "private-key";
236
+ } | {
237
+ type: "custom";
230
238
  };
231
239
  exportable?: boolean;
232
240
  }, null>;
@@ -242,6 +250,8 @@ export declare const InternalBtcP2pkhAccountStruct: Struct<{
242
250
  groupIndex: number;
243
251
  } | {
244
252
  type: "private-key";
253
+ } | {
254
+ type: "custom";
245
255
  };
246
256
  exportable?: boolean;
247
257
  };
@@ -319,6 +329,8 @@ export declare const InternalBtcP2pkhAccountStruct: Struct<{
319
329
  groupIndex: number;
320
330
  } | {
321
331
  type: "private-key";
332
+ } | {
333
+ type: "custom";
322
334
  };
323
335
  exportable?: boolean;
324
336
  }, null>;
@@ -334,6 +346,8 @@ export declare const InternalBtcP2shAccountStruct: Struct<{
334
346
  groupIndex: number;
335
347
  } | {
336
348
  type: "private-key";
349
+ } | {
350
+ type: "custom";
337
351
  };
338
352
  exportable?: boolean;
339
353
  };
@@ -411,6 +425,8 @@ export declare const InternalBtcP2shAccountStruct: Struct<{
411
425
  groupIndex: number;
412
426
  } | {
413
427
  type: "private-key";
428
+ } | {
429
+ type: "custom";
414
430
  };
415
431
  exportable?: boolean;
416
432
  }, null>;
@@ -426,6 +442,8 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
426
442
  groupIndex: number;
427
443
  } | {
428
444
  type: "private-key";
445
+ } | {
446
+ type: "custom";
429
447
  };
430
448
  exportable?: boolean;
431
449
  };
@@ -503,6 +521,8 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
503
521
  groupIndex: number;
504
522
  } | {
505
523
  type: "private-key";
524
+ } | {
525
+ type: "custom";
506
526
  };
507
527
  exportable?: boolean;
508
528
  }, null>;
@@ -518,6 +538,8 @@ export declare const InternalBtcP2trAccountStruct: Struct<{
518
538
  groupIndex: number;
519
539
  } | {
520
540
  type: "private-key";
541
+ } | {
542
+ type: "custom";
521
543
  };
522
544
  exportable?: boolean;
523
545
  };
@@ -595,6 +617,8 @@ export declare const InternalBtcP2trAccountStruct: Struct<{
595
617
  groupIndex: number;
596
618
  } | {
597
619
  type: "private-key";
620
+ } | {
621
+ type: "custom";
598
622
  };
599
623
  exportable?: boolean;
600
624
  }, null>;
@@ -610,6 +634,8 @@ export declare const InternalSolDataAccountStruct: Struct<{
610
634
  groupIndex: number;
611
635
  } | {
612
636
  type: "private-key";
637
+ } | {
638
+ type: "custom";
613
639
  };
614
640
  exportable?: boolean;
615
641
  };
@@ -683,6 +709,8 @@ export declare const InternalSolDataAccountStruct: Struct<{
683
709
  groupIndex: number;
684
710
  } | {
685
711
  type: "private-key";
712
+ } | {
713
+ type: "custom";
686
714
  };
687
715
  exportable?: boolean;
688
716
  }, null>;
@@ -698,6 +726,8 @@ export declare const InternalTrxEoaAccountStruct: Struct<{
698
726
  groupIndex: number;
699
727
  } | {
700
728
  type: "private-key";
729
+ } | {
730
+ type: "custom";
701
731
  };
702
732
  exportable?: boolean;
703
733
  };
@@ -770,6 +800,8 @@ export declare const InternalTrxEoaAccountStruct: Struct<{
770
800
  groupIndex: number;
771
801
  } | {
772
802
  type: "private-key";
803
+ } | {
804
+ type: "custom";
773
805
  };
774
806
  exportable?: boolean;
775
807
  }, null>;
@@ -795,6 +827,8 @@ export declare const InternalAccountStruct: Struct<{
795
827
  groupIndex: number;
796
828
  } | {
797
829
  type: "private-key";
830
+ } | {
831
+ type: "custom";
798
832
  };
799
833
  exportable?: boolean;
800
834
  };
@@ -871,6 +905,8 @@ export declare const InternalAccountStruct: Struct<{
871
905
  groupIndex: number;
872
906
  } | {
873
907
  type: "private-key";
908
+ } | {
909
+ type: "custom";
874
910
  };
875
911
  exportable?: boolean;
876
912
  }, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":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GED
@@ -1,3 +1,6 @@
1
+ // FIXME: eslint is complaning about our account union even if those accounts
2
+ // types should all be different, so we disable this for now:
3
+ /* eslint-disable @typescript-eslint/no-duplicate-type-constituents */
1
4
  import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2pkhAccountStruct, BtcP2shAccountStruct, BtcP2wpkhAccountStruct, BtcP2trAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct, TrxAccountType, TrxEoaAccountStruct } from "@metamask/keyring-api";
2
5
  import { exactOptional, object } from "@metamask/keyring-utils";
3
6
  import { boolean, string, number } from "@metamask/superstruct";
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACpB,8BAA8B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAQhE,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;IAClD,QAAQ,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,EAAE;QACd,iBAAiB,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;QAC1C,IAAI,EAAE,aAAa,CACjB,MAAM,CAAC;YACL,EAAE,EAAE,MAAM,EAAE;YACZ,OAAO,EAAE,OAAO,EAAE;YAClB,IAAI,EAAE,MAAM,EAAE;SACf,CAAC,CACH;QACD,YAAY,EAAE,aAAa,CAAC,MAAM,EAAE,CAAC;QACrC,UAAU,EAAE,MAAM,EAAE;QACpB,OAAO,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,EAAE;S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,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,+BAA+B;IAC9D,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,6BAA6B;IAC1D,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,4BAA4B;IACxD,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,8BAA8B;IAC5D,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,4BAA4B;IACxD,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,EAAE,4BAA4B;IAC/D,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,2BAA2B;CACvD,CAAC;AAYF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;IAC1C,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["import {\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"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,6DAA6D;AAC7D,sEAAsE;AAEtE,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACpB,8BAA8B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAQhE,MAAM,CAAC,MAAM,6BAA6B,GAAG,MA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xC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,GAAG,mBAAmB,CAAC,MAAM;IAC7B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAwBH,MAAM,CAAC,MAAM,sBAAsB,GAU/B;IACF,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,2BAA2B;IACtD,CAAC,GAAG,cAAc,CAAC,OAAO,EAAE,CAAC,EAAE,+BAA+B;IAC9D,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,CAAC,EAAE,6BAA6B;IAC1D,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,4BAA4B;IACxD,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,8BAA8B;IAC5D,CAAC,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,EAAE,4BAA4B;IACxD,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,EAAE,4BAA4B;IAC/D,CAAC,GAAG,cAAc,CAAC,GAAG,EAAE,CAAC,EAAE,2BAA2B;CACvD,CAAC;AAYF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;IAC1C,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["// 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/keyring-internal-api",
3
- "version": "9.1.1-e40d1ad",
3
+ "version": "9.1.1-feb98c5",
4
4
  "description": "MetaMask Keyring Internal API",
5
5
  "keywords": [
6
6
  "metamask",
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SubmitRequestResponseV1Struct = exports.KeyringResponseV1Struct = exports.KeyringRequestV1Struct = void 0;
4
- exports.toKeyringRequestV1 = toKeyringRequestV1;
5
- const keyring_api_1 = require("@metamask/keyring-api");
6
- const superstruct_1 = require("@metamask/superstruct");
7
- /**
8
- * Keyring request (v1).
9
- */
10
- exports.KeyringRequestV1Struct = (0, superstruct_1.omit)(keyring_api_1.KeyringRequestStruct, ['origin']);
11
- /**
12
- * Response to a call to `submitRequest` (v1).
13
- */
14
- exports.KeyringResponseV1Struct = keyring_api_1.KeyringResponseStruct;
15
- exports.SubmitRequestResponseV1Struct = exports.KeyringResponseV1Struct;
16
- /**
17
- * Converts a keyring request to a keyring request v1.
18
- *
19
- * @param request - A keyring request.
20
- * @returns A keyring request v1.
21
- */
22
- function toKeyringRequestV1(request) {
23
- const { origin, ...requestV1 } = request;
24
- return requestV1;
25
- }
26
- //# sourceMappingURL=v1.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"v1.cjs","sourceRoot":"","sources":["../../src/compatibility/v1.ts"],"names":[],"mappings":";;;AA6BA,gDAIC;AAhCD,uDAG+B;AAC/B,uDAAyD;AAEzD;;GAEG;AACU,QAAA,sBAAsB,GAAG,IAAA,kBAAI,EAAC,kCAAoB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AAI7E;;GAEG;AACU,QAAA,uBAAuB,GAAG,mCAAqB,CAAC;AAIhD,QAAA,6BAA6B,GAAG,+BAAuB,CAAC;AAErE;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,OAAuB;IACxD,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 (v1).\n */\nexport const KeyringRequestV1Struct = omit(KeyringRequestStruct, ['origin']);\n\nexport type KeyringRequestV1 = Infer<typeof KeyringRequestV1Struct>;\n\n/**\n * Response to a call to `submitRequest` (v1).\n */\nexport const KeyringResponseV1Struct = KeyringResponseStruct;\n\nexport type KeyringResponseV1 = Infer<typeof KeyringResponseV1Struct>;\n\nexport const SubmitRequestResponseV1Struct = KeyringResponseV1Struct;\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 toKeyringRequestV1(request: KeyringRequest): KeyringRequestV1 {\n const { origin, ...requestV1 } = request;\n\n return requestV1;\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v1.d.cts","sourceRoot":"","sources":["../../src/compatibility/v1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAK5D,OAAO,EAAQ,KAAK,KAAK,EAAE,8BAA8B;AAEzD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;cAwBS,CAAC;;;;;aAxB+B,CAAC;AAE7E,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;eAZC,CAAC;WAKtC,CAHC;;;;;QAU2D,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtE,eAAO,MAAM,6BAA6B;;;eAhBL,CAAC;WAKtC,CAHC;;;;;QAcmE,CAAC;AAErE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB,CAI5E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v1.d.mts","sourceRoot":"","sources":["../../src/compatibility/v1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,8BAA8B;AAK5D,OAAO,EAAQ,KAAK,KAAK,EAAE,8BAA8B;AAEzD;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;cAwBS,CAAC;;;;;aAxB+B,CAAC;AAE7E,MAAM,MAAM,gBAAgB,GAAG,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;eAZC,CAAC;WAKtC,CAHC;;;;;QAU2D,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEtE,eAAO,MAAM,6BAA6B;;;eAhBL,CAAC;WAKtC,CAHC;;;;;QAcmE,CAAC;AAErE;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,gBAAgB,CAI5E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"v1.mjs","sourceRoot":"","sources":["../../src/compatibility/v1.ts"],"names":[],"mappings":"AACA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACtB,8BAA8B;AAC/B,OAAO,EAAE,IAAI,EAAc,8BAA8B;AAEzD;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;AAI7E;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,qBAAqB,CAAC;AAI7D,MAAM,CAAC,MAAM,6BAA6B,GAAG,uBAAuB,CAAC;AAErE;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAuB;IACxD,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 (v1).\n */\nexport const KeyringRequestV1Struct = omit(KeyringRequestStruct, ['origin']);\n\nexport type KeyringRequestV1 = Infer<typeof KeyringRequestV1Struct>;\n\n/**\n * Response to a call to `submitRequest` (v1).\n */\nexport const KeyringResponseV1Struct = KeyringResponseStruct;\n\nexport type KeyringResponseV1 = Infer<typeof KeyringResponseV1Struct>;\n\nexport const SubmitRequestResponseV1Struct = KeyringResponseV1Struct;\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 toKeyringRequestV1(request: KeyringRequest): KeyringRequestV1 {\n const { origin, ...requestV1 } = request;\n\n return requestV1;\n}\n"]}
package/dist/versions.cjs DELETED
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KeyringVersion = void 0;
4
- var KeyringVersion;
5
- (function (KeyringVersion) {
6
- /** Default. */
7
- KeyringVersion["V1"] = "v1";
8
- /**
9
- * Introduction of `KeyringRequest.origin`.
10
- *
11
- * Snap will now receive the `origin` as part of a `KeyringRequest` when `submitRequest` is invoked.
12
- * We also expect Snaps to display this `origin` in their confirmation screens (if any).
13
- */
14
- KeyringVersion["V2"] = "v2";
15
- })(KeyringVersion || (exports.KeyringVersion = KeyringVersion = {}));
16
- //# sourceMappingURL=versions.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.cjs","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":";;;AAAA,IAAY,cAWX;AAXD,WAAY,cAAc;IACxB,eAAe;IACf,2BAAS,CAAA;IAET;;;;;OAKG;IACH,2BAAS,CAAA;AACX,CAAC,EAXW,cAAc,8BAAd,cAAc,QAWzB","sourcesContent":["export enum KeyringVersion {\n /** Default. */\n V1 = 'v1',\n\n /**\n * Introduction of `KeyringRequest.origin`.\n *\n * Snap will now receive the `origin` as part of a `KeyringRequest` when `submitRequest` is invoked.\n * We also expect Snaps to display this `origin` in their confirmation screens (if any).\n */\n V2 = 'v2',\n}\n"]}
@@ -1,12 +0,0 @@
1
- export declare enum KeyringVersion {
2
- /** Default. */
3
- V1 = "v1",
4
- /**
5
- * Introduction of `KeyringRequest.origin`.
6
- *
7
- * Snap will now receive the `origin` as part of a `KeyringRequest` when `submitRequest` is invoked.
8
- * We also expect Snaps to display this `origin` in their confirmation screens (if any).
9
- */
10
- V2 = "v2"
11
- }
12
- //# sourceMappingURL=versions.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.d.cts","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,eAAe;IACf,EAAE,OAAO;IAET;;;;;OAKG;IACH,EAAE,OAAO;CACV"}
@@ -1,12 +0,0 @@
1
- export declare enum KeyringVersion {
2
- /** Default. */
3
- V1 = "v1",
4
- /**
5
- * Introduction of `KeyringRequest.origin`.
6
- *
7
- * Snap will now receive the `origin` as part of a `KeyringRequest` when `submitRequest` is invoked.
8
- * We also expect Snaps to display this `origin` in their confirmation screens (if any).
9
- */
10
- V2 = "v2"
11
- }
12
- //# sourceMappingURL=versions.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.d.mts","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc;IACxB,eAAe;IACf,EAAE,OAAO;IAET;;;;;OAKG;IACH,EAAE,OAAO;CACV"}
package/dist/versions.mjs DELETED
@@ -1,13 +0,0 @@
1
- export var KeyringVersion;
2
- (function (KeyringVersion) {
3
- /** Default. */
4
- KeyringVersion["V1"] = "v1";
5
- /**
6
- * Introduction of `KeyringRequest.origin`.
7
- *
8
- * Snap will now receive the `origin` as part of a `KeyringRequest` when `submitRequest` is invoked.
9
- * We also expect Snaps to display this `origin` in their confirmation screens (if any).
10
- */
11
- KeyringVersion["V2"] = "v2";
12
- })(KeyringVersion || (KeyringVersion = {}));
13
- //# sourceMappingURL=versions.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"versions.mjs","sourceRoot":"","sources":["../src/versions.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAWX;AAXD,WAAY,cAAc;IACxB,eAAe;IACf,2BAAS,CAAA;IAET;;;;;OAKG;IACH,2BAAS,CAAA;AACX,CAAC,EAXW,cAAc,KAAd,cAAc,QAWzB","sourcesContent":["export enum KeyringVersion {\n /** Default. */\n V1 = 'v1',\n\n /**\n * Introduction of `KeyringRequest.origin`.\n *\n * Snap will now receive the `origin` as part of a `KeyringRequest` when `submitRequest` is invoked.\n * We also expect Snaps to display this `origin` in their confirmation screens (if any).\n */\n V2 = 'v2',\n}\n"]}