@metamask/keyring-api 6.2.0 → 6.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.2.1]
11
+
12
+ ### Changed
13
+
14
+ - Bump @metamask/key-tree from 9.1.0 to 9.1.1 ([#310](https://github.com/MetaMask/keyring-api/pull/310)).
15
+
16
+ ### Fixed
17
+
18
+ - Use internal `object` function instead of the upstream one ([#316](https://github.com/MetaMask/keyring-api/pull/316)).
19
+
10
20
  ## [6.2.0]
11
21
 
12
22
  ### Added
@@ -290,7 +300,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
290
300
  - SnapController keyring client. It is intended to be used by MetaMask to talk to the snap.
291
301
  - Helper functions to create keyring handler in the snap.
292
302
 
293
- [Unreleased]: https://github.com/MetaMask/keyring-api/compare/v6.2.0...HEAD
303
+ [Unreleased]: https://github.com/MetaMask/keyring-api/compare/v6.2.1...HEAD
304
+ [6.2.1]: https://github.com/MetaMask/keyring-api/compare/v6.2.0...v6.2.1
294
305
  [6.2.0]: https://github.com/MetaMask/keyring-api/compare/v6.1.1...v6.2.0
295
306
  [6.1.1]: https://github.com/MetaMask/keyring-api/compare/v6.1.0...v6.1.1
296
307
  [6.1.0]: https://github.com/MetaMask/keyring-api/compare/v6.0.0...v6.1.0
@@ -20,8 +20,8 @@ export declare const AccountCreatedEventStruct: import("superstruct").Struct<{
20
20
  options: Record<string, import("@metamask/utils").Json>;
21
21
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
22
22
  };
23
- accountNameSuggestion: string | import("../superstruct").ExactOptionalTag;
24
- displayConfirmation: boolean | import("../superstruct").ExactOptionalTag;
23
+ accountNameSuggestion?: string;
24
+ displayConfirmation?: boolean;
25
25
  };
26
26
  }, {
27
27
  method: import("superstruct").Struct<"notify:accountCreated", "notify:accountCreated">;
@@ -45,8 +45,8 @@ export declare const AccountCreatedEventStruct: import("superstruct").Struct<{
45
45
  options: Record<string, import("@metamask/utils").Json>;
46
46
  methods: ("personal_sign" | "eth_sign" | "eth_signTypedData_v1" | "eth_signTypedData_v3" | "eth_signTypedData_v4" | "eth_prepareUserOperation" | "eth_patchUserOperation" | "eth_signUserOperation")[];
47
47
  };
48
- accountNameSuggestion: string | import("../superstruct").ExactOptionalTag;
49
- displayConfirmation: boolean | import("../superstruct").ExactOptionalTag;
48
+ accountNameSuggestion?: string;
49
+ displayConfirmation?: boolean;
50
50
  }, {
51
51
  /**
52
52
  * New account object.
@@ -7,9 +7,9 @@ const api_1 = require("../api");
7
7
  const events_1 = require("../events");
8
8
  const superstruct_2 = require("../superstruct");
9
9
  const utils_2 = require("../utils");
10
- exports.AccountCreatedEventStruct = (0, superstruct_1.object)({
10
+ exports.AccountCreatedEventStruct = (0, superstruct_2.object)({
11
11
  method: (0, superstruct_1.literal)(`${events_1.KeyringEvent.AccountCreated}`),
12
- params: (0, superstruct_1.object)({
12
+ params: (0, superstruct_2.object)({
13
13
  /**
14
14
  * New account object.
15
15
  */
@@ -29,27 +29,27 @@ exports.AccountCreatedEventStruct = (0, superstruct_1.object)({
29
29
  displayConfirmation: (0, superstruct_2.exactOptional)((0, superstruct_1.boolean)()),
30
30
  }),
31
31
  });
32
- exports.AccountUpdatedEventStruct = (0, superstruct_1.object)({
32
+ exports.AccountUpdatedEventStruct = (0, superstruct_2.object)({
33
33
  method: (0, superstruct_1.literal)(`${events_1.KeyringEvent.AccountUpdated}`),
34
- params: (0, superstruct_1.object)({
34
+ params: (0, superstruct_2.object)({
35
35
  /**
36
36
  * Updated account object.
37
37
  */
38
38
  account: api_1.KeyringAccountStruct,
39
39
  }),
40
40
  });
41
- exports.AccountDeletedEventStruct = (0, superstruct_1.object)({
41
+ exports.AccountDeletedEventStruct = (0, superstruct_2.object)({
42
42
  method: (0, superstruct_1.literal)(`${events_1.KeyringEvent.AccountDeleted}`),
43
- params: (0, superstruct_1.object)({
43
+ params: (0, superstruct_2.object)({
44
44
  /**
45
45
  * Deleted account ID.
46
46
  */
47
47
  id: utils_2.UuidStruct,
48
48
  }),
49
49
  });
50
- exports.RequestApprovedEventStruct = (0, superstruct_1.object)({
50
+ exports.RequestApprovedEventStruct = (0, superstruct_2.object)({
51
51
  method: (0, superstruct_1.literal)(`${events_1.KeyringEvent.RequestApproved}`),
52
- params: (0, superstruct_1.object)({
52
+ params: (0, superstruct_2.object)({
53
53
  /**
54
54
  * Request ID.
55
55
  */
@@ -60,9 +60,9 @@ exports.RequestApprovedEventStruct = (0, superstruct_1.object)({
60
60
  result: utils_1.JsonStruct,
61
61
  }),
62
62
  });
63
- exports.RequestRejectedEventStruct = (0, superstruct_1.object)({
63
+ exports.RequestRejectedEventStruct = (0, superstruct_2.object)({
64
64
  method: (0, superstruct_1.literal)(`${events_1.KeyringEvent.RequestRejected}`),
65
- params: (0, superstruct_1.object)({
65
+ params: (0, superstruct_2.object)({
66
66
  /**
67
67
  * Request ID.
68
68
  */
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/internal/events.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,6CAA+D;AAE/D,gCAA8C;AAC9C,sCAAyC;AACzC,gDAA+C;AAC/C,oCAAsC;AAEzB,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,OAAO,EAAE,0BAAoB;QAE7B;;;;;;WAMG;QACH,qBAAqB,EAAE,IAAA,2BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAE9C;;;WAGG;QACH,mBAAmB,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;KAC9C,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,OAAO,EAAE,0BAAoB;KAC9B,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,kBAAU;KACf,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,kBAAU;QAEd;;WAEG;QACH,MAAM,EAAE,kBAAU;KACnB,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,kBAAU;KACf,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { JsonStruct } from '@metamask/utils';\nimport { boolean, literal, object, string } from 'superstruct';\n\nimport { KeyringAccountStruct } from '../api';\nimport { KeyringEvent } from '../events';\nimport { exactOptional } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nexport const AccountCreatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountCreated}`),\n params: object({\n /**\n * New account object.\n */\n account: KeyringAccountStruct,\n\n /**\n * Account name suggestion provided to the MetaMask client.\n *\n * The keyring can suggest a name for the account, but it's up to the\n * client to decide whether to use it. The keyring won't be informed if the\n * client decides to use a different name.\n */\n accountNameSuggestion: exactOptional(string()),\n\n /**\n * Instructs MetaMask to display the add account confirmation dialog in the UI.\n * **Note:** This is not guaranteed to be honored by the MetaMask client.\n */\n displayConfirmation: exactOptional(boolean()),\n }),\n});\n\nexport const AccountUpdatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountUpdated}`),\n params: object({\n /**\n * Updated account object.\n */\n account: KeyringAccountStruct,\n }),\n});\n\nexport const AccountDeletedEventStruct = object({\n method: literal(`${KeyringEvent.AccountDeleted}`),\n params: object({\n /**\n * Deleted account ID.\n */\n id: UuidStruct,\n }),\n});\n\nexport const RequestApprovedEventStruct = object({\n method: literal(`${KeyringEvent.RequestApproved}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n});\n\nexport const RequestRejectedEventStruct = object({\n method: literal(`${KeyringEvent.RequestRejected}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n }),\n});\n"]}
1
+ {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/internal/events.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAC7C,6CAAuD;AAEvD,gCAA8C;AAC9C,sCAAyC;AACzC,gDAAuD;AACvD,oCAAsC;AAEzB,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,OAAO,EAAE,0BAAoB;QAE7B;;;;;;WAMG;QACH,qBAAqB,EAAE,IAAA,2BAAa,EAAC,IAAA,oBAAM,GAAE,CAAC;QAE9C;;;WAGG;QACH,mBAAmB,EAAE,IAAA,2BAAa,EAAC,IAAA,qBAAO,GAAE,CAAC;KAC9C,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,OAAO,EAAE,0BAAoB;KAC9B,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,yBAAyB,GAAG,IAAA,oBAAM,EAAC;IAC9C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,cAAc,EAAE,CAAC;IACjD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,kBAAU;KACf,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,kBAAU;QAEd;;WAEG;QACH,MAAM,EAAE,kBAAU;KACnB,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,IAAA,oBAAM,EAAC;IAC/C,MAAM,EAAE,IAAA,qBAAO,EAAC,GAAG,qBAAY,CAAC,eAAe,EAAE,CAAC;IAClD,MAAM,EAAE,IAAA,oBAAM,EAAC;QACb;;WAEG;QACH,EAAE,EAAE,kBAAU;KACf,CAAC;CACH,CAAC,CAAC","sourcesContent":["import { JsonStruct } from '@metamask/utils';\nimport { boolean, literal, string } from 'superstruct';\n\nimport { KeyringAccountStruct } from '../api';\nimport { KeyringEvent } from '../events';\nimport { exactOptional, object } from '../superstruct';\nimport { UuidStruct } from '../utils';\n\nexport const AccountCreatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountCreated}`),\n params: object({\n /**\n * New account object.\n */\n account: KeyringAccountStruct,\n\n /**\n * Account name suggestion provided to the MetaMask client.\n *\n * The keyring can suggest a name for the account, but it's up to the\n * client to decide whether to use it. The keyring won't be informed if the\n * client decides to use a different name.\n */\n accountNameSuggestion: exactOptional(string()),\n\n /**\n * Instructs MetaMask to display the add account confirmation dialog in the UI.\n * **Note:** This is not guaranteed to be honored by the MetaMask client.\n */\n displayConfirmation: exactOptional(boolean()),\n }),\n});\n\nexport const AccountUpdatedEventStruct = object({\n method: literal(`${KeyringEvent.AccountUpdated}`),\n params: object({\n /**\n * Updated account object.\n */\n account: KeyringAccountStruct,\n }),\n});\n\nexport const AccountDeletedEventStruct = object({\n method: literal(`${KeyringEvent.AccountDeleted}`),\n params: object({\n /**\n * Deleted account ID.\n */\n id: UuidStruct,\n }),\n});\n\nexport const RequestApprovedEventStruct = object({\n method: literal(`${KeyringEvent.RequestApproved}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n\n /**\n * Request result.\n */\n result: JsonStruct,\n }),\n});\n\nexport const RequestRejectedEventStruct = object({\n method: literal(`${KeyringEvent.RequestRejected}`),\n params: object({\n /**\n * Request ID.\n */\n id: UuidStruct,\n }),\n});\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/keyring-api",
3
- "version": "6.2.0",
3
+ "version": "6.2.1",
4
4
  "description": "MetaMask Keyring API",
5
5
  "keywords": [
6
6
  "metamask",
@@ -29,7 +29,7 @@
29
29
  "lint:constraints": "yarn constraints",
30
30
  "lint:dependencies": "depcheck && yarn dedupe",
31
31
  "lint:eslint": "eslint . --cache --ext js,ts",
32
- "lint:fix": "yarn lint:eslint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies && yarn lint:changelog",
32
+ "lint:fix": "yarn lint:eslint --fix && yarn lint:constraints --fix && yarn lint:misc --write && yarn lint:dependencies && yarn lint:changelog --fix",
33
33
  "lint:misc": "prettier '**/*.json' '**/*.md' '!CHANGELOG.md' '**/*.yml' '!.yarnrc.yml' --ignore-path .gitignore --no-error-on-unmatched-pattern",
34
34
  "prepack": "./scripts/prepack.sh",
35
35
  "test": "yarn test:source && yarn test:types",
@@ -39,43 +39,43 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@metamask/snaps-sdk": "^4.2.0",
42
- "@metamask/utils": "^8.3.0",
43
- "@types/uuid": "^9.0.1",
42
+ "@metamask/utils": "^8.4.0",
43
+ "@types/uuid": "^9.0.8",
44
44
  "bech32": "^2.0.0",
45
45
  "superstruct": "^1.0.3",
46
- "uuid": "^9.0.0"
46
+ "uuid": "^9.0.1"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@lavamoat/allow-scripts": "^3.0.4",
50
- "@lavamoat/preinstall-always-fail": "^1.0.0",
51
- "@metamask/auto-changelog": "^3.1.0",
52
- "@metamask/eslint-config": "^12.1.0",
50
+ "@lavamoat/preinstall-always-fail": "^2.0.0",
51
+ "@metamask/auto-changelog": "^3.4.4",
52
+ "@metamask/eslint-config": "^12.2.0",
53
53
  "@metamask/eslint-config-jest": "^12.1.0",
54
54
  "@metamask/eslint-config-nodejs": "^12.1.0",
55
55
  "@metamask/eslint-config-typescript": "^12.1.0",
56
- "@metamask/providers": "^16.0.0",
57
- "@types/jest": "^28.1.6",
58
- "@types/node": "^16",
59
- "@typescript-eslint/eslint-plugin": "^5.43.0",
60
- "@typescript-eslint/parser": "^5.43.0",
61
- "depcheck": "^1.4.3",
62
- "eslint": "^8.27.0",
63
- "eslint-config-prettier": "^8.5.0",
56
+ "@metamask/providers": "^16.1.0",
57
+ "@types/jest": "^29.5.12",
58
+ "@types/node": "^20.12.12",
59
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
60
+ "@typescript-eslint/parser": "^5.62.0",
61
+ "depcheck": "^1.4.7",
62
+ "eslint": "^8.57.0",
63
+ "eslint-config-prettier": "^8.10.0",
64
64
  "eslint-plugin-import": "~2.26.0",
65
- "eslint-plugin-jest": "^27.1.5",
66
- "eslint-plugin-jsdoc": "^39.6.2",
65
+ "eslint-plugin-jest": "^27.9.0",
66
+ "eslint-plugin-jsdoc": "^39.9.1",
67
67
  "eslint-plugin-n": "^15.7.0",
68
68
  "eslint-plugin-prettier": "^4.2.1",
69
69
  "eslint-plugin-promise": "^6.1.1",
70
70
  "jest": "^28.1.3",
71
- "jest-it-up": "^2.0.2",
72
- "prettier": "^2.7.1",
73
- "prettier-plugin-packagejson": "^2.3.0",
74
- "rimraf": "^3.0.2",
75
- "ts-jest": "^28.0.7",
76
- "ts-node": "^10.7.0",
77
- "tsd": "^0.29.0",
78
- "typedoc": "^0.23.15",
71
+ "jest-it-up": "^3.1.0",
72
+ "prettier": "^2.8.8",
73
+ "prettier-plugin-packagejson": "^2.5.0",
74
+ "rimraf": "^5.0.7",
75
+ "ts-jest": "^28.0.8",
76
+ "ts-node": "^10.9.2",
77
+ "tsd": "^0.31.0",
78
+ "typedoc": "^0.25.13",
79
79
  "typescript": "~4.8.4"
80
80
  },
81
81
  "peerDependencies": {