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.
- Fix issue where
queuedRequestCount
state is not updated after flushing requests for an origin (#4898)
- BREAKING: The
QueuedRequestController
now requires thecanRequestSwitchNetworkWithoutApproval
callback in its constructor params. (#4846)
- The
QueuedRequestController
now ensures that a request that can switch the globally selected network without approval is queued behind any existing pending requests. (#4846)
- The
QueuedRequestController
now ensures that any queued requests for a origin are failed if a request that can switch the globally selected network without approval actually does change the globally selected network for that origin. (#4846)
- BREAKING: Bump
@metamask/network-controller
peer dependency from^21.0.0
to^22.0.0
(#4841) - Bump
@metamask/controller-utils
to^11.4.0
(#4834) - Bump
@metamask/rpc-errors
to^7.0.1
(#4831) - Bump
@metamask/utils
to^10.0.0
(#4831)
- Batch processing now considers both origin and
networkClientId
, ensuring requests targeting different networks are processed separately. (#4718) - Incoming requests to
enqueueRequest
now must include anetworkClientId
; an error is thrown if it's missing. This was previously a required part of the type but since consumers like the extension do not have extensive typescript coverage this wasn't definitively enforced. (#4718)
- 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.
- Remove extra slash when constructing user storage url (#4702)
- BREAKING: Bump devDependency and peerDependency
@metamask/network-controller
from^20.0.0
to^21.0.0
(#4618, #4651) - BREAKING: Bump devDependency and peerDependency
@metamask/selected-network-controller
from^17.0.0
to^18.0.0
(#4651) - Bump
@metamask/base-controller
from^6.0.2
to^7.0.0
(#4625, #4643) - Bump
@metamask/controller-utils
from^11.0.2
to^11.2.0
(#4639, #4651) - Bump
typescript
from~5.0.4
to~5.2.2
(#4576, #4584)
- BREAKING: Bump peerDependency
@metamask/selected-network-controller
from^16.0.0
to^17.0.0
(#4548) - 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/controller-utils
from^11.0.0
to^11.0.2
(#4517, #4544) - Bump
@metamask/json-rpc-engine
from^9.0.0
to^9.0.2
(#4517, #4544) - Bump
@metamask/rpc-errors
from^6.2.1
to^6.3.1
(#4516) - Bump
@metamask/utils
from^8.3.0
to^9.1.0
(#4516, #4529)
- BREAKING: Bump peerDependency
@metamask/network-controller
to^20.0.0
(#4508) - BREAKING: Bump peerDependency
@metamask/selected-network-controller
to^16.0.0
(#4508)
- BREAKING:
QueuedRequestController
constructor params now requires theshowApprovalRequest
hook that is called when the approval request UI should be opened/focused as the result of a request with confirmation being enqueued (#4456)
- BREAKING:
QueuedRequestController
constructor no longer accepts themethodsRequiringNetworkSwitch
array param. It's now replaced with theshouldRequestSwitchNetwork
function param which should return true when a request requires the globally selected network to match that of the dapp from which the request originated. (#4423) - BREAKING:
createQueuedRequestMiddleware
no longer accepts themethodsWithConfirmation
array typed param. It's now replaced with theshouldEnqueueRequest
function typed param which should return true when a request should be handled by theQueuedRequestController
. (#4423)
- BREAKING: Bump minimum Node version to 18.18 (#3611)
- BREAKING: Bump peer dependency
@metamask/network-controller
to^19.0.0
(#4352) - BREAKING: Bump peer dependency
@metamask/selected-network-controller
to^15.0.0
(#4352) - Bump
@metamask/base-controller
to^6.0.0
(#4352) - Bump
@metamask/controller-utils
to^11.0.0
(#4352) - Bump
@metamask/json-rpc-engine
to^9.0.0
(#4352)
- BREAKING: Bump peer dependency
@metamask/network-controller
to^18.1.3
(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/selected-network-controller
to^14.0.0
(#4342) - Bump
@metamask/controller-utils
to^10.0.0
(#4342)
- BREAKING: Bump peer dependency
@metamask/selected-network-controller
to^13.0.0
(#4260) - Bump
@metamask/json-rpc-engine
to^8.0.2
(#4234) - Bump
@metamask/base-controller
to^5.0.2
(#4232)
- BREAKING: Bump peer dependency
@metamask/selected-network-controller
to^12.0.0
(#4173)
- BREAKING: The
QueuedRequestMiddleware
constructor now requires themethodsWithConfirmation
param which should be a list of methods that can trigger confirmations (#4066) - BREAKING: The
QueuedRequestController
constructor now requires themethodsRequiringNetworkSwitch
param which should be a list of methods that need the globally selected network to switched to the dapp selected network before being processed (#4066) - BREAKING: Clear pending confirmations (for both queued and non-queued requests) after processing revokePermissions. We now require a function to be passed into the constructor (
clearPendingConfirmations
) which will be called when permissions are revoked for a domain who currently has pending confirmations that are not queued. This is done by piggybacking onSelectedNetworkController:stateChange
in order to serve as a proxy for permissions being revoked. (#4165) - BREAKING: The QueuedRequestController will now flush the RequestQueue after a dapp switches networks. QueuedRequestController now requires a subscription on
SelectedNetworkController:stateChange
, and upon receiving stateChanges for adding or replacing selectedNetworkController.state.domains, we flush the queue for the domain in question. (#4139)
- BREAKING:
QueuedRequestController.enqueueRequest()
now ensures the globally selected network matches the dapp selected network before processing methods listed in themethodsRequiringNetworkSwitch
constructor param. This replaces the previous behavior of switching for all methods excepteth_requestAccounts
. (#4066)
- BREAKING: Bump peer dependency
@metamask/selected-network-controller
to^11.0.0
(#4121) - Bump
@metamask/controller-utils
to^9.0.2
(#4065)
- 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
- Export
QueuedRequestControllerGetStateAction
andQueuedRequestControllerStateChangeEvent
(#3984)
- BREAKING: The
QueuedRequestController
will now batch queued requests by origin (#3781, #4038)- All of the requests in a single batch will be processed in parallel.
- Requests get processed in order of insertion, even across origins/batches.
- All requests get processed even in the event of preceding requests failing.
- BREAKING: The
queuedRequestCount
state no longer includes requests that are currently being processed; it just counts requests that are queued (#3781) - BREAKING: The
QueuedRequestController
no longer triggers a confirmation when a network switch is needed (#3781)- The network switch now happens automatically, with no confirmation.
- A new
QueuedRequestController:networkSwitched
event has been added to communicate when this has happened. - The
QueuedRequestController
messenger no longer needs access to the actionsNetworkController:getNetworkConfigurationByNetworkClientId
andApprovalController:addRequest
. - The package
@metamask/approval-controller
has been completely removed as a dependency
- BREAKING: The
QueuedRequestController
methodenqueueRequest
is now responsible for switching the network before processing a request, rather than theQueuedRequestMiddleware
(#3968)- Functionally the behavior is the same: before processing each request, we compare the request network client with the current selected network client, and we switch the current selected network client if necessary.
- The
QueuedRequestController
messenger now requires four additional allowed actions:NetworkController:getState
NetworkController:setActiveNetwork
NetworkController:getNetworkConfigurationByNetworkClientId
ApprovalController:addRequest
- The
QueuedRequestController
methodenqueueRequest
now takes one additional parameter, the request object. createQueuedRequestMiddleware
no longer takes a controller messenger; instead it takes theenqueueRequest
method fromQueuedRequestController
as a parameter.
- BREAKING: Remove the
QueuedRequestController:countChanged
event (#3985)- The number of queued requests is now tracked in controller state, as the
queuedRequestCount
property. Use theQueuedRequestController:stateChange
event to be notified of count changes instead.
- The number of queued requests is now tracked in controller state, as the
- BREAKING: Remove the
length
method (#3985)- The number of queued requests is now tracked in controller state, as the
queuedRequestCount
property.
- The number of queued requests is now tracked in controller state, as the
- BREAKING: Bump
@metamask/base-controller
to^5.0.0
(#4039)- This version has a number of breaking changes. See the changelog for more.
- BREAKING: Bump peer dependency on
@metamask/network-controller
to^18.0.0
(#4039) - BREAKING: Bump peer dependency on
@metamask/selected-network-controller
to^10.0.0
(#3996) - Bump
@metamask/controller-utils
to^9.0.0
(#4007) - Bump
@metamask/json-rpc-engine
to^8.0.0
(#4007) - Bump
@metamask/rpc-errors
to^6.2.1
(#3970)
- Add
queuedRequestCount
state (#3919)
- BREAKING: Bump
@metamask/selected-network-controller
peer dependency to^8.0.0
(#3958) - Deprecate the
length
method in favor of thequeuedRequestCount
state (#3919) - Deprecate the
countChanged
event in favor of thestateChange
event (#3919)
- BREAKING: Bump
@metamask/approval-controller
peer dependency to^5.1.2
(#3821) - BREAKING: Bump
@metamask/network-controller
peer dependency to^17.2.0
(#3821) - BREAKING: Bump
@metamask/selected-network-controller
peer dependency to^7.0.0
(#3821) - The action
NetworkController:setProviderType
is no longer used, so it's no longer required by theQueuedRequestController
messenger (#3807) - Bump
@metamask/swappable-obj-proxy
to^2.2.0
(#3784) - Bump
@metamask/utils
to^8.3.0
(#3769) - Bump
@metamask/base-controller
to^4.1.1
(#3760, #3821) - Bump
@metamask/controller-utils
to^8.0.2
(#3821) - Bump
@metamask/json-rpc-engine
to^7.3.2
(#3821)
- Add
QueuedRequestMiddlewareJsonRpcRequest
type (#1970).
- BREAKING:
QueuedRequestControllerMessenger
can no longer be defined with any allowed actions or events (#1970). - BREAKING: Add
@metamask/approval-controller
as dependency and peer dependency (#1970, #3695, #3680) - BREAKING: Bump
@metamask/network-controller
dependency and peer dependency from^17.0.0
to^17.1.0
(#3695) - BREAKING: Bump
@metamask/selected-network-controller
dependency and peer dependency from^4.0.0
to^6.1.0
(#3695, #3603) - Bump
@metamask/base-controller
to^4.0.1
(#3695) - Bump
@metamask/controller-utils
to^8.0.1
(#3695, #3678, #3667, #3580) - Bump
@metamask/base-controller
to^4.0.1
(#3695)
- Remove
@metamask/approval-controller
,@metamask/network-controller
, and@metamask/selected-network-controller
dependencies (#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/controller-utils
to ^6.0.0 (#2063) - Bump
@metamask/network-controller
to ^17.0.0 (#2063) - Bump
@metamask/selected-network-controller
to ^4.0.0 (#2063)
- BREAKING: Bump dependency and peer dependency on
@metamask/network-controller
to ^16.0.0 - Bump dependency and peer dependency on
@metamask/selected-network-controller
to ^3.1.2
- Bump dependency on @metamask/json-rpc-engine to ^7.2.0 (#1895)
- Bump @metamask/utils from 8.1.0 to 8.2.0 (#1957)
- Fixes an issue in the extension when 'useRequestQueue' is enabled. The problem occurred when a DApp's selected network differed from the globally selected network, and when the DApp's chosen network was not a built-in network. Under these conditions, the nickname would not be displayed in the 'toNetworkConfiguration' parameter passed to the
addApproval
function (#2000). - Fixes an issue in the extension when 'useRequestQueue' is activated. Previously, when invoking 'wallet_addEthereumChain', if the DApp's selected network was different from the globally selected network, the user was incorrectly prompted to switch the Ethereum chain prior to the 'addEthereumChain' request. With this update, 'addEthereumChain' will still be queued (due to its confirmation requirement), but the unnecessary chain switch prompt has been eliminated (#2000).
- Fix issue where switching chain would ultimately fail due to the wrong
networkClientId
/type
(#1962)
- Add missing methods that require confirmation (#1955)
- Initial release