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.
- BREAKING: Bump
@metamask/keyring-api
from^8.1.3
to^10.1.0
(#4948)- If you are depending on
@metamask/providers
directly, you will need to upgrade to 18.1.0.
- If you are depending on
- BREAKING Remove
addNewAccountWithoutUpdate
method (#4845)
- Bump
@metamask/base-controller
from^7.0.1
to^7.0.2
(#4862) - Bump
@metamask/utils
from^9.1.0
to^10.0.0
(#4831) - Bump
@metamask/eth-sig-util
from^7.0.1
to^8.0.0
(#4830)
- Bump
@metamask/message-manager
from^10.1.1
to^11.0.0
(#4805)
- Bump accounts related packages (#4713), (#4728)
- Those packages are now built slightly differently and are part of the accounts monorepo.
- Bump
@metamask/keyring-api
from^8.1.0
to^8.1.4
- Bump
@metamask/eth-hd-keyring
from^7.0.1
to^7.0.4
- Bump
@metamask/eth-simple-keyring
from^6.0.1
to^6.0.5
- Produce and export ESM-compatible TypeScript type declaration files in addition to CommonJS-compatible declaration files (#4648)
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
exports
field inpackage.json
linked to these files. This is an anti-pattern and was rightfully flagged by the "Are the Types Wrong?" tool as "masquerading as CJS". All of the ATTW checks now pass.
- Previously, this package shipped with only one variant of type declaration
files, and these files were only CommonJS-compatible, and the
- Remove chunk files (#4648).
- Previously, the build tool we used to generate JavaScript files extracted common code to "chunk" files. While this was intended to make this package more tree-shakeable, it also made debugging more difficult for our development teams. These chunk files are no longer present.
- Add
KeyringController:addNewAccount
messenger action (#4565)- Add and export
KeyringControllerAddNewAccountAction
type. - Widen
KeyringControllerActions
to includeKeyringControllerAddNewAccountAction
type. KeyringControllerMessenger
must allowKeyringControllerAddNewAccountAction
type.
- Add and export
- Bump
@metamask/base-controller
from^6.0.2
to^7.0.0
(#4625, #4643) - Bump
@metamask/keyring-api
from^8.0.1
to^8.1.0
(#4594) - Bump
@metamask/message-manager
from^10.0.2
to^10.0.3
(#4643) - Bump
typescript
from~5.0.4
to~5.2.2
(#4576, #4584)
- Upgrade TypeScript version to
~5.0.4
and setmoduleResolution
option toNode16
(#3645) - Bump
@metamask/base-controller
from^6.0.0
to^6.0.2
(#4517, #4544) - Bump
@metamask/keyring-api
from^8.0.0
to^8.0.1
(#3645) - Bump
@metamask/utils
from^9.0.0
to^9.1.0
(#4529) - Bump
@metamask/message-manager
from^10.0.1
to^10.0.2
(#4548)
- Bump
@metamask/utils
to^9.0.0
,@metamask/rpc-errors
to^6.3.1
(#4516)
- Clear encryption salt and key in
setLocked
and#createNewVaultWithKeyring
to ensure that encryption key is always generated with the latest password (#4514)
- Add support for overwriting built-in keyring builders for the Simple and HD keyring (#4362)
- Deprecate QR keyring methods (#4365)
cancelQRSignRequest
cancelQRSynchronization
connectQRHardware
forgetQRDevice
getOrAddQRKeyring
getQRKeyring
getQRKeyringState
resetQRKeyringState
restoreQRKeyring
submitQRCryptoHDKey
submitQRCryptoAccount
submitQRSignature
unlockQRHardwareWalletAccount
- BREAKING: Bump minimum Node version to 18.18 (#3611)
- Bump
@metamask/base-controller
to^6.0.0
(#4352) - Bump
@metamask/message-manager
to^10.0.0
(#4352)
- Add
changePassword
method (#4279)- This method can be used to change the password used to encrypt the vault.
- Add support for non-EVM account addresses to most methods (#4282)
- Previously, all addresses were assumed to be Ethereum addresses and normalized, but now only Ethereum addresses are treated as such.
- Relax type of
account
argument onremoveAccount
fromHex
tostring
- Bump
@metamask/keyring-api
to^6.1.1
(#4262) - Bump
@keystonehq/metamask-airgapped-keyring
to^0.14.1
(#4277) - Bump
async-mutex
to^0.5.0
(#4335) - Bump
@metamask/message-manager
to^9.0.0
(#4342)
- Fix QR keyrings so that they are not initialized with invalid state (#4256)
- Added
withKeyring
method (#4197)- Consumers can now use
withKeyring
to atomically select a keyring by address or type and execute a callback with the it as argument. - This method can be used instead of
getKeyringForAccount
,getKeyringsByType
andpersistAllKeyrings
, as the vault will be updated automatically after the callback execution, or rolled back in case of errors
- Consumers can now use
- BREAKING: Change various
KeyringController
methods so they no longer return the controller state (#4199)- Changed
addNewAccount
return type toPromise<string>
- Changed
addNewAccountWithoutUpdate
return type toPromise<string>
- Changed
createNewVaultAndKeychain
return type toPromise<void>
- Changed
createNewVaultAndRestore
return type toPromise<void>
- Changed
importAccountWithStrategy
return type toPromise<string>
- Changed
removeAccount
return type toPromise<void>
- Changed
setLocked
return type toPromise<void>
- Changed
submitEncryptionKey
return type toPromise<void>
- Changed
submitPassword
return type toPromise<void>
- Changed
- Bump
@metamask/keyring-api
to^6.0.0
(#4193) - Bump
@metamask/base-controller
to^5.0.2
(#4232) - Bump
@metamask/message-manager
to^8.0.2
(#4234)
- Method calls that change controller state are now atomic (#4192)
- Each method will roll back keyring instances in case of errors
- Method calls that change controller state are now mutually exclusive (#4182)
- Check presence of
HDKeyring
when updating the vault (#4168) - Update state in single call when persisting or unlocking (#4154)
- BREAKING use getAccounts on HD Keyring when calling addNewAccount (#4158)
- Pass CAIP-2 scope to execution context (#4090)
- Allow gas limits to be changed during #addPaymasterData (#3942)
- Fix
types
field inpackage.json
(#4047)
- BREAKING: Add ESM build (#3998)
- It's no longer possible to import files from
./dist
directly.
- It's no longer possible to import files from
- BREAKING: Bump
@metamask/base-controller
to^5.0.0
(#4039)- This version has a number of breaking changes. See the changelog for more.
- Bump
@metamask/message-manager
to^8.0.0
(#4039)
- BREAKING: Narrow
KeyringControllerMessenger
type parametersAllowedAction
andAllowedEvent
fromstring
tonever
(#4031)- Allowlisting or using any external actions or events will now produce a type error.
- Add
isCustodyKeyring
function (#3899) - Add
keyringBuilderFactory
utility function (#3830) - Add
GenericEncryptor
,ExportableKeyEncryptor
, andSerializedKeyring
types (#3830)
- Replace
ethereumjs-util
with@ethereumjs/util
(#3943) - Bump
@metamask/message-manager
to^7.3.9
(#4007)
- BREAKING: Remove callbacks
updateIdentities
,syncIdentities
,setSelectedAddress
,setAccountLabel
from constructor options of theKeyringController
class. These were previously used to updatePreferencesController
state, but are now replaced withPreferencesController
's subscription to theKeyringController:stateChange
event. (#3853)- Methods
addNewAccount
,addNewAccountForKeyring
,createNewVaultAndRestore
,createNewVaultAndKeychain
,importAccountWithStrategy
,restoreQRKeyring
,unlockQRHardwareWalletAccount
, andforgetQRDevice
no longer directly updatePreferencesController
state by calling theupdateIdentities
callback. - Method
submitPassword
no longer directly updatesPreferencesController
state by calling thesyncIdentities
callback. - Method
unlockQRHardwareWalletAccount
no longer directly updatesPreferencesController
state by calling thesetAccountLabel
orsetSelectedAddress
callbacks.
- Methods
- Remove
@metamask/eth-keyring-controller
dependency, and transfer dependencies to this package instead (#3830)@metamask/eth-hd-keyring
@metamask/eth-simple-keyring
@metamask/eth-sig-util
@metamask/browser-passworder
- Add
getDefaultKeyringState
function (#3799)
- Remove
peerDependency
anddevDependency
upon@metamask/preferences-controller
(#3799)- This dependency was just used to access the types of four methods. Those types are now inlined instead.
- Add methods to support ERC-4337 accounts (#3602)
- Bump
@metamask/keyring-api
to ^3.0.0 (#3747) - Bump @metamask/eth-keyring-controller from 17.0.0 to 17.0.1 (#3805)
- Bump
@metamask/utils
to^8.3.0
(#3769)
- Fix custody keyring name (#3803)
- BREAKING: Bump
@metamask/preferences-controller
to ^6.0.0
- BREAKING: Bump
@metamask/preferences-controller
peer dependency from^5.0.0
to^5.0.1
(#3695) - Bump
@metamask/base-controller
to^4.0.1
(#3695) - Bump
@metamask/eth-keyring-controller
to^15.1.0
(#3617) - Bump
@metamask/eth-sig-util
to^7.0.1
(#3614) - Bump
@metamask/message-manager
to^7.3.7
(#3695) - Update
forgetQRDevice
to return an object containingremovedAccounts
andremainingAccounts
(#3641)
- Remove
@metamask/preferences-controller
dependency (#3607)
- BREAKING: Bump
@metamask/base-controller
to ^4.0.0 (#2063)- This is breaking because the type of the
messenger
has backward-incompatible changes. See the changelog for this package for more.
- This is breaking because the type of the
- Bump
@metamask/message-manager
to ^7.3.6 (#2063) - Bump
@metamask/preferences-controller
to ^4.5.0 (#2063)
- Add
KeyringController:persistAllKeyrings
messenger action (#1965)
- BREAKING Change
encryptor
constructor option property type toGenericEncryptor | ExportableKeyEncryptor | undefined
(#2041)- When the controller is instantiated with
cacheEncryptionKey: true
,encryptor
may no longer be of typeGenericEncryptor
.
- When the controller is instantiated with
- Bump dependency on
@metamask/scure-bip39
2.1.1 (#1868) - Bump dependency on
@metamask/utils
to 8.2.0 (#1957) - Bump @metamask/eth-keyring-controller to 14.0.0 (#1771)
- Adds additional options to KeyringTypes enum (#1839)
signTransaction
now accepts an optionalopts: Record<string, unknown>
argument to supportsignTransaction
fromKeyring
type (#1789)- Bump dependency and peer dependency on
@metamask/preferences-controller
to ^4.4.3
- Bump dependency on
@metamask/utils
to ^8.1.0 (#1639) - Bump dependency on
@metamask/base-controller
to ^3.2.3 - Bump dependency on
@metamask/message-manager
to ^7.3.5
- Update
removeAccount
to remove call toPreferencesController.removeIdentity
asPreferencesController
already handles account removal side effects through messenger events (#1759)
- Update TypeScript to v4.8.x (#1718)
- Removed
keyringTypes
frommemStore
(#1710)- This property was accidentally getting copied into the memstore from the internal keyring controller. It was causing errors because there is no metadata for this state property.
- Add
getQRKeyring(): QRKeyring | undefined
method - Add
KeyringController:qrKeyringStateChange
messenger event - The event emits updates from the internal
QRKeyring
instance, if there's one
- BREAKING: addNewKeyring(type) return type changed from Promise<Keyring> to Promise
- When calling with QRKeyring type the keyring instance is retrieved or created (no multiple QRKeyring instances possible)
- Bump dependency on
@metamask/message-manager
to ^7.3.3 - Bump dependency on
@metamask/preferences-controller
to ^4.4.1
- Fix
addNewAccountForKeyring
forCustodyKeyring
(#1694)
- Add
KeyringController
messenger actions (#1691)KeyringController:getAccounts
KeyringController:getKeyringsByType
KeyringController:getKeyringForAccount
- Bump
@metamask/eth-sig-util
from 6.0.0 to 7.0.0 (#1669)
- Add
KeyringController
messenger actions (#1654)KeyringController:signMessage
KeyringController:signPersonalMessage
KeyringController:signTypedMessage
KeyringController:decryptMessage
KeyringController:getEncryptionPublicKey
- Add
decryptMessage
method (#1596)
- Add
addNewAccountForKeyring
method (#1591) - Add
addNewKeyring
method (#1594) - Add
persistAllKeyrings
method (#1574)
- Bump dependency on
@metamask/base-controller
to ^3.2.1 - Bump dependency on
@metamask/message-manager
to ^7.3.1 - Bump dependency and peer dependency on
@metamask/preferences-controller
to ^4.4.0
- Add
getEncryptionPublicKey
method on KeyringController (#1569)
- BREAKING: Remove
keyringTypes
property from the KeyringController state (#1441) - BREAKING: Constructor
KeyringControllerOptions
type changed (#1441)- The
KeyringControllerOptions.state
accepted type is now{ vault?: string }
- The
KeyringControllerOptions.keyringBuilders
type is now{ (): Keyring<Json>; type: string }[]
- The
- BREAKING: The
address
type accepted by theremoveAccount
method is nowHex
(#1441) - BREAKING: The
signTypedMessage
method now returns aPromise<string>
(#1441) - BREAKING: The
signTransaction
method now requires aTypedTransaction
from@ethereumjs/tx@^4
for thetransaction
argument, and returns aPromise<TxData>
(#1441) - BREAKING: Rename
Keyring
type toKeyringObject
(#1441) - BREAKING:
addNewAccount
now throws if address of new account is not a hex string (#1441) - BREAKING:
exportSeedPhrase
now throws if first keyring does not have a mnemonic (#1441) - BREAKING:
verifySeedPhrase
now throws if HD keyring does not have a mnemonic (#1441) - Update return type of
getAccountKeyringType
toPromise<string>
(#1441) - Update
@metamask/eth-keyring-controller
to^13.0.0
(#1441) - Update
@metamask/utils
to^6.2.0
(#1514) - Update
@ethereumjs/tx
to^4.2.0
(#1514) - Update
@ethereumjs/common
to^3.2.0
(#1514) - Update
@keystonehq/metamask-airgapped-keyring
to^0.13.1
(#1514)
- Bump @metamask/eth-sig-util to ^6.0.0 (#1483)
- Add messenger events
KeyringController:lock
andKeyringController:unlock
, emitted when the inner EthKeyringController is locked/unlocked (#1378)- Also add corresponding types
KeyringControllerLockEvent
andKeyringControllerUnlockEvent
- Also add corresponding types
- Add
KeyringController:accountRemoved
event, fired whenever an account is removed throughremoveAccount
(#1416)
- BREAKING: Update constructor to take a single argument, an options bag, instead of three arguments (#1378)
- BREAKING: Update controller so state is now accessible via
controller.state
instead ofcontroller.store.getState()
(#1378) - BREAKING: Update KeyringController to take a required
messenger
option (#1378)- The messenger will now publish
KeyringController:stateChange
on state changes thanks to BaseControllerV2 - The messenger features a
KeyringController:getState
action thanks to BaseControllerV2 - Add types
KeyringControllerGetStateAction
andKeyringControllerStateChangeEvent
for the above - Add type
KeyringControllerMessenger
- The messenger will now publish
- BREAKING: Update
keyringState
property in the return value of several methods from a type ofKeyringMemState
toKeyringControllerMemState
(#1378)- The affected methods are:
addNewAccount
addNewAccountWithoutUpdate
createNewVaultAndRestore
createNewVaultAndKeychain
importAccountWithStrategy
removeAccount
setLocked
submitEncryptionKey
submitPassword
- The new type omits
vault
,encryptionKey
, andencryptionSalt
- The affected methods are:
- BREAKING: Remove
KeyringState
,KeyringMemState
, andKeyringConfig
in favor of new typesKeyringControllerState
,KeyringControllerMemState
,KeyringControllerActions
,KeyringControllerEvents
, andKeyringControllerOptions
(#1378)KeyringControllerState
is like the previousKeyringMemState
but with an extravault
propertyKeyringControllerMemState
is like the previousKeyringMemState
but withoutencryptionKey
orencryptionSalt
KeyringControllerOptions
incorporates the previous set of options andKeyringConfig
- Add
immer
as a dependency (#1378)
- BREAKING: Remove
subscribe
andunsubscribe
methods (#1378)- State changes can be directly subscribed to (or unsubscribed from) via the messenger if necessary
- BREAKING: Remove
lock
andunlock
methods (#1378)KeyringController:lock
andKeyringController:unlock
may now be subscribed to via the messenger if necessary
- BREAKING: Remove
fullUpdate
method (#1378)- There is no need to call this method anymore because the controller should always be up to date with the EthKeyringController instance
- BREAKING: Remove
index
from theKeyring
type (#1378)
- Add
cancelQRSynchronization
method (#1387)
- Add support for encryption keys (#1342)
- The configuration option
cacheEncryptionKey
has been added, along with two new state properties (encryptionKey
andencryptionSalt
) and a new method (submitEncryptionKey
) - All new state and config entries are optional, so this will have no effect if you're not using this feature.
- The configuration option
- Make
addNewAccount
idempotent (#1298)- The
addNewAccount
method now takes an optionalaccountCount
parameter. If provided, we ensure that this can be called repeatedly with the same result.
- The
- Add deprecated
getKeyringForAccount
andgetKeyringsByType
methods (#1376, #1386)
- BREAKING: Bump to Node 16 (#1262)
- BREAKING: Change return type of
createNewVaultAndRestore
fromstring | number[]
toUint8Array
(#1349) - BREAKING: Change return type of
verifySeedPhrase
fromstring
toUint8Array
(#1338) - BREAKING: Replace
validatePassword
withverifyPassword
(#1348)verifyPassword
is asynchronous, unlikevalidatePassword
which was not.verifyPassword
does not return a boolean to indicate whether the password is valid. Instead an error is thrown when it's invalid.
- BREAKING:
createNewVaultAndKeychain
will now skip vault creation if one already exists, rather than replacing it (#1324)- If you do want to replace a vault if one exists, you will have to remove it first before this is called.
- BREAKING:
importAccountWithStrategy
andaddNewAccount
no longer update the selected address (#1296, #1309)- If you want the newly imported account to be selected, you will have to do that manually after this is called.
- BREAKING: Change
importAccountWithStrategy
return type (#1295)importAccountWithStrategy
now returns an object withkeyringState
andimportedAccountAddress
, rather than just the keyring state.
- BREAKING: Change
addNewAccount
return type (#1294)addNewAccount
now returns an object withkeyringState
andaddedAccountAddress
, rather than just the keyring state.
- BREAKING: Add
@metamask/preferences-controller
peer dependency (#1393) - Bump @metamask/eth-keyring-controller from 10.0.0 to 10.0.1 (#1280)
- Bump @metamask/eth-sig-util from 5.0.2 to 5.0.3 (#1278)
- Update
@metamask/preferences-controller
dependency
- Improve validation of
from
address insignTypedMessage
(#1293) - Improve private key validation in
importAccountWithStrategy
(#1297)- A more helpful error is now thrown when the given private key has the wrong length
- Keep
vault
state in sync with the internalEthKeyringController
vault state (#1384)- Previously the
vault
state would never be updated after construction, becoming stale as account changes were made - The old behavior was especially confusing because the
subscribe
method is overridden to return state change events from the internalEthKeyingController
state, resulting in state change events being out of sync with controller state. They should be the same now.
- Previously the
- BREAKING: Remove
isomorphic-fetch
(#1106)- Consumers must now import
isomorphic-fetch
or another polyfill themselves if they are running in an environment withoutfetch
- Consumers must now import
- BREAKING:: Bump eth-keyring-controller version to @metamask/eth-keyring-controller v10 (#1072)
exportSeedPhrase
now returns aUint8Array
typed SRP (can be converted to a string using this approach). It was previously a Buffer.- The HD keyring included with the keyring controller has been updated from v4 to v6. See the
eth-hd-keyring
changelog entries for v5 and v6 for further details on breaking changes.
- BREAKING:: Require ES2020 support or greater (#914)
- This change was introduced by an indirect dependency on
ethereumjs/util
v8
- This change was introduced by an indirect dependency on
- Rename this repository to
core
(#1031) - Update
@metamask/eth-sig-util
to v5 (#914) - Update
@metamask/controller-utils
package (#1041)
- Relax dependencies on
@metamask/base-controller
,@metamask/controller-utils
,@metamask/message-manager
, and@metamask/preferences-controller
(use^
instead of~
) (#998)
-
Initial release
-
As a result of converting our shared controllers repo into a monorepo (#831), we've created this package from select parts of
@metamask/controllers
v33.0.0, namely:- Everything in
src/keyring
All changes listed after this point were applied to this package following the monorepo conversion.
- Everything in
-