@metamask-previews/keyring-internal-api 6.0.1-33a98a2 → 6.0.1-c335bed

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 (41) hide show
  1. package/dist/compatibility/index.cjs +18 -0
  2. package/dist/compatibility/index.cjs.map +1 -0
  3. package/dist/compatibility/index.d.cts +2 -0
  4. package/dist/compatibility/index.d.cts.map +1 -0
  5. package/dist/compatibility/index.d.mts +2 -0
  6. package/dist/compatibility/index.d.mts.map +1 -0
  7. package/dist/compatibility/index.mjs +2 -0
  8. package/dist/compatibility/index.mjs.map +1 -0
  9. package/dist/compatibility/v1.cjs +26 -0
  10. package/dist/compatibility/v1.cjs.map +1 -0
  11. package/dist/compatibility/v1.d.cts +59 -0
  12. package/dist/compatibility/v1.d.cts.map +1 -0
  13. package/dist/compatibility/v1.d.mts +59 -0
  14. package/dist/compatibility/v1.d.mts.map +1 -0
  15. package/dist/compatibility/v1.mjs +22 -0
  16. package/dist/compatibility/v1.mjs.map +1 -0
  17. package/dist/index.cjs +2 -0
  18. package/dist/index.cjs.map +1 -1
  19. package/dist/index.d.cts +2 -0
  20. package/dist/index.d.cts.map +1 -1
  21. package/dist/index.d.mts +2 -0
  22. package/dist/index.d.mts.map +1 -1
  23. package/dist/index.mjs +2 -0
  24. package/dist/index.mjs.map +1 -1
  25. package/dist/types.cjs +2 -0
  26. package/dist/types.cjs.map +1 -1
  27. package/dist/types.d.cts +48 -0
  28. package/dist/types.d.cts.map +1 -1
  29. package/dist/types.d.mts +48 -0
  30. package/dist/types.d.mts.map +1 -1
  31. package/dist/types.mjs +3 -1
  32. package/dist/types.mjs.map +1 -1
  33. package/dist/versions.cjs +16 -0
  34. package/dist/versions.cjs.map +1 -0
  35. package/dist/versions.d.cts +12 -0
  36. package/dist/versions.d.cts.map +1 -0
  37. package/dist/versions.d.mts +12 -0
  38. package/dist/versions.d.mts.map +1 -0
  39. package/dist/versions.mjs +13 -0
  40. package/dist/versions.mjs.map +1 -0
  41. package/package.json +1 -1
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./v1.cjs"), exports);
18
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAqB","sourcesContent":["export * from './v1';\n"]}
@@ -0,0 +1,2 @@
1
+ export * from "./v1.cjs";
2
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,yBAAqB"}
@@ -0,0 +1,2 @@
1
+ export * from "./v1.mjs";
2
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,yBAAqB"}
@@ -0,0 +1,2 @@
1
+ export * from "./v1.mjs";
2
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/compatibility/index.ts"],"names":[],"mappings":"AAAA,yBAAqB","sourcesContent":["export * from './v1';\n"]}
@@ -0,0 +1,26 @@
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
@@ -0,0 +1 @@
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"]}
@@ -0,0 +1,59 @@
1
+ import type { KeyringRequest } from "@metamask/keyring-api";
2
+ import { type Infer } from "@metamask/superstruct";
3
+ /**
4
+ * Keyring request (v1).
5
+ */
6
+ export declare const KeyringRequestV1Struct: import("@metamask/superstruct").Struct<{
7
+ id: string;
8
+ request: {
9
+ method: string;
10
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
11
+ };
12
+ scope: string;
13
+ account: string;
14
+ }, Omit<{
15
+ id: import("@metamask/superstruct").Struct<string, null>;
16
+ scope: import("@metamask/superstruct").Struct<string, null>;
17
+ account: import("@metamask/superstruct").Struct<string, null>;
18
+ origin: import("@metamask/superstruct").Struct<string, null>;
19
+ request: import("@metamask/superstruct").Struct<{
20
+ method: string;
21
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
22
+ }, {
23
+ method: import("@metamask/superstruct").Struct<string, null>;
24
+ params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
25
+ }>;
26
+ }, "origin">>;
27
+ export type KeyringRequestV1 = Infer<typeof KeyringRequestV1Struct>;
28
+ /**
29
+ * Response to a call to `submitRequest` (v1).
30
+ */
31
+ export declare const KeyringResponseV1Struct: import("@metamask/superstruct").Struct<{
32
+ pending: true;
33
+ redirect?: {
34
+ message?: string;
35
+ url?: string;
36
+ };
37
+ } | {
38
+ result: import("@metamask/utils").Json;
39
+ pending: false;
40
+ }, null>;
41
+ export type KeyringResponseV1 = Infer<typeof KeyringResponseV1Struct>;
42
+ export declare const SubmitRequestResponseV1Struct: import("@metamask/superstruct").Struct<{
43
+ pending: true;
44
+ redirect?: {
45
+ message?: string;
46
+ url?: string;
47
+ };
48
+ } | {
49
+ result: import("@metamask/utils").Json;
50
+ pending: false;
51
+ }, null>;
52
+ /**
53
+ * Converts a keyring request to a keyring request v1.
54
+ *
55
+ * @param request - A keyring request.
56
+ * @returns A keyring request v1.
57
+ */
58
+ export declare function toKeyringRequestV1(request: KeyringRequest): KeyringRequestV1;
59
+ //# sourceMappingURL=v1.d.cts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,59 @@
1
+ import type { KeyringRequest } from "@metamask/keyring-api";
2
+ import { type Infer } from "@metamask/superstruct";
3
+ /**
4
+ * Keyring request (v1).
5
+ */
6
+ export declare const KeyringRequestV1Struct: import("@metamask/superstruct").Struct<{
7
+ id: string;
8
+ request: {
9
+ method: string;
10
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
11
+ };
12
+ scope: string;
13
+ account: string;
14
+ }, Omit<{
15
+ id: import("@metamask/superstruct").Struct<string, null>;
16
+ scope: import("@metamask/superstruct").Struct<string, null>;
17
+ account: import("@metamask/superstruct").Struct<string, null>;
18
+ origin: import("@metamask/superstruct").Struct<string, null>;
19
+ request: import("@metamask/superstruct").Struct<{
20
+ method: string;
21
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
22
+ }, {
23
+ method: import("@metamask/superstruct").Struct<string, null>;
24
+ params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("@metamask/keyring-utils").ExactOptionalTag, null>;
25
+ }>;
26
+ }, "origin">>;
27
+ export type KeyringRequestV1 = Infer<typeof KeyringRequestV1Struct>;
28
+ /**
29
+ * Response to a call to `submitRequest` (v1).
30
+ */
31
+ export declare const KeyringResponseV1Struct: import("@metamask/superstruct").Struct<{
32
+ pending: true;
33
+ redirect?: {
34
+ message?: string;
35
+ url?: string;
36
+ };
37
+ } | {
38
+ result: import("@metamask/utils").Json;
39
+ pending: false;
40
+ }, null>;
41
+ export type KeyringResponseV1 = Infer<typeof KeyringResponseV1Struct>;
42
+ export declare const SubmitRequestResponseV1Struct: import("@metamask/superstruct").Struct<{
43
+ pending: true;
44
+ redirect?: {
45
+ message?: string;
46
+ url?: string;
47
+ };
48
+ } | {
49
+ result: import("@metamask/utils").Json;
50
+ pending: false;
51
+ }, null>;
52
+ /**
53
+ * Converts a keyring request to a keyring request v1.
54
+ *
55
+ * @param request - A keyring request.
56
+ * @returns A keyring request v1.
57
+ */
58
+ export declare function toKeyringRequestV1(request: KeyringRequest): KeyringRequestV1;
59
+ //# sourceMappingURL=v1.d.mts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,22 @@
1
+ import { KeyringRequestStruct, KeyringResponseStruct } from "@metamask/keyring-api";
2
+ import { omit } from "@metamask/superstruct";
3
+ /**
4
+ * Keyring request (v1).
5
+ */
6
+ export const KeyringRequestV1Struct = omit(KeyringRequestStruct, ['origin']);
7
+ /**
8
+ * Response to a call to `submitRequest` (v1).
9
+ */
10
+ export const KeyringResponseV1Struct = KeyringResponseStruct;
11
+ export const SubmitRequestResponseV1Struct = KeyringResponseV1Struct;
12
+ /**
13
+ * Converts a keyring request to a keyring request v1.
14
+ *
15
+ * @param request - A keyring request.
16
+ * @returns A keyring request v1.
17
+ */
18
+ export function toKeyringRequestV1(request) {
19
+ const { origin, ...requestV1 } = request;
20
+ return requestV1;
21
+ }
22
+ //# sourceMappingURL=v1.mjs.map
@@ -0,0 +1 @@
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/index.cjs CHANGED
@@ -14,5 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./compatibility/index.cjs"), exports);
17
18
  __exportStar(require("./types.cjs"), exports);
