@metamask-previews/keyring-controller 23.2.0-preview-9fa15fd0 → 24.0.0-preview-46d2c977

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,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [24.0.0]
11
+
12
+ ### Changed
13
+
14
+ - **BREAKING:** Use new `Messenger` from `@metamask/messenger` ([#6370](https://github.com/MetaMask/core/pull/6370))
15
+ - Previously, `KeyringController` accepted a `RestrictedMessenger` instance from `@metamask/base-controller`.
16
+ - **BREAKING:** Metadata property `anonymous` renamed to `includeInDebugSnapshot` ([#6370](https://github.com/MetaMask/core/pull/6370))
17
+ - Bump `@metamask/base-controller` from `^8.4.2` to `^9.0.0` ([#6962](https://github.com/MetaMask/core/pull/6962))
18
+
10
19
  ## [23.2.0]
11
20
 
12
21
  ### Added
@@ -876,7 +885,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
876
885
 
877
886
  All changes listed after this point were applied to this package following the monorepo conversion.
878
887
 
879
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@23.2.0...HEAD
888
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@24.0.0...HEAD
889
+ [24.0.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@23.2.0...@metamask/keyring-controller@24.0.0
880
890
  [23.2.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@23.1.1...@metamask/keyring-controller@23.2.0
881
891
  [23.1.1]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@23.1.0...@metamask/keyring-controller@23.1.1
882
892
  [23.1.0]: https://github.com/MetaMask/core/compare/@metamask/keyring-controller@23.0.0...@metamask/keyring-controller@23.1.0
@@ -266,31 +266,31 @@ class KeyringController extends base_controller_1.BaseController {
266
266
  vault: {
267
267
  includeInStateLogs: false,
268
268
  persist: true,
269
- anonymous: false,
269
+ includeInDebugSnapshot: false,
270
270
  usedInUi: false,
271
271
  },
272
272
  isUnlocked: {
273
273
  includeInStateLogs: true,
274
274
  persist: false,
275
- anonymous: true,
275
+ includeInDebugSnapshot: true,
276
276
  usedInUi: true,
277
277
  },
278
278
  keyrings: {
279
279
  includeInStateLogs: true,
280
280
  persist: false,
281
- anonymous: false,
281
+ includeInDebugSnapshot: false,
282
282
  usedInUi: true,
283
283
  },
284
284
  encryptionKey: {
285
285
  includeInStateLogs: false,
286
286
  persist: false,
287
- anonymous: false,
287
+ includeInDebugSnapshot: false,
288
288
  usedInUi: false,
289
289
  },
290
290
  encryptionSalt: {
291
291
  includeInStateLogs: false,
292
292
  persist: false,
293
- anonymous: false,
293
+ includeInDebugSnapshot: false,
294
294
  usedInUi: false,
295
295
  },
296
296
  },
@@ -681,7 +681,7 @@ class KeyringController extends base_controller_1.BaseController {
681
681
  await __classPrivateFieldGet(this, _KeyringController_instances, "m", _KeyringController_removeEmptyKeyrings).call(this);
682
682
  }
683
683
  });
684
- this.messagingSystem.publish(`${name}:accountRemoved`, address);
684
+ this.messenger.publish(`${name}:accountRemoved`, address);
685
685
  }
686
686
  /**
687
687
  * Deallocates all secrets and locks the wallet.
@@ -699,7 +699,7 @@ class KeyringController extends base_controller_1.BaseController {
699
699
  delete state.encryptionKey;
700
700
  delete state.encryptionSalt;
701
701
  });
702
- this.messagingSystem.publish(`${name}:lock`);
702
+ this.messenger.publish(`${name}:lock`);
703
703
  });
704
704
  }
705
705
  /**
@@ -1016,24 +1016,24 @@ class KeyringController extends base_controller_1.BaseController {
1016
1016
  }
1017
1017
  exports.KeyringController = KeyringController;
1018
1018
  _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() {
1019
- this.messagingSystem.registerActionHandler(`${name}:signMessage`, this.signMessage.bind(this));
1020
- this.messagingSystem.registerActionHandler(`${name}:signEip7702Authorization`, this.signEip7702Authorization.bind(this));
1021
- this.messagingSystem.registerActionHandler(`${name}:signPersonalMessage`, this.signPersonalMessage.bind(this));
1022
- this.messagingSystem.registerActionHandler(`${name}:signTypedMessage`, this.signTypedMessage.bind(this));
1023
- this.messagingSystem.registerActionHandler(`${name}:decryptMessage`, this.decryptMessage.bind(this));
1024
- this.messagingSystem.registerActionHandler(`${name}:getEncryptionPublicKey`, this.getEncryptionPublicKey.bind(this));
1025
- this.messagingSystem.registerActionHandler(`${name}:getAccounts`, this.getAccounts.bind(this));
1026
- this.messagingSystem.registerActionHandler(`${name}:getKeyringsByType`, this.getKeyringsByType.bind(this));
1027
- this.messagingSystem.registerActionHandler(`${name}:getKeyringForAccount`, this.getKeyringForAccount.bind(this));
1028
- this.messagingSystem.registerActionHandler(`${name}:persistAllKeyrings`, this.persistAllKeyrings.bind(this));
1029
- this.messagingSystem.registerActionHandler(`${name}:prepareUserOperation`, this.prepareUserOperation.bind(this));
1030
- this.messagingSystem.registerActionHandler(`${name}:patchUserOperation`, this.patchUserOperation.bind(this));
1031
- this.messagingSystem.registerActionHandler(`${name}:signUserOperation`, this.signUserOperation.bind(this));
1032
- this.messagingSystem.registerActionHandler(`${name}:addNewAccount`, this.addNewAccount.bind(this));
1033
- this.messagingSystem.registerActionHandler(`${name}:withKeyring`, this.withKeyring.bind(this));
1034
- this.messagingSystem.registerActionHandler(`${name}:addNewKeyring`, this.addNewKeyring.bind(this));
1035
- this.messagingSystem.registerActionHandler(`${name}:createNewVaultAndKeychain`, this.createNewVaultAndKeychain.bind(this));
1036
- this.messagingSystem.registerActionHandler(`${name}:createNewVaultAndRestore`, this.createNewVaultAndRestore.bind(this));
1019
+ this.messenger.registerActionHandler(`${name}:signMessage`, this.signMessage.bind(this));
1020
+ this.messenger.registerActionHandler(`${name}:signEip7702Authorization`, this.signEip7702Authorization.bind(this));
1021
+ this.messenger.registerActionHandler(`${name}:signPersonalMessage`, this.signPersonalMessage.bind(this));
1022
+ this.messenger.registerActionHandler(`${name}:signTypedMessage`, this.signTypedMessage.bind(this));
1023
+ this.messenger.registerActionHandler(`${name}:decryptMessage`, this.decryptMessage.bind(this));
1024
+ this.messenger.registerActionHandler(`${name}:getEncryptionPublicKey`, this.getEncryptionPublicKey.bind(this));
1025
+ this.messenger.registerActionHandler(`${name}:getAccounts`, this.getAccounts.bind(this));
1026
+ this.messenger.registerActionHandler(`${name}:getKeyringsByType`, this.getKeyringsByType.bind(this));
1027
+ this.messenger.registerActionHandler(`${name}:getKeyringForAccount`, this.getKeyringForAccount.bind(this));
1028
+ this.messenger.registerActionHandler(`${name}:persistAllKeyrings`, this.persistAllKeyrings.bind(this));
1029
+ this.messenger.registerActionHandler(`${name}:prepareUserOperation`, this.prepareUserOperation.bind(this));
1030
+ this.messenger.registerActionHandler(`${name}:patchUserOperation`, this.patchUserOperation.bind(this));
1031
+ this.messenger.registerActionHandler(`${name}:signUserOperation`, this.signUserOperation.bind(this));
1032
+ this.messenger.registerActionHandler(`${name}:addNewAccount`, this.addNewAccount.bind(this));
1033
+ this.messenger.registerActionHandler(`${name}:withKeyring`, this.withKeyring.bind(this));
1034
+ this.messenger.registerActionHandler(`${name}:addNewKeyring`, this.addNewKeyring.bind(this));
1035
+ this.messenger.registerActionHandler(`${name}:createNewVaultAndKeychain`, this.createNewVaultAndKeychain.bind(this));
1036
+ this.messenger.registerActionHandler(`${name}:createNewVaultAndRestore`, this.createNewVaultAndRestore.bind(this));
1037
1037
  }, _KeyringController_getKeyringById = function _KeyringController_getKeyringById(keyringId) {
1038
1038
  return __classPrivateFieldGet(this, _KeyringController_keyrings, "f").find(({ metadata }) => metadata.id === keyringId)
1039
1039
  ?.keyring;
@@ -1509,7 +1509,7 @@ async function _KeyringController_assertNoDuplicateAccounts(additionalKeyrings =
1509
1509
  this.update((state) => {
1510
1510
  state.isUnlocked = true;
1511
1511
  });
1512
- this.messagingSystem.publish(`${name}:unlock`);
1512
+ this.messenger.publish(`${name}:unlock`);
1513
1513
  }, _KeyringController_assertIsUnlocked = function _KeyringController_assertIsUnlocked() {
1514
1514
  if (!this.state.isUnlocked) {
1515
1515
  throw new Error(constants_1.KeyringControllerError.ControllerLocked);