@metamask-previews/keyring-controller 22.0.2-preview-c6e5eb7 → 22.0.2-preview-d7c00b1

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.
@@ -9,7 +9,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
9
9
  if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
- var _KeyringController_instances, _KeyringController_controllerOperationMutex, _KeyringController_vaultOperationMutex, _KeyringController_keyringBuilders, _KeyringController_encryptor, _KeyringController_cacheEncryptionKey, _KeyringController_keyrings, _KeyringController_unsupportedKeyrings, _KeyringController_password, _KeyringController_qrKeyringStateListener, _KeyringController_registerMessageHandlers, _KeyringController_getKeyringById, _KeyringController_getKeyringByIdOrDefault, _KeyringController_getKeyringMetadata, _KeyringController_getKeyringBuilderForType, _KeyringController_addQRKeyring, _KeyringController_subscribeToQRKeyringEvents, _KeyringController_unsubscribeFromQRKeyringsEvents, _KeyringController_createNewVaultWithKeyring, _KeyringController_verifySeedPhrase, _KeyringController_getUpdatedKeyrings, _KeyringController_getSerializedKeyrings, _KeyringController_getSessionState, _KeyringController_restoreSerializedKeyrings, _KeyringController_unlockKeyrings, _KeyringController_updateVault, _KeyringController_isNewEncryptionAvailable, _KeyringController_getAccountsFromKeyrings, _KeyringController_createKeyringWithFirstAccount, _KeyringController_newKeyring, _KeyringController_createKeyring, _KeyringController_clearKeyrings, _KeyringController_restoreKeyring, _KeyringController_destroyKeyring, _KeyringController_removeEmptyKeyrings, _KeyringController_assertNoDuplicateAccounts, _KeyringController_setUnlocked, _KeyringController_assertIsUnlocked, _KeyringController_persistOrRollback, _KeyringController_withRollback, _KeyringController_assertControllerMutexIsLocked, _KeyringController_withControllerLock, _KeyringController_withVaultLock;
12
+ var _KeyringController_instances, _KeyringController_controllerOperationMutex, _KeyringController_vaultOperationMutex, _KeyringController_keyringBuilders, _KeyringController_encryptor, _KeyringController_cacheEncryptionKey, _KeyringController_keyrings, _KeyringController_unsupportedKeyrings, _KeyringController_password, _KeyringController_registerMessageHandlers, _KeyringController_getKeyringById, _KeyringController_getKeyringByIdOrDefault, _KeyringController_getKeyringMetadata, _KeyringController_getKeyringBuilderForType, _KeyringController_createNewVaultWithKeyring, _KeyringController_verifySeedPhrase, _KeyringController_getUpdatedKeyrings, _KeyringController_getSerializedKeyrings, _KeyringController_getSessionState, _KeyringController_restoreSerializedKeyrings, _KeyringController_unlockKeyrings, _KeyringController_updateVault, _KeyringController_isNewEncryptionAvailable, _KeyringController_getAccountsFromKeyrings, _KeyringController_createKeyringWithFirstAccount, _KeyringController_newKeyring, _KeyringController_createKeyring, _KeyringController_clearKeyrings, _KeyringController_restoreKeyring, _KeyringController_destroyKeyring, _KeyringController_removeEmptyKeyrings, _KeyringController_assertNoDuplicateAccounts, _KeyringController_setUnlocked, _KeyringController_assertIsUnlocked, _KeyringController_persistOrRollback, _KeyringController_withRollback, _KeyringController_assertControllerMutexIsLocked, _KeyringController_withControllerLock, _KeyringController_withVaultLock;
13
13
  function $importDefault(module) {
14
14
  if (module?.__esModule) {
15
15
  return module.default;
@@ -145,6 +145,17 @@ function assertIsValidPassword(password) {
145
145
  throw new Error(KeyringControllerError.InvalidEmptyPassword);
146
146
  }
147
147
  }
148
+ /**
149
+ * Assert that the provided encryption key is a valid non-empty string.
150
+ *
151
+ * @param encryptionKey - The encryption key to check.
152
+ * @throws If the encryption key is not a valid string.
153
+ */
154
+ function assertIsEncryptionKeySet(encryptionKey) {
155
+ if (!encryptionKey) {
156
+ throw new Error(KeyringControllerError.EncryptionKeyNotSet);
157
+ }
158
+ }
148
159
  /**
149
160
  * Checks if the provided value is a serialized keyrings array.
150
161
  *
@@ -251,7 +262,6 @@ export class KeyringController extends BaseController {
251
262
  _KeyringController_keyrings.set(this, void 0);
252
263
  _KeyringController_unsupportedKeyrings.set(this, void 0);
253
264
  _KeyringController_password.set(this, void 0);
254
- _KeyringController_qrKeyringStateListener.set(this, void 0);
255
265
  __classPrivateFieldSet(this, _KeyringController_keyringBuilders, keyringBuilders
256
266
  ? keyringBuilders.concat(defaultKeyringBuilders)
257
267
  : defaultKeyringBuilders, "f");
@@ -376,9 +386,6 @@ export class KeyringController extends BaseController {
376
386
  */
377
387
  async addNewKeyring(type, opts) {
378
388
  __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
379
- if (type === KeyringTypes.qr) {
380
- return __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_getKeyringMetadata).call(this, await this.getOrAddQRKeyring());
381
- }
382
389
  return __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_getKeyringMetadata).call(this, await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_persistOrRollback).call(this, async () => __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_newKeyring).call(this, type, opts)));