19
+ __exportStar(require("./versions.cjs"), exports);
18
20
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,8CAAwB","sourcesContent":["export type * from './eth';\nexport * from './types';\n"]}
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"]}
package/dist/index.d.cts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from "./compatibility/index.cjs";
1
2
  export type * from "./eth/index.cjs";
2
3
  export * from "./types.cjs";
4
+ export * from "./versions.cjs";
3
5
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAA2B;AAC3B,4BAAwB"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAAgC;AAChC,qCAA2B;AAC3B,4BAAwB;AACxB,+BAA2B"}
package/dist/index.d.mts CHANGED
@@ -1,3 +1,5 @@
1
+ export * from "./compatibility/index.mjs";
1
2
  export type * from "./eth/index.mjs";
2
3
  export * from "./types.mjs";
4
+ export * from "./versions.mjs";
3
5
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qCAA2B;AAC3B,4BAAwB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0CAAgC;AAChC,qCAA2B;AAC3B,4BAAwB;AACxB,+BAA2B"}
package/dist/index.mjs CHANGED
@@ -1,2 +1,4 @@
1
+ export * from "./compatibility/index.mjs";
1
2
  export * from "./types.mjs";
3
+ export * from "./versions.mjs";
2
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,4BAAwB","sourcesContent":["export type * from './eth';\nexport * from './types';\n"]}
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"]}
package/dist/types.cjs CHANGED
@@ -14,6 +14,8 @@ exports.InternalAccountMetadataStruct = (0, keyring_utils_1.object)({
14
14
  nameLastUpdatedAt: (0, keyring_utils_1.exactOptional)((0, superstruct_1.number)()),
15
15
  snap: (0, keyring_utils_1.exactOptional)((0, keyring_utils_1.object)({
16
16
  id: (0, superstruct_1.string)(),
17
+ enabled: (0, superstruct_1.boolean)(),
18
+ name: (0, superstruct_1.string)(),
17
19
  })),
18
20
  lastSelected: (0, keyring_utils_1.exactOptional)((0, superstruct_1.number)()),
19
21
  importTime: (0, superstruct_1.number)(),
@@ -1 +1 @@
1
- {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;;;AAE9B,uDAS+B;AAC/B,2DAAgE;AAEhE,uDAAuD;AAO1C,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QAAQ,EAAE,IAAA,sB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CAChE,CAAC;AAQW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2wpkhAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n }),\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 InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2wpkhAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.cjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;;;AAE9B,uDAS+B;AAC/B,2DAAgE;AAEhE,uDAAgE;AAOnD,QAAA,6BAA6B,GAAG,IAAA,sBAAM,EAAC;IAClD,QAAQ,EAAE,IAAA,sBAAM,EAAC;QACf,IAAI,EAAE,IAAA,oBAAM,GAAE;QACd,iBAAiB,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAC1C,IAAI,EAAE,IAAA,6BAAa,EACjB,IAAA,sBAAM,EAAC;YACL,EAAE,EAAE,IAAA,oBAAM,GAAE;YACZ,OAAO,EAAE,IAAA,qBAAO,GAAE;YAClB,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC,CACH;QACD,YAAY,EAAE,IAAA,6BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QACrC,UAAU,EAAE,IAAA,oBAAM,GAAE;QACpB,OAAO,EAAE,IAAA,sBAAM,EAAC;YACd,IAAI,EAAE,IAAA,oBAAM,GAAE;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,sBAAM,EAAC;IAChD,GAAG,iCAAmB,CAAC,MAAM;IAC7B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,+BAA+B,GAAG,IAAA,sBAAM,EAAC;IACpD,GAAG,qCAAuB,CAAC,MAAM;IACjC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,IAAA,sBAAM,EAAC;IACnD,GAAG,oCAAsB,CAAC,MAAM;IAChC,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEU,QAAA,4BAA4B,GAAG,IAAA,sBAAM,EAAC;IACjD,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAcU,QAAA,sBAAsB,GAM/B;IACF,CAAC,GAAG,4BAAc,CAAC,GAAG,EAAE,CAAC,EAAE,mCAA2B;IACtD,CAAC,GAAG,4BAAc,CAAC,OAAO,EAAE,CAAC,EAAE,uCAA+B;IAC9D,CAAC,GAAG,4BAAc,CAAC,MAAM,EAAE,CAAC,EAAE,sCAA8B;IAC5D,CAAC,GAAG,4BAAc,CAAC,WAAW,EAAE,CAAC,EAAE,oCAA4B;CAChE,CAAC;AAQW,QAAA,qBAAqB,GAAG,IAAA,sBAAM,EAAC;IAC1C,GAAG,kCAAoB,CAAC,MAAM;IAC9B,GAAG,qCAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2wpkhAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2wpkhAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
package/dist/types.d.cts CHANGED
@@ -10,7 +10,9 @@ export declare const InternalAccountMetadataStruct: Struct<{
10
10
  };
11
11
  nameLastUpdatedAt?: number;
12
12
  snap?: {
13
+ name: string;
13
14
  id: string;
15
+ enabled: boolean;
14
16
  };
15
17
  lastSelected?: number;
16
18
  };
