All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Bump
@metamask/keyring-apito ^3.0.0 (#344)
- BREAKING: Unify
createNewVaultAndKeychainandcreateNewVaultAndRestoreinto new methodcreateNewVaultWithKeyring.createNewVaultWithKeyringaccepts apasswordand akeyringobject provided by the client and returns theKeyringControllerState(#329) - Bump @metamask/utils from 8.2.1 to 8.3.0 (#335)
- BREAKING: Bump
@metamask/obs-storefrom^8.1.0to^9.0.0(#306)- The
storeandmemStoreproperties now expose streams confirming toreadable-stream@^3.6.2
- The
- BREAKING: Replace
GenericEncryptor.updateVaultwithGenericEncryptor.isVaultUpdated(#310)) - Bump
@metamask/browser-passworderfrom^4.2.0to^4.3.0(#310 #311)
- Prefer cached
encryptionKeyover password when possible (#307)
- Added optional
isVaultUpdatedproperty toGenericEncryptortype (#312)
- Bump
@metamask/browser-passworderto^4.3.0(#312)
- Removed
updateVaultoptional property fromGenericEncryptortype (#312)
- Improved encryption performance when the controller is constructed with
cacheEncryptionKey: true(#312)
- BREAKING Removed
encryptorclass variable (#293) - BREAKING Removed
cacheEncryptionKeyclass variable (#293) - BREAKING Changed
encryptorconstructor option property type toGenericEncryptor | ExportableKeyEncryptor | undefined(#293)- When the controller is instantiated with
cacheEncryptionKey = true, theencryptortype is restricted toExportableKeyEncryptor | undefined
- When the controller is instantiated with
- Fix
removeAccountto await the account removal in order to account for Snaps keyrings (#280) - Bump
@metamask/eth-simple-keyringfrom^6.0.0to^6.0.1(#287)
- BREAKING: Bump
@metamask/eth-sig-utilfrom^6.0.0to^7.0.0(#269) - BREAKING: Bump
@metamask/eth-hd-keyringfrom^6.0.0to^7.0.1(#275) - BREAKING: Bump
@metamask/eth-simple-keyringfrom^5.0.0to^6.0.0(#273)
- Bump
@metamask/utilsfrom^6.2.0to^8.1.0(#261)
- Added
KeyringControllerPersistentStatetype which includes only persistent state, an optional string property with keyvault(#247) - Added
KeyringObjecttype for how keyrings are represented inmemStore(#247)
- BREAKING: Add types for store and fix type discrepancies (#247)
- BREAKING: Constructor parameter
KeyringControllerArgsfields changed (#247): - BREAKING: type of
storeandmemStorepublic properties changed (#247):KeyringController.storeis now anObservableStore<KeyringControllerPersistentState>KeyringController.memStoreis now anObservableStore<KeyringControllerState>
- BREAKING:
updateMemStoreKeyringsmethod return type changed toPromise<void>(#247) - BREAKING:
KeyringControllerStatetype changed to include only non-persistent state (#247):- Now
undefinedis used instead ofnullwhenencryptionKeyandencryptionSaltare unset keyringsis now of typeKeyringObject[]instead ofKeyring<Json>password,store,memStorehave been removed - note that in practice this change only affects types- This changes cause the following methods also to change the return type:
createNewVaultAndKeychaincreateNewVaultAndRestoresetLockedsubmitPasswordsubmitEncryptionKeyaddNewAccountremoveAccountfullUpdate
- Now
- BREAKING: When constructing a simple keyring with
addNewKeyring, the second parameter (opts) is now expected to be an array of private keys rather than an object with aprivateKeysproperty (#253) - Restored support for keyrings with non-object serialized state (#253)
- Narrow return type of
signTypedMessageand encryption methods (#249)- The methods
signTypedMessage,getEncryptionPublicKey, anddecryptMessagenow returnstringrather thanBytes
- The methods
- Fix
signTypedMessageparameter types (#250) - Restore compatibility with QR Keyring (#252)
- An empty object is no longer used as a default when deserialized state was not provided to the
addNewKeyringmethod. This default empty object was breaking the QR keyring.
- An empty object is no longer used as a default when deserialized state was not provided to the
- Improved error handling when calling
getKeyringForAccountwith empty or invalid address (#238)
- BREAKING: Update
@metamask/eth-sig-utilto version^6(#235)signPersonalMessagenow normalizesmsgParams.datain a different way for0and empty strings inputs.0will be normalized to0x00and empty strings to0x
- BREAKING: Update Node.js min version to 16.0.0 (#236)
- Update
@metamask/utilspackage (#234) - Destroy keyrings on reference drop (#233)
- BREAKING: The addNewKeyring method now expects an object containing the property
privateKeysof typestring[]in case the supplied keyring is a "Simple Keyring". (#202), (#228) - Migrate the project to TypeScript (#202)
- Methods that started with an underscore are now
#private methods - Additional validation has been added to most methods
- Methods that started with an underscore are now
- deps: Unpin and bump @metamask/eth-sig-utils@5.0.2->^5.1.0 (#224)
- Save encryption salt when
persistAllKeyringsyields a new encryption key (#203)
- BREAKING: Update module name to use
@metamaskscope (#187)- Consumers will now need to import this package as
@metamask/eth-keyring-controller
- Consumers will now need to import this package as
- BREAKING: @metamask/eth-hd-keyring to v6.0.0 (#193)
- Reverts the serialization format of mnemonics on HDKeyrings from
Uint8Arraysback to an untyped array of UTF8 encoded bytes, which was the format prior to v9.0.0 of this package.
- Reverts the serialization format of mnemonics on HDKeyrings from
9.0.0 [DEPRECATED]
- Add support for keyring
initmethod (#163).- If a keyring has an
initmethod, it will be called automatically upon construction. It is called withawait, so it can be asynchronous.
- If a keyring has an
- BREAKING: Replace constructor option and public property
keyringTypeswithkeyringBuilders(#163).- The constructor now takes keyring builder functions rather than classes. Each builder function should return a keyring instance when called, and it must have a
typestring property set to the keyring type name. See the newly exportedkeyringBuilderFactoryfunction for an example. The builder functions must be synchronous; use aninitmethod for asynchronous initialization steps.
- The constructor now takes keyring builder functions rather than classes. Each builder function should return a keyring instance when called, and it must have a
- BREAKING:
KeyringControlleris now a named export instead of a default export (#163). - BREAKING: Update
@metamask/eth-simple-keyringfrom v4 to v5 (#171).- This keyring type is included as a default. If you are using this keyring API directly, see the
@metamask/eth-simple-keyringrelease notes for details on required changes.
- This keyring type is included as a default. If you are using this keyring API directly, see the
- BREAKING: Replace
getKeyringClassForTypemethod withgetKeyringBuilderForType(#163). - BREAKING: Update
@metamask/eth-hd-keyringto v5 (#177)- This keyring type is included as a default. If you are using this keyring API directly, see the
@metamask/eth-hd-keyringrelease notes for details on required changes.
- This keyring type is included as a default. If you are using this keyring API directly, see the
- BREAKING: Require support for ES2020 (#177, #180)
- As a result of some dependency updates made in this release, this package now requires ES2020 support. If using this package in an environment that does not support ES2020 completely, consider investigating these two dependency changes and transpiling any packages using ES2020 syntax.
- Update
@metamask/eth-sig-utilto v5 (#180) - Update minimum supported version of
@metamask/browser-passworderfrom v4.0.1 to v4.0.2 (#182) - Remove
bip39dependency (#179)
- Fix support for asynchronous
addAccountsHD Keyring method (#176)- This method was asynchronous, but was called synchronously. Currently the method does not do anything asynchronous so this should have no functional impact, but this ensures any future errors or asynchronous steps added to that method work correctly in the future.
- Allow deserializing vaults with unrecognized keyrings (#169)
- When deserializing a vault with an unrecognized keyring, the controller will no longer crash. The unrecognized keyring vault data will be preserved in the vault for future use, but will otherwise be ignored.
- Restore full state return value (#161)
- Some methods were accidentally changed in v8.0.0 to return nothing, where previously they returned the full KeyringController state.
- The affected methods were:
createNewVaultAndKeychainsubmitPasswordsubmitEncryptionKeyaddNewAccountremoveAccount
- They now all return the full state, just as they did in earlier versions.
8.0.0 [DEPRECATED]
- Allow login with encryption key rather than password (#152)
- This is required to support MetaMask extension builds using manifest v3.
- This is enabled via the option
cacheEncryptionKey. - The encryption key and salt have been added to the
memStoreasencryptionKeyandencryptionSalt. The salt is used to verify that the key matches the vault being decrypted. - If the
cacheEncryptionKeyoption is enabled, the encryption key and salt get cached in thememStorewhenever the password is submitted. - The encryption key can be submitted with the new method
submitEncryptionKey. - The
unlockKeyringsmethod now accepts additional parameters for the encryption key and salt, though we don't recommend using this method directly.
- BREAKING: Update minimum Node.js version to v14 (#146)
- BREAKING:: Remove password parameter from
persistAllKeyringsandcreateFirstKeyTree(#154)- The password or encryption key must now be set already before these method are called. It is set by
createNewVaultAndKeychain,createNewVaultAndRestore, andsubmitPassword/submitEncryptionKey. - This change was made to reduce redundant state changes.
- The password or encryption key must now be set already before these method are called. It is set by
- Fix a typo in the duplicate account import error (#153)
createNewVaultAndRestorenow accepts a seedphrase formatted as an array of numbers (#138)
- Fix breaking change in
addNewKeyringfunction that was accidentally introduced in v7.0.0 (#136)- We updated the method such that keyrings were always constructed with constructor arguments, defaulting to an empty object if none were provided. But some keyrings (such as the QR Keyring) relied upon the options being undefined in some cases.
- BREAKING: Bump eth-hd-keyring to latest version (#132)
- When calling the
addNewKeyringmethod, an options object can no longer be passed containing anumberOfAccountsproperty without also including amnemonic. Not adding any option argument will result in the generation of a new mnemonic and the addition of 1 account derived from that mnemonic to the keyring.
- When calling the
- When calling
createNewVaultAndKeychainall keyrings are cleared first thing (#129) - Validate user imported seedphrase across all bip39 wordlists (#77)