383
390
  }
384
391
  /**
@@ -637,7 +644,6 @@ export class KeyringController extends BaseController {
637
644
  async setLocked() {
638
645
  __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
639
646
  return __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_withRollback).call(this, async () => {
640
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_unsubscribeFromQRKeyringsEvents).call(this);
641
647
  __classPrivateFieldSet(this, _KeyringController_password, undefined, "f");
642
648
  await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_clearKeyrings).call(this);
643
649
  this.update((state) => {
@@ -820,6 +826,10 @@ export class KeyringController extends BaseController {
820
826
  */
821
827
  changePassword(password) {
822
828
  __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
829
+ // If the password is the same, do nothing.
830
+ if (__classPrivateFieldGet(this, _KeyringController_password, "f") === password) {
831
+ return Promise.resolve();
832
+ }
823
833
  return __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_persistOrRollback).call(this, async () => {
824
834
  assertIsValidPassword(password);
825
835
  __classPrivateFieldSet(this, _KeyringController_password, password, "f");
@@ -835,11 +845,12 @@ export class KeyringController extends BaseController {
835
845
  });
836
846
  }
837
847
  /**
838
- * Attempts to decrypt the current vault and load its keyrings,
839
- * using the given encryption key and salt.
848
+ * Attempts to decrypt the current vault and load its keyrings, using the
849
+ * given encryption key and salt. The optional salt can be used to check for
850
+ * consistency with the vault salt.
840
851
  *
841
852
  * @param encryptionKey - Key to unlock the keychain.
842
- * @param encryptionSalt - Salt to unlock the keychain.
853
+ * @param encryptionSalt - Optional salt to unlock the keychain.
843
854
  * @returns Promise resolving when the operation completes.
844
855
  */
845
856
  async submitEncryptionKey(encryptionKey, encryptionSalt) {
@@ -863,6 +874,19 @@ export class KeyringController extends BaseController {
863
874
  console.error('Failed to update vault during login:', error);
864
875
  }
865
876
  }