@@ -23,16 +25,22 @@ export declare const InternalAccountMetadataStruct: Struct<{
23
25
  };
24
26
  nameLastUpdatedAt?: number;
25
27
  snap?: {
28
+ name: string;
26
29
  id: string;
30
+ enabled: boolean;
27
31
  };
28
32
  lastSelected?: number;
29
33
  }, {
30
34
  name: Struct<string, null>;
31
35
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
32
36
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
37
+ name: string;
33
38
  id: string;
39
+ enabled: boolean;
34
40
  }, {
35
41
  id: Struct<string, null>;
42
+ enabled: Struct<boolean, null>;
43
+ name: Struct<string, null>;
36
44
  }>;
37
45
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
38
46
  importTime: Struct<number, null>;
@@ -55,7 +63,9 @@ export declare const InternalEthEoaAccountStruct: Struct<{
55
63
  };
56
64
  nameLastUpdatedAt?: number;
57
65
  snap?: {
66
+ name: string;
58
67
  id: string;
68
+ enabled: boolean;
59
69
  };
60
70
  lastSelected?: number;
61
71
  };
@@ -71,16 +81,22 @@ export declare const InternalEthEoaAccountStruct: Struct<{
71
81
  };
72
82
  nameLastUpdatedAt?: number;
73
83
  snap?: {
84
+ name: string;
74
85
  id: string;
86
+ enabled: boolean;
75
87
  };
