@metamask-previews/keyring-controller 19.2.1-preview-af470a9 → 19.2.1-preview-4b0cb25d

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,13 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ## [19.2.1]
11
-
12
10
  ### Changed
13
11
 
12
+ - Bump `@metamask/keyring-internal-api` from `^5.0.0` to `^6.0.0` ([#5347](https://github.com/MetaMask/core/pull/5347))
13
+ - Bump `@metamask/eth-simple-keyring` from `^9.0.0` to `^10.0.0` ([#5347](https://github.com/MetaMask/core/pull/5347))
14
+ - Bump `@metamask/eth-hd-keyring` from `^11.0.0` to `^12.0.0` ([#5347](https://github.com/MetaMask/core/pull/5347))
15
+ - Bump `@ethereumjs/util` from `^8.1.0` to `^9.1.0` ([#5347](https://github.com/MetaMask/core/pull/5347))
14
16
  - **BREAKING:** `addNewKeyring` method now returns `Promise<KeyringMetadata>` instead of `Promise<unknown>` ([#5372](https://github.com/MetaMask/core/pull/5372))
15
17
  - Consumers can use the returned `KeyringMetadata.id` to access the created keyring instance via `withKeyring`.
16
18
  - **BREAKING:** `withKeyring` method now requires a callback argument of type `({ keyring: SelectedKeyring; metadata: KeyringMetadata }) => Promise<CallbackResult>` ([#5372](https://github.com/MetaMask/core/pull/5372))
19
+ - Bump `@metamask/keyring-internal-api` from `^4.0.3` to `^5.0.0` ([#5405](https://github.com/MetaMask/core/pull/5405))
20
+ - Bump `@metamask/eth-hd-keyring` from `^10.0.0` to `^11.0.0` ([#5405](https://github.com/MetaMask/core/pull/5405))
21
+ - Bump `@metamask/eth-simple-keyring` from `^8.1.0` to `^9.0.0` ([#5405](https://github.com/MetaMask/core/pull/5405))
22
+
23
+ ## [19.2.1]
24
+
25
+ ### Changed
26
+
17
27
  - Bump `@metamask/keyring-api"` from `^17.0.0` to `^17.2.0` ([#5366](https://github.com/MetaMask/core/pull/5366))
18
28
  - Bump `@metamask/keyring-internal-api` from `^4.0.1` to `^4.0.3` ([#5356](https://github.com/MetaMask/core/pull/5356)), ([#5366](https://github.com/MetaMask/core/pull/5366))
19
29
 
@@ -42,7 +42,7 @@ exports.KeyringController = exports.getDefaultKeyringState = exports.keyringBuil
42
42
  const util_1 = require("@ethereumjs/util");
43
43
  const base_controller_1 = require("@metamask/base-controller");
44
44
  const encryptorUtils = __importStar(require("@metamask/browser-passworder"));
45
- const eth_hd_keyring_1 = __importDefault(require("@metamask/eth-hd-keyring"));
45
+ const eth_hd_keyring_1 = require("@metamask/eth-hd-keyring");
46
46
  const eth_sig_util_1 = require("@metamask/eth-sig-util");
47
47
  const eth_simple_keyring_1 = __importDefault(require("@metamask/eth-simple-keyring"));
48
48
  const utils_1 = require("@metamask/utils");
@@ -115,7 +115,7 @@ const defaultKeyringBuilders = [
115
115
  // @ts-expect-error keyring types are mismatched
116
116
  keyringBuilderFactory(eth_simple_keyring_1.default),
117
117
  // @ts-expect-error keyring types are mismatched
118
- keyringBuilderFactory(eth_hd_keyring_1.default),
118
+ keyringBuilderFactory(eth_hd_keyring_1.HdKeyring),
119
119
  ];
120
120
  const getDefaultKeyringState = () => {
121
121
  return {
@@ -580,7 +580,7 @@ class KeyringController extends base_controller_1.BaseController {
580
580
  const prefixed = (0, utils_1.add0x)(importedKey);
581
581
  let bufferedPrivateKey;
582
582
  try {
583
- bufferedPrivateKey = (0, util_1.toBuffer)(prefixed);
583
+ bufferedPrivateKey = (0, utils_1.hexToBytes)(prefixed);
584
584
  }
585
585
  catch {
586
586
  throw new Error('Cannot import invalid private key.');
@@ -1499,8 +1499,10 @@ async function _KeyringController_createKeyring(type, data) {
1499
1499
  throw new Error(`${constants_1.KeyringControllerError.NoKeyringBuilder}. Keyring type: ${type}`);
1500
1500
  }
1501
1501
  const keyring = keyringBuilder();
1502
- // @ts-expect-error Enforce data type after updating clients
1503
- await keyring.deserialize(data);
1502
+ if (data) {
1503
+ // @ts-expect-error Enforce data type after updating clients
1504
+ await keyring.deserialize(data);
1505
+ }
1504
1506
  if (keyring.init) {
1505
1507
  await keyring.init();
1506
1508
  }