877
+ /**
878
+ * Exports the vault encryption key.
879
+ *
880
+ * @returns The vault encryption key.
881
+ */
882
+ async exportEncryptionKey() {
883
+ __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
884
+ return await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_withControllerLock).call(this, async () => {
885
+ const { encryptionKey } = this.state;
886
+ assertIsEncryptionKeySet(encryptionKey);
887
+ return encryptionKey;
888
+ });
889
+ }
866
890
  /**
867
891
  * Attempts to decrypt the current vault and load its keyrings,
868
892
  * using the given password.
@@ -937,205 +961,13 @@ export class KeyringController extends BaseController {
937
961
  return result;
938
962
  });
939
963
  }
940
- // QR Hardware related methods
941
- /**
942
- * Get QR Hardware keyring.
943
- *
944
- * @returns The QR Keyring if defined, otherwise undefined
945
- * @deprecated Use `withKeyring` instead.
946
- */
947
- getQRKeyring() {
948
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
949
- // QRKeyring is not yet compatible with Keyring type from @metamask/utils
950
- return this.getKeyringsByType(KeyringTypes.qr)[0];
951
- }
952
- /**
953
- * Get QR hardware keyring. If it doesn't exist, add it.
954
- *
955
- * @returns The added keyring
956
- * @deprecated Use `addNewKeyring` and `withKeyring` instead.
957
- */
958
- async getOrAddQRKeyring() {
959
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
960
- return (this.getQRKeyring() ||
961
- (await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_persistOrRollback).call(this, async () => __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_addQRKeyring).call(this))));
962
- }
963
- /**
964
- * Restore QR keyring from serialized data.
965
- *
966
- * @param serialized - Serialized data to restore the keyring from.
967
- * @returns Promise resolving when the operation completes.
968
- * @deprecated Use `withKeyring` instead.
969
- */
970
- // TODO: Replace `any` with type
971
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
972
- async restoreQRKeyring(serialized) {
973
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
974
- return __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_persistOrRollback).call(this, async () => {
975
- const keyring = this.getQRKeyring() || (await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_addQRKeyring).call(this));
976
- keyring.deserialize(serialized);
977
- });
978
- }
979
- /**
980
- * Reset QR keyring state.
981
- *
982
- * @returns Promise resolving when the operation completes.
983
- * @deprecated Use `withKeyring` instead.
984
- */
985
- async resetQRKeyringState() {
986
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
987
- (await this.getOrAddQRKeyring()).resetStore();
988
- }
989
- /**
990
- * Get QR keyring state.
991
- *
992
- * @returns Promise resolving to the keyring state.
993
- * @deprecated Use `withKeyring` or subscribe to `"KeyringController:qrKeyringStateChange"`
994
- * instead.
995
- */
996
- async getQRKeyringState() {
997
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
998
- return (await this.getOrAddQRKeyring()).getMemStore();
999
- }
1000
- /**
1001
- * Submit QR hardware wallet public HDKey.
1002
- *
1003
- * @param cryptoHDKey - The key to submit.
1004
- * @returns Promise resolving when the operation completes.
1005
- * @deprecated Use `withKeyring` instead.
1006
- */
1007
- async submitQRCryptoHDKey(cryptoHDKey) {
1008
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1009
- (await this.getOrAddQRKeyring()).submitCryptoHDKey(cryptoHDKey);
1010
- }
1011
- /**
1012
- * Submit QR hardware wallet account.
1013
- *
1014
- * @param cryptoAccount - The account to submit.
1015
- * @returns Promise resolving when the operation completes.
1016
- * @deprecated Use `withKeyring` instead.
1017
- */
1018
- async submitQRCryptoAccount(cryptoAccount) {
1019
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1020
- (await this.getOrAddQRKeyring()).submitCryptoAccount(cryptoAccount);
1021
- }
1022
- /**
1023
- * Submit QR hardware wallet signature.
1024
- *
1025
- * @param requestId - The request ID.
1026
- * @param ethSignature - The signature to submit.
1027
- * @returns Promise resolving when the operation completes.
1028
- * @deprecated Use `withKeyring` instead.
1029
- */
1030
- async submitQRSignature(requestId, ethSignature) {
1031
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1032
- (await this.getOrAddQRKeyring()).submitSignature(requestId, ethSignature);
1033
- }
1034
- /**
1035
- * Cancel QR sign request.
1036
- *
1037
- * @returns Promise resolving when the operation completes.
1038
- * @deprecated Use `withKeyring` instead.
1039
- */
1040
- async cancelQRSignRequest() {
1041
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1042
- (await this.getOrAddQRKeyring()).cancelSignRequest();
1043
- }
1044
- /**
1045
- * Cancels qr keyring sync.
1046
- *
1047
- * @returns Promise resolving when the operation completes.
1048
- * @deprecated Use `withKeyring` instead.
1049
- */
1050
- async cancelQRSynchronization() {
1051
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1052
- (await this.getOrAddQRKeyring()).cancelSync();
1053
- }
1054
- /**
1055
- * Connect to QR hardware wallet.
1056
- *
1057
- * @param page - The page to connect to.
1058
- * @returns Promise resolving to the connected accounts.
1059
- * @deprecated Use of this method is discouraged as it creates a dangling promise
1060
- * internal to the `QRKeyring`, which can lead to unpredictable deadlocks. Please use
1061
- * `withKeyring` instead.
1062
- */
1063
- async connectQRHardware(page) {
1064
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1065
- return __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_persistOrRollback).call(this, async () => {
1066
- try {
1067
- const keyring = this.getQRKeyring() || (await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_addQRKeyring).call(this));
1068
- let accounts;
1069
- switch (page) {
1070
- case -1:
1071
- accounts = await keyring.getPreviousPage();
1072
- break;
1073
- case 1:
1074
- accounts = await keyring.getNextPage();
1075
- break;
1076
- default:
1077
- accounts = await keyring.getFirstPage();
1078
- }
1079
- // TODO: Replace `any` with type
1080
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
1081
- return accounts.map((account) => {
1082
- return {
1083
- ...account,
1084
- balance: '0x0',
1085
- };
1086
- });
1087
- }
1088
- catch (e) {
1089
- // TODO: Add test case for when keyring throws
1090
- /* istanbul ignore next */
1091
- // TODO: Either fix this lint violation or explain why it's necessary to ignore.
1092
- // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
1093
- throw new Error(`Unspecified error when connect QR Hardware, ${e}`);
1094
- }
1095
- });
1096
- }
1097
- /**
1098
- * Unlock a QR hardware wallet account.
1099
- *
1100
- * @param index - The index of the account to unlock.
1101
- * @returns Promise resolving when the operation completes.
1102
- * @deprecated Use `withKeyring` instead.
1103
- */
1104
- async unlockQRHardwareWalletAccount(index) {
1105
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1106
- return __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_persistOrRollback).call(this, async () => {
1107
- const keyring = this.getQRKeyring() || (await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_addQRKeyring).call(this));
1108
- keyring.setAccountToUnlock(index);
1109
- await keyring.addAccounts(1);
1110
- });
1111
- }
1112
964
  async getAccountKeyringType(account) {
1113
965
  __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1114
966
  const keyring = (await this.getKeyringForAccount(account));
1115
967
  return keyring.type;
1116
968
  }