76
88
  lastSelected?: number;
77
89
  }, {
78
90
  name: Struct<string, null>;
79
91
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
80
92
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
93
+ name: string;
81
94
  id: string;
95
+ enabled: boolean;
82
96
  }, {
83
97
  id: Struct<string, null>;
98
+ enabled: Struct<boolean, null>;
99
+ name: Struct<string, null>;
84
100
  }>;
85
101
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
86
102
  importTime: Struct<number, null>;
@@ -116,7 +132,9 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
116
132
  };
117
133
  nameLastUpdatedAt?: number;
118
134
  snap?: {
135
+ name: string;
119
136
  id: string;
137
+ enabled: boolean;
120
138
  };
121
139
  lastSelected?: number;
122
140
  };
@@ -132,16 +150,22 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
132
150
  };
133
151
  nameLastUpdatedAt?: number;
134
152
  snap?: {
153
+ name: string;
135
154
  id: string;
155
+ enabled: boolean;
136
156
  };
137
157
  lastSelected?: number;
138
158
  }, {
139
159
  name: Struct<string, null>;
140
160
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
141
161
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
162
+ name: string;
142
163
  id: string;
164
+ enabled: boolean;
143
165
  }, {
144
166
  id: Struct<string, null>;
167
+ enabled: Struct<boolean, null>;
168
+ name: Struct<string, null>;
145
169
  }>;
146
170
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
147
171
  importTime: Struct<number, null>;
@@ -179,7 +203,9 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
179
203
  };
180
204
  nameLastUpdatedAt?: number;
181
205
  snap?: {
206
+ name: string;
182
207
  id: string;
208
+ enabled: boolean;
183
209
  };
184
210
  lastSelected?: number;
185
211
  };
@@ -195,16 +221,22 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
195
221
  };
196
222
  nameLastUpdatedAt?: number;
197
223
  snap?: {
224
+ name: string;
198
225
  id: string;
226
+ enabled: boolean;
199
227
  };
200
228
  lastSelected?: number;
201
229
  }, {
202
230
  name: Struct<string, null>;
203
231
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
204
232
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
233
+ name: string;
205
234
  id: string;
235
+ enabled: boolean;
206
236
  }, {
207
237
  id: Struct<string, null>;
238
+ enabled: Struct<boolean, null>;
239
+ name: Struct<string, null>;
208
240
  }>;
209
241
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
210
242
  importTime: Struct<number, null>;
@@ -235,7 +267,9 @@ export declare const InternalSolDataAccountStruct: Struct<{
235
267
  };
236
268
  nameLastUpdatedAt?: number;
237
269
  snap?: {
270
+ name: string;
238
271
  id: string;
272
+ enabled: boolean;
239
273
  };
240
274
  lastSelected?: number;
241
275
  };
@@ -251,16 +285,22 @@ export declare const InternalSolDataAccountStruct: Struct<{
251
285
  };
252
286
  nameLastUpdatedAt?: number;
253
287
  snap?: {
288
+ name: string;
254
289
  id: string;
290
+ enabled: boolean;
255
291
  };
256
292
  lastSelected?: number;
257
293
  }, {
258
294
  name: Struct<string, null>;
259
295
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
260
296
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
297
+ name: string;
261
298
  id: string;
299
+ enabled: boolean;
262
300
  }, {
263
301
  id: Struct<string, null>;
302
+ enabled: Struct<boolean, null>;
303
+ name: Struct<string, null>;
264
304
  }>;
265
305
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
266
306
  importTime: Struct<number, null>;
@@ -301,7 +341,9 @@ export declare const InternalAccountStruct: Struct<{
301
341
  };
302
342
  nameLastUpdatedAt?: number;
303
343
  snap?: {
344
+ name: string;
304
345
  id: string;
346
+ enabled: boolean;
305
347
  };
306
348
  lastSelected?: number;
307
349
  };
@@ -317,16 +359,22 @@ export declare const InternalAccountStruct: Struct<{
317
359
  };
318
360
  nameLastUpdatedAt?: number;
319
361
  snap?: {
362
+ name: string;
320
363
  id: string;
364
+ enabled: boolean;
321
365
  };
322
366
  lastSelected?: number;
323
367
  }, {
324
368
  name: Struct<string, null>;
325
369
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
326
370
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
371
+ name: string;
327
372
  id: string;
373
+ enabled: boolean;
328
374
  }, {
329
375
  id: Struct<string, null>;
376
+ enabled: Struct<boolean, null>;
377
+ name: Struct<string, null>;
330
378
  }>;
331
379
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
332
380
  importTime: Struct<number, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EAKf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAG3D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAexC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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GAC5B,qBAAqB,GACrB,yBAAyB,GACzB,wBAAwB,GACxB,sBAAsB,CAAC;AAE3B,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGhC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
package/dist/types.d.mts CHANGED
@@ -10,7 +10,9 @@ export declare const InternalAccountMetadataStruct: Struct<{
10
10
  };
11
11
  nameLastUpdatedAt?: number;
12
12
  snap?: {
13
+ name: string;
13
14
  id: string;
15
+ enabled: boolean;
14
16
  };
15
17
  lastSelected?: number;
16
18
  };
@@ -23,16 +25,22 @@ export declare const InternalAccountMetadataStruct: Struct<{
23
25
  };
24
26
  nameLastUpdatedAt?: number;
25
27
  snap?: {
28
+ name: string;
26
29
  id: string;
30
+ enabled: boolean;
27
31
  };
28
32
  lastSelected?: number;
29
33
  }, {
30
34
  name: Struct<string, null>;
31
35
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
32
36
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
37
+ name: string;
33
38
  id: string;
39
+ enabled: boolean;
34
40
  }, {
35
41
  id: Struct<string, null>;
42
+ enabled: Struct<boolean, null>;
43
+ name: Struct<string, null>;
36
44
  }>;