1117
- /**
1118
- * Forget the QR hardware wallet.
1119
- *
1120
- * @returns Promise resolving to the removed accounts and the remaining accounts.
1121
- * @deprecated Use `withKeyring` instead.
1122
- */
1123
- async forgetQRDevice() {
1124
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertIsUnlocked).call(this);
1125
- return __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_persistOrRollback).call(this, async () => {
1126
- const keyring = this.getQRKeyring();
1127
- if (!keyring) {
1128
- return { removedAccounts: [], remainingAccounts: [] };
1129
- }
1130
- const allAccounts = (await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_getAccountsFromKeyrings).call(this));
1131
- keyring.forgetDevice();
1132
- const remainingAccounts = (await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_getAccountsFromKeyrings).call(this));
1133
- const removedAccounts = allAccounts.filter((address) => !remainingAccounts.includes(address));
1134
- return { removedAccounts, remainingAccounts };
1135
- });
1136
- }
1137
969
  }
1138
- _KeyringController_controllerOperationMutex = new WeakMap(), _KeyringController_vaultOperationMutex = new WeakMap(), _KeyringController_keyringBuilders = new WeakMap(), _KeyringController_encryptor = new WeakMap(), _KeyringController_cacheEncryptionKey = new WeakMap(), _KeyringController_keyrings = new WeakMap(), _KeyringController_unsupportedKeyrings = new WeakMap(), _KeyringController_password = new WeakMap(), _KeyringController_qrKeyringStateListener = new WeakMap(), _KeyringController_instances = new WeakSet(), _KeyringController_registerMessageHandlers = function _KeyringController_registerMessageHandlers() {
970
+ _KeyringController_controllerOperationMutex = new WeakMap(), _KeyringController_vaultOperationMutex = new WeakMap(), _KeyringController_keyringBuilders = new WeakMap(), _KeyringController_encryptor = new WeakMap(), _KeyringController_cacheEncryptionKey = new WeakMap(), _KeyringController_keyrings = new WeakMap(), _KeyringController_unsupportedKeyrings = new WeakMap(), _KeyringController_password = new WeakMap(), _KeyringController_instances = new WeakSet(), _KeyringController_registerMessageHandlers = function _KeyringController_registerMessageHandlers() {
1139
971
  this.messagingSystem.registerActionHandler(`${name}:signMessage`, this.signMessage.bind(this));
1140
972
  this.messagingSystem.registerActionHandler(`${name}:signEip7702Authorization`, this.signEip7702Authorization.bind(this));
1141
973
  this.messagingSystem.registerActionHandler(`${name}:signPersonalMessage`, this.signPersonalMessage.bind(this));
@@ -1167,30 +999,6 @@ _KeyringController_controllerOperationMutex = new WeakMap(), _KeyringController_
1167
999
  return keyringWithMetadata.metadata;
1168
1000
  }, _KeyringController_getKeyringBuilderForType = function _KeyringController_getKeyringBuilderForType(type) {
1169
1001
  return __classPrivateFieldGet(this, _KeyringController_keyringBuilders, "f").find((keyringBuilder) => keyringBuilder.type === type);
1170
- }, _KeyringController_addQRKeyring =
1171
- /**
1172
- * Add qr hardware keyring.
1173
- *
1174
- * @returns The added keyring
1175
- * @throws If a QRKeyring builder is not provided
1176
- * when initializing the controller
1177
- */
1178
- async function _KeyringController_addQRKeyring() {
1179
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_assertControllerMutexIsLocked).call(this);
1180
- // QRKeyring is not yet compatible with Keyring type from @metamask/utils
1181
- return (await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_newKeyring).call(this, KeyringTypes.qr));
1182
- }, _KeyringController_subscribeToQRKeyringEvents = function _KeyringController_subscribeToQRKeyringEvents(qrKeyring) {
1183
- __classPrivateFieldSet(this, _KeyringController_qrKeyringStateListener, (state) => {
1184
- this.messagingSystem.publish(`${name}:qrKeyringStateChange`, state);
1185
- }, "f");
1186
- qrKeyring.getMemStore().subscribe(__classPrivateFieldGet(this, _KeyringController_qrKeyringStateListener, "f"));
1187
- }, _KeyringController_unsubscribeFromQRKeyringsEvents = function _KeyringController_unsubscribeFromQRKeyringsEvents() {
1188
- const qrKeyrings = this.getKeyringsByType(KeyringTypes.qr);
1189
- qrKeyrings.forEach((qrKeyring) => {
1190
- if (__classPrivateFieldGet(this, _KeyringController_qrKeyringStateListener, "f")) {
1191
- qrKeyring.getMemStore().unsubscribe(__classPrivateFieldGet(this, _KeyringController_qrKeyringStateListener, "f"));
1192
- }
1193
- });
1194
1002
  }, _KeyringController_createNewVaultWithKeyring =