37
45
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
38
46
  importTime: Struct<number, null>;
@@ -55,7 +63,9 @@ export declare const InternalEthEoaAccountStruct: Struct<{
55
63
  };
56
64
  nameLastUpdatedAt?: number;
57
65
  snap?: {
66
+ name: string;
58
67
  id: string;
68
+ enabled: boolean;
59
69
  };
60
70
  lastSelected?: number;
61
71
  };
@@ -71,16 +81,22 @@ export declare const InternalEthEoaAccountStruct: Struct<{
71
81
  };
72
82
  nameLastUpdatedAt?: number;
73
83
  snap?: {
84
+ name: string;
74
85
  id: string;
86
+ enabled: boolean;
75
87
  };
76
88
  lastSelected?: number;
77
89
  }, {
78
90
  name: Struct<string, null>;
79
91
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
80
92
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
93
+ name: string;
81
94
  id: string;
95
+ enabled: boolean;
82
96
  }, {
83
97
  id: Struct<string, null>;
98
+ enabled: Struct<boolean, null>;
99
+ name: Struct<string, null>;
84
100
  }>;
85
101
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
86
102
  importTime: Struct<number, null>;
@@ -116,7 +132,9 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
116
132
  };
117
133
  nameLastUpdatedAt?: number;
118
134
  snap?: {
135
+ name: string;
119
136
  id: string;
137
+ enabled: boolean;
120
138
  };
121
139
  lastSelected?: number;
122
140
  };
@@ -132,16 +150,22 @@ export declare const InternalEthErc4337AccountStruct: Struct<{
132
150
  };
133
151
  nameLastUpdatedAt?: number;
134
152
  snap?: {
153
+ name: string;
135
154
  id: string;
155
+ enabled: boolean;
136
156
  };
137
157
  lastSelected?: number;
138
158
  }, {
139
159
  name: Struct<string, null>;
140
160
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
141
161
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
162
+ name: string;
142
163
  id: string;
164
+ enabled: boolean;
143
165
  }, {
144
166
  id: Struct<string, null>;
167
+ enabled: Struct<boolean, null>;
168
+ name: Struct<string, null>;
145
169
  }>;
146
170
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
147
171
  importTime: Struct<number, null>;
@@ -179,7 +203,9 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
179
203
  };
180
204
  nameLastUpdatedAt?: number;
181
205
  snap?: {
206
+ name: string;
182
207
  id: string;
208
+ enabled: boolean;
183
209
  };
184
210
  lastSelected?: number;
185
211
  };
@@ -195,16 +221,22 @@ export declare const InternalBtcP2wpkhAccountStruct: Struct<{
195
221
  };
196
222
  nameLastUpdatedAt?: number;
197
223
  snap?: {
224
+ name: string;
198
225
  id: string;
226
+ enabled: boolean;
199
227
  };
200
228
  lastSelected?: number;
201
229
  }, {
202
230
  name: Struct<string, null>;
203
231
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
204
232
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
233
+ name: string;
205
234
  id: string;
235
+ enabled: boolean;
206
236
  }, {
207
237
  id: Struct<string, null>;
238
+ enabled: Struct<boolean, null>;
239
+ name: Struct<string, null>;
208
240
  }>;
209
241
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
210
242
  importTime: Struct<number, null>;
@@ -235,7 +267,9 @@ export declare const InternalSolDataAccountStruct: Struct<{
235
267
  };
236
268
  nameLastUpdatedAt?: number;
237
269
  snap?: {
270
+ name: string;
238
271
  id: string;
272
+ enabled: boolean;
239
273
  };
240
274
  lastSelected?: number;
241
275
  };
@@ -251,16 +285,22 @@ export declare const InternalSolDataAccountStruct: Struct<{
251
285
  };
252
286
  nameLastUpdatedAt?: number;
253
287
  snap?: {
288
+ name: string;
254
289
  id: string;
290
+ enabled: boolean;
255
291
  };
256
292
  lastSelected?: number;
257
293
  }, {
258
294
  name: Struct<string, null>;
259
295
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
260
296
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
297
+ name: string;
261
298
  id: string;
299
+ enabled: boolean;
262
300
  }, {
263
301
  id: Struct<string, null>;
302
+ enabled: Struct<boolean, null>;
303
+ name: Struct<string, null>;
264
304
  }>;
265
305
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
266
306
  importTime: Struct<number, null>;
@@ -301,7 +341,9 @@ export declare const InternalAccountStruct: Struct<{
301
341
  };
302
342
  nameLastUpdatedAt?: number;
303
343
  snap?: {
344
+ name: string;
304
345
  id: string;
346
+ enabled: boolean;
305
347
  };
306
348
  lastSelected?: number;
307
349
  };
@@ -317,16 +359,22 @@ export declare const InternalAccountStruct: Struct<{
317
359
  };
318
360
  nameLastUpdatedAt?: number;
319
361
  snap?: {
362
+ name: string;
320
363
  id: string;
364
+ enabled: boolean;
321
365
  };
322
366
  lastSelected?: number;
323
367
  }, {
324
368
  name: Struct<string, null>;
325
369
  nameLastUpdatedAt: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
326
370
  snap: Struct<import("@metamask/keyring-utils").ExactOptionalTag | {
371
+ name: string;
327
372
  id: string;
373
+ enabled: boolean;
328
374
  }, {
329
375
  id: Struct<string, null>;
376
+ enabled: Struct<boolean, null>;
377
+ name: Struct<string, null>;
330
378
  }>;
331
379
  lastSelected: Struct<number | import("@metamask/keyring-utils").ExactOptionalTag, null>;
332
380
  importTime: Struct<number, null>;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,cAAc,EAEd,cAAc,EAKf,8BAA8B;AAE/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAG3D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,cAAc,GACd,cAAc,CAAC;AAEnB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAexC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGtC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAG1C,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;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AEH;;;;;GAKG;AACH,MAAM,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
package/dist/types.mjs CHANGED
@@ -4,13 +4,15 @@
4
4
  // and `InternalAccountTypes`.
5
5
  import { BtcAccountType, EthAccountType, KeyringAccountStruct, SolAccountType, BtcP2wpkhAccountStruct, EthEoaAccountStruct, EthErc4337AccountStruct, SolDataAccountStruct } from "@metamask/keyring-api";
6
6
  import { exactOptional, object } from "@metamask/keyring-utils";
7
- import { string, number } from "@metamask/superstruct";
7
+ import { boolean, string, number } from "@metamask/superstruct";
8
8
  export const InternalAccountMetadataStruct = object({
9
9
  metadata: object({
10
10
  name: string(),
11
11
  nameLastUpdatedAt: exactOptional(number()),
12
12
  snap: exactOptional(object({
13
13
  id: string(),
14
+ enabled: boolean(),
15
+ name: string(),
14
16
  })),
15
17
  lastSelected: exactOptional(number()),
16
18
  importTime: number(),
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;AAE9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACrB,8BAA8B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAOvD,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;SACb,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;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,GAAG,mBAAmB,CAAC,MAAM;IAC7B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;IACpD,GAAG,uBAAuB,CAAC,MAAM;IACjC,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;IACnD,GAAG,sBAAsB,CAAC,MAAM;IAChC,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAcH,MAAM,CAAC,MAAM,sBAAsB,GAM/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,MAAM,EAAE,CAAC,EAAE,8BAA8B;IAC5D,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,EAAE,4BAA4B;CAChE,CAAC;AAQF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;IAC1C,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2wpkhAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n }),\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 InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2wpkhAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,sEAAsE;AACtE,4FAA4F;AAC5F,8BAA8B;AAE9B,OAAO,EACL,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACrB,8BAA8B;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,gCAAgC;AAEhE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AAOhE,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC;IAClD,QAAQ,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;SACf,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,2BAA2B,GAAG,MAAM,CAAC;IAChD,GAAG,mBAAmB,CAAC,MAAM;IAC7B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,+BAA+B,GAAG,MAAM,CAAC;IACpD,GAAG,uBAAuB,CAAC,MAAM;IACjC,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,MAAM,CAAC;IACnD,GAAG,sBAAsB,CAAC,MAAM;IAChC,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC;IACjD,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC;AAcH,MAAM,CAAC,MAAM,sBAAsB,GAM/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,MAAM,EAAE,CAAC,EAAE,8BAA8B;IAC5D,CAAC,GAAG,cAAc,CAAC,WAAW,EAAE,CAAC,EAAE,4BAA4B;CAChE,CAAC;AAQF,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC;IAC1C,GAAG,oBAAoB,CAAC,MAAM;IAC9B,GAAG,6BAA6B,CAAC,MAAM;CACxC,CAAC,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/no-redundant-type-constituents */\n/* eslint-disable @typescript-eslint/no-duplicate-type-constituents */\n// FIXME: Those rules seem to be triggering a false positive on the `InternalAccountStructs`\n// and `InternalAccountTypes`.\n\nimport {\n BtcAccountType,\n EthAccountType,\n KeyringAccountStruct,\n SolAccountType,\n BtcP2wpkhAccountStruct,\n EthEoaAccountStruct,\n EthErc4337AccountStruct,\n SolDataAccountStruct,\n} from '@metamask/keyring-api';\nimport { exactOptional, object } from '@metamask/keyring-utils';\nimport type { Infer, Struct } from '@metamask/superstruct';\nimport { boolean, string, number } from '@metamask/superstruct';\n\nexport type InternalAccountType =\n | EthAccountType\n | BtcAccountType\n | SolAccountType;\n\nexport const InternalAccountMetadataStruct = object({\n metadata: object({\n name: string(),\n nameLastUpdatedAt: exactOptional(number()),\n snap: exactOptional(\n object({\n id: string(),\n enabled: boolean(),\n name: string(),\n }),\n ),\n lastSelected: exactOptional(number()),\n importTime: number(),\n keyring: object({\n type: string(),\n }),\n }),\n});\n\nexport const InternalEthEoaAccountStruct = object({\n ...EthEoaAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalEthErc4337AccountStruct = object({\n ...EthErc4337AccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalBtcP2wpkhAccountStruct = object({\n ...BtcP2wpkhAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport const InternalSolDataAccountStruct = object({\n ...SolDataAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\nexport type InternalEthEoaAccount = Infer<typeof InternalEthEoaAccountStruct>;\n\nexport type InternalEthErc4337Account = Infer<\n typeof InternalEthErc4337AccountStruct\n>;\n\nexport type InternalBtcP2wpkhAccount = Infer<\n typeof InternalBtcP2wpkhAccountStruct\n>;\n\nexport type InternalSolDataAccount = Infer<typeof InternalSolDataAccountStruct>;\n\nexport const InternalAccountStructs: Record<\n string,\n | Struct<InternalEthEoaAccount>\n | Struct<InternalEthErc4337Account>\n | Struct<InternalBtcP2wpkhAccount>\n | Struct<InternalSolDataAccount>\n> = {\n [`${EthAccountType.Eoa}`]: InternalEthEoaAccountStruct,\n [`${EthAccountType.Erc4337}`]: InternalEthErc4337AccountStruct,\n [`${BtcAccountType.P2wpkh}`]: InternalBtcP2wpkhAccountStruct,\n [`${SolAccountType.DataAccount}`]: InternalSolDataAccountStruct,\n};\n\nexport type InternalAccountTypes =\n | InternalEthEoaAccount\n | InternalEthErc4337Account\n | InternalBtcP2wpkhAccount\n | InternalSolDataAccount;\n\nexport const InternalAccountStruct = object({\n ...KeyringAccountStruct.schema,\n ...InternalAccountMetadataStruct.schema,\n});\n\n/**\n * Internal account representation.\n *\n * This type is used internally by MetaMask to add additional metadata to the\n * account object. It's should not be used by external applications.\n */\nexport type InternalAccount = Infer<typeof InternalAccountStruct>;\n"]}
@@ -0,0 +1,16 @@
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 `KeyringRquest` 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
@@ -0,0 +1 @@
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 `KeyringRquest` 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"]}
@@ -0,0 +1,12 @@
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 `KeyringRquest` 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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,12 @@
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 `KeyringRquest` 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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,13 @@
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 `KeyringRquest` 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
@@ -0,0 +1 @@
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 `KeyringRquest` 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"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/keyring-internal-api",
3
- "version": "6.0.1-33a98a2",
3
+ "version": "6.0.1-c335bed",
4
4
  "description": "MetaMask Keyring Internal API",
5
5
  "keywords": [
6
6
  "metamask",