1195
1003
  /**
1196
1004
  * Create new vault with an initial keyring
@@ -1360,9 +1168,12 @@ async function _KeyringController_unlockKeyrings(password, encryptionKey, encryp
1360
1168
  }
1361
1169
  else {
1362
1170
  const parsedEncryptedVault = JSON.parse(encryptedVault);
1363
- if (encryptionSalt !== parsedEncryptedVault.salt) {
1171
+ if (encryptionSalt && encryptionSalt !== parsedEncryptedVault.salt) {
1364
1172
  throw new Error(KeyringControllerError.ExpiredCredentials);
1365
1173
  }
1174
+ else {
1175
+ encryptionSalt = parsedEncryptedVault.salt;
1176
+ }
1366
1177
  if (typeof encryptionKey !== 'string') {
1367
1178
  throw new TypeError(KeyringControllerError.WrongPasswordType);
1368
1179
  }
@@ -1371,9 +1182,6 @@ async function _KeyringController_unlockKeyrings(password, encryptionKey, encryp
1371
1182
  // This call is required on the first call because encryptionKey
1372
1183
  // is not yet inside the memStore
1373
1184
  updatedState.encryptionKey = encryptionKey;
1374
- // we can safely assume that encryptionSalt is defined here
1375
- // because we compare it with the salt from the vault
1376
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1377
1185
  updatedState.encryptionSalt = encryptionSalt;
1378
1186
  }
1379
1187
  }
@@ -1550,11 +1358,6 @@ async function _KeyringController_createKeyring(type, data) {
1550
1358
  await keyring.generateRandomMnemonic();
1551
1359
  await keyring.addAccounts(1);
1552
1360
  }
1553
- if (type === KeyringTypes.qr) {
1554
- // In case of a QR keyring type, we need to subscribe
1555
- // to its events after creating it
1556
- __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_subscribeToQRKeyringEvents).call(this, keyring);
1557
- }
1558
1361
  return keyring;
1559
1362
  }, _KeyringController_clearKeyrings =
1560
1363
  /**