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 devDependency and peerDependency
@metamask/network-controller
from^20.0.0
to^21.0.0
(#4651) - BREAKING: Bump devDependency and peerDependency
@metamask/gas-fee-controller
from^19.0.0
to^20.0.0
( #4651) - Bump
@metamask/base-controller
from^6.0.3
to^7.0.0
(#4643) - Bump
@metamask/controller-utils
from^11.0.2
to^11.2.0
(#4639, #4651)
- Add tracing infrastructure (#4575)
- Add optional
trace
callback to constructor. - Add optional
traceContext
option toaddTransaction
method. - Add initial tracing of transaction lifecycle.
- Add optional
- Bump
@metamask/base-controller
from^6.0.2
to^6.0.3
(#4625) - Bump
@metamask/network-controller
from^20.1.0
to^20.2.0
(#4618) - Bump
@metamask/eth-json-rpc-provider
from^4.1.2
to^4.1.3
(#4607)
- Remove validation of
gasValues
passed tospeedUpTransaction
andstopTransaction
methods (#4617)
- Fix gaps in transaction validation and async error logging (#4596)
- Upgrade
@metamask/nonce-tracker
from v5 to v6 (#4591)
- Add
DISPLAYED_TRANSACTION_HISTORY_PATHS
constant, representing the transaction history paths that may be used for display (#4555)- This was exported so that it might be used to ensure display logic and internal history logic remains in-sync.
- Any paths listed here will have their timestamps preserved. Unlisted paths may be compressed by the controller to minimize history size, losing the timestamp.
- Add
MAX_TRANSACTION_HISTORY_LENGTH
constant, representing the expected maximum size of thehistory
property for a given transaction (#4555)- Note that this is not strictly enforced, the length may exceed this number of all entries are "displayed" entries, but we expect this to be extremely improbable in practice.
- Prevent transaction history from growing endlessly in size (#4555)
- BREAKING: Bump peerDependency
@metamask/accounts-controller
from^17.0.0
to^18.0.0
(#4548) - Remove
@metamask/accounts-controller
,@metamask/approval-controller
,@metamask/gas-fee-controller
, and@metamask/network-controller
dependencies #4556- These were listed under
peerDependencies
already, so they were redundant as dependencies.
- These were listed under
- 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/rpc-errors
from^6.2.1
to^6.3.1
(#4516) - Bump
@metamask/utils
from^8.3.0
to^9.1.0
(#4516, #4529)
- Fix simulation data parsing logic to avoid failed simulations creating
ApprovalForAll
events (#4512)
- BREAKING: Bump peerDependency
@metamask/network-controller
to^20.0.0
(#4508) - BREAKING: Bump peerDependency
@metamask/gas-fee-controller
to^19.0.0
(#4508)
- BREAKING: Bump dependency and peer dependency
@metamask/gas-fee-controller
to^18.0.0
(#4498) - Bump dependency
@metamask/accounts-controller
to^17.2.0
(#4498)
- BREAKING: The
TransactionController
messenger must now allow theAccountsController:getSelectedAccount
action (#4244) - BREAKING:
getCurrentAccount
returns anInternalAccount
instead of astring
in theIncomingTransactionHelper
(#4244) - BREAKING: Bump dependency and peer dependency
@metamask/accounts-controller
to^17.0.0
(#4413) - Bump
@metamask/eth-snap-keyring
to^4.3.1
(#4405) - Bump
@metamask/keyring-api
to^8.0.0
(#4405)
- BREAKING: Remove
getSelectedAddress
option fromTransactionController
(#4244)- The AccountsController is used to get the currently selected address automatically.
MultichainTrackingHelper.getEthQuery
now returns globalethQuery
with (#4390)- Support skipping updates to the simulation history for clients with disabled history (#4349)
- BREAKING: Bump minimum Node version to 18.18 (#3611)
- BREAKING: Bump dependency and peer dependency
@metamask/approval-controller
to^7.0.0
(#4352) - BREAKING: Bump dependency and peer dependency
@metamask/gas-fee-controller
to^17.0.0
(#4352) - BREAKING: Bump dependency and peer dependency
@metamask/network-controller
to^19.0.0
(#4352) - Bump
@metamask/base-controller
to^6.0.0
(#4352) - Bump
@metamask/controller-utils
to^11.0.0
(#4352)
- BREAKING: Bump dependency and peer dependency
@metamask/approval-controller
to^6.0.2
(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/gas-fee-controller
to^16.0.0
(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/network-controller
to^18.1.3
(#4342) - Bump
async-mutex
to^0.5.0
(#4335) - Bump
@metamask/controller-utils
to^10.0.0
(#4342)
- BREAKING: Remove
sign
fromTransactionType
(#4319)- This represented an
eth_sign
transaction, but support for that RPC method is being removed, so this is no longer needed.
- This represented an
- Pass an unfrozen transaction to the
afterSign
hook so that it is able to modify the transaction (#4343)
- BREAKING: Update from
nonce-tracker@^3.0.0
to@metamask/nonce-tracker@^5.0.0
to mitigate issue with redundant polling loops in block tracker. (#4309)- The constructor now expects the
blockTracker
option being an instance of@metamask/eth-block-tracker
instead ofeth-block-tracker
.
- The constructor now expects the
- handle Swap+Send transactions as Swaps transactions sub-category; add typing (#4298)
- fix incorrect token balance changes for simulations of multiple tokens that include an NFT mint (#4290)
- Bump
@metamask/gas-fee-controller
to^15.1.2
(#4275)
- approveTransaction was throwing away the raw signed transaction that signTransaction was adding to the metadata. This was causing some transaction with low gas to appear as "failed" when in fact they were still pending. (#4255)
- Add
estimateGasFee
method (#4216)- Add
TestGasFeeFlow
that is activated by optionaltestGasFeeFlows
constructor option. - Add related types:
FeeMarketGasFeeEstimateForLevel
FeeMarketGasFeeEstimates
GasFeeEstimates
GasFeeEstimateLevel
GasFeeEstimateType
GasPriceGasFeeEstimates
LegacyGasFeeEstimates
- Add
- BREAKING: Update
GasFeeEstimates
type to support alternate estimate types (#4216) - Bump
@metamask/base-controller
to^5.0.2
(#4232) - Bump
@metamask/approval-controller
to^6.0.2
(#4234) - Bump
@metamask/gas-fee-controller
to^15.1.1
(#4234)
- BREAKING: Remove
gasFeeControllerEstimateType
property frommergeGasFeeEstimates
function (#4216)
- Bump
@metamask/gas-fee-controller
to ^15.1.0 (#4220)
- Fixed simulating minting NFTs where the nft owner was checked before minting, causing a revert. (#4217)
- Support retrieval of layer 1 gas fees on Scroll networks (#4155)
- BREAKING: Change
getLayer1GasFee
arguments to a request object (#4149)
- Fix automatic update of layer 1 gas fee after interval (#4149)
- Include wrapped ERC-20 and legacy ERC-721 tokens in simulation balance changes (#4122)
- BREAKING: Change
pendingTransactions.isResubmitEnabled
from optionalboolean
to optional callback (#4113)
- Check pending transactions on startup (#4113)
- Run
OptimismLayer1GasFeeFlow
on Optimism stack based transactions in order to addlayer1GasFee
property to transaction meta. (#4055) - Add
getLayer1GasFee
method toTransactionController
to get the layer 1 gas fee for the given transaction params (#4055) - Add
SimulationErrorCode
enum (#4106)
- BREAKING: Bump peer dependency
@metamask/gas-fee-controller
to^15.0.0
(#4121) - Update
addTransaction
to skip simulation ifrequireApproval
is specified asfalse
(#4106) - Provide simulation error code in locally generated errors (under the
code
property) (#4106) - Add dependency
@ethersproject/contracts
^5.7.0
(#4055) - Add dependency
@ethersproject/providers
^5.7.0
(#4055) - Bump dependency
@metamask/network-controller
to^18.1.0
(#4121)
- BREAKING: Remove
isReverted
property fromSimulationError
type. (#4106)
- Add support for transactions with type
increaseAllowance
(#4069)- Also add "increaseAllowance" to
TransactionType
undertokenMethodIncreaseAllowance
- Also add "increaseAllowance" to
- Bump
@metamask/metamask-eth-abis
to^3.1.1
(#4069)
- Provide updated transaction metadata to publish hook (#4101)
- Bump
TypeScript
version to~4.9.5
(#4084)
- Emit finished event for custodial transactions when updating status to
submitted
orfailed
(#4092)
- Add simulation types (#4067)
- SimulationBalanceChange
- SimulationData
- SimulationError
- SimulationToken
- SimulationTokenBalanceChange
- SimulationTokenStandard
- No longer wait for simulation to complete before creating approval request (#4067)
- Automatically update simulation data if transaction parameters are updated (#4067)
- Determine networks supporting simulation dynamically using API (#4087)
- Support
Layer1GasFeeFlows
and addlayer1GasFee
property toTransactionMeta
(#3944)
- 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
- Add new types for TransactionController messenger actions (#3827)
TransactionControllerActions
TransactionControllerGetStateAction
- Add new types for TransactionController messenger events (#3827)
TransactionControllerEvents
TransactionControllerIncomingTransactionBlockReceivedEvent
TransactionControllerPostTransactionBalanceUpdatedEvent
TransactionControllerSpeedupTransactionAddedEvent
TransactionControllerStateChangeEvent
TransactionControllerTransactionApprovedEvent
TransactionControllerTransactionConfirmedEvent
TransactionControllerTransactionDroppedEvent
TransactionControllerTransactionFailedEvent
TransactionControllerTransactionFinishedEvent
TransactionControllerTransactionNewSwapApprovalEvent
TransactionControllerTransactionNewSwapEvent
TransactionControllerTransactionPublishingSkipped
TransactionControllerTransactionRejectedEvent
TransactionControllerTransactionStatusUpdatedEvent
TransactionControllerTransactionSubmittedEvent
TransactionControllerUnapprovedTransactionAddedEvent
- Add optional
simulationData
property toTransactionMeta
which will be automatically populated (#4020) - Add optional
isSimulationEnabled
constructor option to dynamically disable simulation (#4020) - Add support for Linea Sepolia (chain ID
0xe705
) (#3995)
- BREAKING: Change superclass of TransactionController from BaseController v1 to BaseController v2 (#3827)
- Instead of accepting three arguments, the constructor now takes a single options argument. All of the existing options that were supported in the second argument are now a part of this options object, including
messenger
;state
(the previous third argument) is also an option.
- Instead of accepting three arguments, the constructor now takes a single options argument. All of the existing options that were supported in the second argument are now a part of this options object, including
- BREAKING: Rename
txHistoryLimit
option totransactionHistoryLimit
(#3827) - BREAKING: Switch some type definitions from
interface
totype
(#3827)- These types are affected:
DappSuggestedGasFees
Log
MethodData
TransactionControllerState
(formerlyTransactionState
)TransactionParams
TransactionReceipt
- This is a breaking change because type aliases have different behavior from interfaces. Specifically, the
Json
type in@metamask/utils
, which BaseController v2 controller state must conform to, is not compatible with interfaces.
- These types are affected:
- BREAKING: Align
parsedRegistryMethod
inMethodData
type with usage (#3827)- The type of this is now
{ name: string; args: { type: string }[]; } | { name?: any; args?: any; }
, which is aJson
-compatible version of a type found ineth-method-registry
.
- The type of this is now
- BREAKING: Rename
TransactionState
toTransactionControllerState
(#3827)- This change aligns this controller with other MetaMask controllers.
- BREAKING: Update allowed events for the
TransactionControllerMessenger
(#3827)- The restricted messenger must allow the following events:
TransactionController:incomingTransactionBlockReceived
TransactionController:postTransactionBalanceUpdated
TransactionController:speedUpTransactionAdded
TransactionController:transactionApproved
TransactionController:transactionConfirmed
TransactionController:transactionDropped
TransactionController:transactionFinished
TransactionController:transactionFinished
TransactionController:transactionPublishingSkipped
TransactionController:transactionRejected
TransactionController:transactionStatusUpdated
TransactionController:transactionSubmitted
TransactionController:unapprovedTransactionAdded
- The restricted messenger must allow the following events:
- BREAKING: Update
TransactionMeta
type to be compatible withJson
(#3827)- As dictated by BaseController v2, any types that are part of state need to be compatible with the
Json
type from@metamask/utils
.
- As dictated by BaseController v2, any types that are part of state need to be compatible with the
- BREAKING: Transform
rpc
property on transaction errors so they're JSON-encodable (#3827)- This change also results in typing this property as
Json
instead ofunknown
, avoiding a "Type instantiation is excessively deep and possibly infinite" error when resolving theTransactionControllerState
type.
- This change also results in typing this property as
- BREAKING: Bump dependency and peer dependency on
@metamask/approval-controller
to^6.0.0
(#4039) - BREAKING: Bump dependency and peer dependency on
@metamask/gas-fee-controller
to^14.0.0
(#4039) - BREAKING: Bump dependency and peer dependency on
@metamask/network-controller
to^18.0.0
(#4039) - BREAKING: Bump
@metamask/base-controller
to^5.0.0
(#4039)- This version has a number of breaking changes. See the changelog for more.
- Add dependency on
@ethersproject/providers
^5.7.0
(#4020) - Bump
@metamask/controller-utils
to^9.0.0
(#4039)
- BREAKING: Remove
TransactionConfig
type (#3827)- The properties in this type have been absorbed into
TransactionControllerOptions
.
- The properties in this type have been absorbed into
- BREAKING: Remove
hub
property from TransactionController (#3827)- TransactionController now fully makes use of its messenger object to announce various kinds of activities. Instead of subscribing to an event like this:
use this:
transactionController.hub.on(eventName, ...)
messenger.subscribe('TransactionController:${eventName}', ...)
- The complete list of renamed events are:
incomingTransactionBlock
->TransactionController:incomingTransactionBlockReceived
post-transaction-balance-updated
->TransactionController:postTransactionBalanceUpdated
transaction-approved
->TransactionController:transactionApproved
transaction-confirmed
->TransactionController:transactionConfirmed
transaction-dropped
->TransactionController:transactionDropped
transaction-finished
->TransactionController:transactionFinished
transaction-rejected
->TransactionController:transactionRejected
transaction-status-update
->TransactionController:transactionStatusUpdated
transaction-submitted
->TransactionController:transactionSubmitted
unapprovedTransaction
->TransactionController:unapprovedTransactionAdded
- Some events announced the state of specific transactions. These have been removed. Instead, subscribe to the appropriate generic event and check for a specific transaction ID in your event handler:
${transactionId}:finished
->TransactionController:transactionFinished
${transactionId}:speedup
->TransactionController:speedUpTransactionAdded
${transactionId}:publish-skip
->TransactionController:transactionPublishingSkipped
- TransactionController now fully makes use of its messenger object to announce various kinds of activities. Instead of subscribing to an event like this:
- Fix various methods so that they no longer update transactions in state directly but only via
update
(#3827)addTransaction
confirmExternalTransaction
speedUpTransaction
updateCustodialTransaction
updateSecurityAlertResponse
updateTransaction
- Fix
handleMethodData
method to update state with an empty registry object instead of blowing up if registry could be found (#3827)
- Add
normalizeTransactionParams
method (#3990)
- BREAKING: Remove support for retrieving transactions via Etherscan for Optimism Goerli; add support for Optimism Sepolia instead (#3999)
- Normalize
data
property into an even length hex string (#3990) - Bump
@metamask/approval-controller
to^5.1.3
(#4007) - Bump
@metamask/controller-utils
to^8.0.4
(#4007) - Bump
@metamask/gas-fee-controller
to^13.0.2
(#4007) - Bump
@metamask/network-controller
to^17.2.1
(#4007)
- Add
gasFeeEstimatesLoaded
property toTransactionMeta
(#3948) - Add
gasFeeEstimates
property toTransactionMeta
to be automatically populated on unapproved transactions (#3913)
- Use the
linea_estimateGas
RPC method to provide transaction specific gas fee estimates on Linea networks (#3913)
- BREAKING: Constructor now expects a
getNetworkClientRegistry
callback function (#3643) - BREAKING: Messenger now requires
NetworkController:stateChange
to be an allowed event (#3643) - BREAKING: Messenger now requires
NetworkController:findNetworkClientByChainId
andNetworkController:getNetworkClientById
actions (#3643) - Adds a feature flag parameter
isMultichainEnabled
passed via the constructor (and defaulted to false), which when passed a truthy value will enable the controller to submit, process, and track transactions concurrently on multiple networks. (#3643) - Adds
destroy()
method that stops/removes internal polling and listeners (#3643) - Adds
stopAllIncomingTransactionPolling()
method that stops polling Etherscan for transaction updates relevant to the currently selected network.- When called with the
isMultichainEnabled
feature flag on, also stops polling Etherscan for transaction updates relevant to each currently polled networkClientId. (#3643)
- When called with the
- Exports
PendingTransactionOptions
type (#3643) - Exports
TransactionControllerOptions
type (#3643)
- BREAKING:
approveTransactionsWithSameNonce()
now requireschainId
to be populated in for each TransactionParams that is passed (#3643) addTransaction()
now accepts optionalnetworkClientId
in its options param which specifies the network client that the transaction will be processed with during its lifecycle if theisMultichainEnabled
feature flag is on (#3643)- when called with the
isMultichainEnabled
feature flag off, passing in a networkClientId will cause an error to be thrown.
- when called with the
estimateGas()
now accepts optional networkClientId as its last param which specifies the network client that should be used to estimate the required gas for the given transaction (#3643)- when called with the
isMultichainEnabled
feature flag is off, the networkClientId param is ignored and the global network client will be used instead.
- when called with the
estimateGasBuffered()
now accepts optional networkClientId as its last param which specifies the network client that should be used to estimate the required gas plus buffer for the given transaction (#3643)- when called with the
isMultichainEnabled
feature flag is off, the networkClientId param is ignored and the global network client will be used instead.
- when called with the
getNonceLock()
now accepts optional networkClientId as its last param which specifies which the network client's nonceTracker should be used to determine the next nonce. (#3643)- When called with the
isMultichainEnabled
feature flag on and with networkClientId specified, this method will also restrict acquiring the next nonce by chainId, i.e. if this method is called with two different networkClientIds on the same chainId, only the first call will return immediately with a lock from its respective nonceTracker with the second call being blocked until the first caller releases its lock - When called with
isMultichainEnabled
feature flag off, the networkClientId param is ignored and the global network client will be used instead.
- When called with the
startIncomingTransactionPolling()
andupdateIncomingTransactions()
now enforce a 5 second delay between requests per chainId to avoid rate limiting (#3643)TransactionMeta
type now specifies an optionalnetworkClientId
field (#3643)startIncomingTransactionPolling()
now accepts an optional array ofnetworkClientIds
. (#3643)- When
networkClientIds
is provided and theisMultichainEnabled
feature flag is on, the controller will start polling Etherscan for transaction updates relevant to the networkClientIds. - When
networkClientIds
is provided and theisMultichainEnabled
feature flag is off, nothing will happen. - If
networkClientIds
is empty or not provided, the controller will start polling Etherscan for transaction updates relevant to the currently selected network.
- When
stopIncomingTransactionPolling()
now accepts an optional array ofnetworkClientIds
. (#3643)- When
networkClientIds
is provided and theisMultichainEnabled
feature flag is on, the controller will stop polling Ethercsan for transaction updates relevant to the networkClientIds. - When
networkClientIds
is provided and theisMultichainEnabled
feature flag is off, nothing will happen. - If
networkClientIds
is empty or not provided, the controller will stop polling Etherscan for transaction updates relevant to the currently selected network.
- When
- BREAKING: Add peerDependency on
@babel/runtime
(#3897) - Throw after publishing a canceled or sped-up transaction if already confirmed (#3800)
- Bump
eth-method-registry
from^3.0.0
to^4.0.0
(#3897) - Bump
@metamask/controller-utils
to^8.0.3
(#3915) - Bump
@metamask/gas-fee-controller
to^13.0.1
(#3915)
- BREAKING: Remove
cancelMultiplier
andspeedUpMultiplier
constructor options as both values are now fixed at1.1
. (#3909)
- Remove implicit peerDependency on
babel-runtime
(#3897)
- Add optional
publish
hook to support custom logic instead of submission to the RPC provider (#3883) - Add
hasNonce
option toapproveTransactionsWithSameNonce
method (#3883)
- Add
abortTransactionSigning
method (#3870)
- Resolves transaction custodian promise when setting transaction status to
submitted
orfailed
(#3845) - Fix normalizer ensuring property
type
is always present inTransactionParams
(#3817)
- BREAKING: Bump
@metamask/approval-controller
peer dependency to^5.1.2
(#3821) - BREAKING: Bump
@metamask/gas-fee-controller
peer dependency to^13.0.0
(#3821) - BREAKING: Bump
@metamask/network-controller
peer dependency to^17.2.0
(#3821) - Bump
@metamask/base-controller
to^4.1.1
(#3821) - Bump
@metamask/controller-utils
to^8.0.2
(#3821)
- BREAKING: Change type of
destinationTokenDecimals
property inTransactionMeta
tonumber
(#3749)
- Handle missing current account in incoming transactions (#3741)
- Bump
eth-method-registry
from^1.1.0
to^3.0.0
(#3688)
- BREAKING: Bump
@metamask/approval-controller
dependency and peer dependency from^5.1.0
to^5.1.1
(#3695) - BREAKING: Bump
@metamask/gas-fee-controller
dependency and peer dependency from^11.0.0
to^12.0.0
(#3695) - BREAKING: Bump
@metamask/network-controller
dependency and peer dependency from^17.0.0
to^17.1.0
(#3695) - Bump
@metamask/base-controller
to^4.0.1
(#3695) - Bump
@metamask/controller-utils
to^8.0.1
(#3695)
- Use estimate gas instead of fixed gas (21k) when a contract is deployed and the gas is not specified (#3694)
- Fix incorrect transaction statuses (#3676)
- Fix
dropped
status detection by ignoring transactions on other chains. - Start polling if network changes and associated transactions are pending.
- Record
r
,s
, andv
values even if zero. - Only fail transactions if receipt
status
is explicitly0x0
.
- Fix
- Fix incoming transactions on Linea Goerli (#3674)
- Add optional
getExternalPendingTransactions
callback argument to constructor (#3587)
- Add the
customNonceValue
property to the transaction metadata (#3579)
- Update transaction metadata after approval if the approval result includes the
value.txMeta
property (#3579) - Add
type
property to all incoming transactions (#3579)
- Add
cancelMultiplier
andspeedUpMultiplier
constructor arguments to optionally override the default multipliers of1.5
and1.1
respectively (#2678)
- Populate the
preTxBalance
property before publishing transactions with theswap
type (#2678) - Change the status of transactions with matching nonces to
dropped
when confirming a transaction (#2678)
- Add
updateEditableParams
method (#2056) - Add
initApprovals
method to trigger the approval flow for any pending transactions during initialisation (#2056) - Add
getTransactions
method to search transactions using the given criteria and options (#2056)
- 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
- BREAKING: Add
finished
andpublish-skip
events toEvents
type - BREAKING: Update
TransactionReceipt
type sotransactionIndex
is now a string rather than a number (#2063) - Bump
nonce-tracker
to ^3.0.0 (#2040) - The controller now emits a
transaction-status-update
event each time the status of a transaction changes (e.g. submitted, rejected, etc.) (#2027) - Make
getCurrentAccountEIP1559Compatibility
constructor parameter optional (#2056) - Normalize the gas values provided to the
speedUpTransaction
andstopTransaction
methods (#2056) - Persist any property changes performed by the
afterSign
hook (#2056) - Report success to the approver if publishing is skipped by the
beforePublish
hook (#2056) - Update
postTxBalance
after all swap transactions (#2056) - Bump
@metamask/approval-controller
to ^5.0.0 (#2063) - Bump
@metamask/controller-utils
to ^6.0.0 (#2063) - Bump
@metamask/gas-fee-controller
to ^11.0.0 (#2063) - Bump
@metamask/network-controller
to ^17.0.0 (#2063)
- BREAKING: Add additional support swaps support (#1877)
- Swap transaction updates can be prevented by setting
disableSwaps
astrue
. If not set it will default tofalse
. - If
disableSwaps
isfalse
or not set, then thecreateSwapsTransaction
callback MUST be defined.
- Swap transaction updates can be prevented by setting
- Add optional hooks to support alternate flows (#1787)
- Add the
getAdditionalSignArguments
hook to provide additional arguments when signing. - Add the
beforeApproveOnInit
hook to execute additional logic before starting an approval flow for a transaction during initialization. Returnfalse
to skip the transaction. - Add the
afterSign
hook to execute additional logic after signing a transaction. Returnfalse
to not change thestatus
tosigned
. - Add the
beforePublish
hook to execute additional logic before publishing a transaction. Returnfalse
to prevent the transaction being submitted.
- Add the
- Add additional persisted transaction support during initialization and on network change (#1916)
- Initialise approvals for unapproved transactions on the current network.
- Add missing gas values for unapproved transactions on the current network.
- Submit any approved transactions on the current network.
- Support saved gas fees (#1966)
- Add optional
getSavedGasFees
callback to constructor.
- Add optional
- Add
updateCustodialTransaction
method to update custodial transactions (#2018) - Add
accessList
to txParam types (#2016) - Add
estimateGasBuffered
method to estimate gas and apply a specific buffer multiplier (#2021) - Add
updateSecurityAlertResponse
method (#1985) - Add gas values validation (#1978)
- Add
approveTransactionsWithSameNonce
method (#1961) - Add
clearUnapprovedTransactions
method (#1979) - Add
updatePreviousGasParams
method (#1943) - Emit additional events to support metrics in the clients (#1894)
- Populate the
firstRetryBlockNumber
,retryCount
, andwarning
properties in the transaction metadata. (#1896)
- BREAKING: Pending transactions are now automatically resubmitted. (#1896)
- This can be disabled by setting the new
pendingTransactions.isResubmitEnabled
constructor option tofalse
.
- This can be disabled by setting the new
- BREAKING: Bump dependency and peer dependency on
@metamask/network-controller
to ^16.0.0 - Persist specific error properties in core transaction metadata (#1915)
- Create
TransactionError
type with explicit properties.
- Create
- Align core transaction error messages with extension (#1980)
- Catch of the
initApprovals
method to skip logging when the error isuserRejectedRequest
.
- Catch of the
- Create an additional transaction metadata entry when calling
stopTransaction
(#1998) - Bump dependency
@metamask/eth-query
from ^3.0.1 to ^4.0.0 (#2028) - Bump dependency and peer dependency on
@metamask/gas-fee-controller
to ^10.0.1 - Bump @metamask/utils from 8.1.0 to 8.2.0 (#1957)
- BREAKING: Bump dependency and peer dependency on
@metamask/gas-fee-controller
to ^10.0.0 - Bump dependency and peer dependency on
@metamask/network-controller
to ^15.1.0
- BREAKING: Bump dependency and peer dependency on
@metamask/network-controller
to ^15.0.0 - Bump dependency on
@metamask/rpc-errors
to ^6.1.0 (#1653) - Bump dependency and peer dependency on
@metamask/approval-controller
to ^4.0.1
- BREAKING: Add required
getPermittedAccounts
argument to constructor, used to validatefrom
addresses (#1722) - Add
securityProviderRequest
option to constructor (#1725) - Add
method
option toaddTransaction
method (#1725) - Add
securityProviderRequest
property to TransactionMetaBase (#1725) - Add SecurityProviderRequest type (#1725)
- Update
addTransaction
to setsecurityProviderRequest
on transaction metadata when requested to do so (#1725) - Update
txParams
validation to validatechainId
(#1723) - Update
addTransaction
to ensure allowedfrom
address whenorigin
is specified (#1722)
- Bump dependency on
@metamask/utils
to ^8.1.0 (#1639) - Bump dependency and peer dependency on
@metamask/approval-controller
to ^4.0.0 - Bump dependency on
@metamask/base-controller
to ^3.2.3 - Bump dependency on
@metamask/controller-utils
to ^5.0.2 - Bump dependency and peer dependency on
@metamask/network-controller
to ^14.0.0
- BREAKING: Remove
interval
config option (#1746)- The block tracker (which has its own interval) is now used to poll for pending transactions instead.
- BREAKING: Remove
poll
method (#1746)- The block tracker is assumed to be running, TransactionController does not offer a way to stop it.
- BREAKING: Remove
queryTransactionStatuses
method (#1746)- This functionality has been moved to a private interface and there is no way to use it externally.
- BREAKING: Add required
getCurrentAccountEIP1559Compatibility
andgetCurrentNetworkEIP1559Compatibility
callback arguments to constructor (#1693) - Update
validateTxParams
to throw standardised errors using the@metamask/rpc-errors
package (#1690)- The dependency
eth-rpc-errors
has been replaced by@metamask/rpc-errors
- The dependency
- Preserve
type
transaction parameter for legacy transactions (#1713) - Update TypeScript to v4.8.x (#1718)
- BREAKING: Use only
chainId
to determine if a transaction belongs to the current network (#1633)- No longer uses
networkID
as a fallback ifchainId
is missing
- No longer uses
- BREAKING: Change
TransactionMeta.chainId
to be required (#1633) - BREAKING: Bump peer dependency on
@metamask/network-controller
to ^13.0.0 (#1633) - Update
TransactionMeta.networkID
as deprecated (#1633) - Change
TransactionMeta.networkID
to be readonly (#1633) - Bump dependency on
@metamask/controller-utils
to ^5.0.0 (#1633)
- Remove
networkId
param fromRemoteTransactionSource.isSupportedNetwork()
interface (#1633) - Remove
currentNetworkId
property fromRemoteTransactionSourceRequest
(#1633)
- Add
type
property to the transaction metadata (#1670)
- Add optional
getLastBlockVariations
method toRemoteTransactionSource
type (#1668) - Add
updateTransactionGasFees
method toTransactionController
(#1674) - Add
r
,s
andv
properties to the transaction metadata (#1664) - Add
sendFlowHistory
property to the transaction metadata (#1665) - Add
updateTransactionSendFlowHistory
method toTransactionController
(#1665) - Add
originalGasEstimate
property to the transaction metadata (#1656) - Add
incomingTransactions.queryEntireHistory
constructor option (#1652)
- BREAKING: Remove
apiKey
property fromRemoteTransactionSourceRequest
type (#1668) - BREAKING: Remove unused
FetchAllOptions
type fromTransactionController
(#1668) - BREAKING: Remove
incomingTransactions.apiKey
constructor option (#1668) - BREAKING: Rename the
transaction
object totxParams
in the transaction metadata (#1651) - BREAKING: Add
disableHistory
constructor option (#1657)- Defaults to
false
but will increase state size considerably unless disabled
- Defaults to
- BREAKING: Add
disableSendFlowHistory
constructor option (#1665)- Defaults to
false
but will increase state size considerably unless disabled
- Defaults to
- BREAKING: Rename the
transactionHash
property tohash
in the transaction metadata
- Fix the sorting of incoming and updated transactions (#1652)
- Prevent rate limit errors when
incomingTransactions.includeTokenTransfers
istrue
by by alternating Etherscan request types on each update (#1668)
- Add
submittedTime
to the transaction metadata (#1645) - Add optional
actionId
argument toaddTransaction
andspeedUpTransaction
to prevent duplicate requests (#1582) - Add
confirmExternalTransaction
method (#1625)
- BREAKING: Rename
rawTransaction
torawTx
in the transaction metadata (#1624)
- Persist
estimatedBaseFee
instopTransaction
andspeedUpTransaction
(#1621) - Add
securityAlertResponse
toaddTransaction
opts
argument (#1636)
- Add
blockTimestamp
toTransactionMetaBase
type (#1616) - Update
queryTransactionStatuses
to populateblockTimestamp
on each transaction when it is verified (#1616)
- Bump dependency and peer dependency on
@metamask/approval-controller
to ^3.5.1 - Bump dependency on
@metamask/base-controller
to ^3.2.1 - Bump dependency on
@metamask/controller-utils
to ^4.3.2 - Bump dependency and peer dependency on
@metamask/network-controller
to ^12.1.2
- Add
baseFeePerGas
to transaction metadata (#1590) - Add
txReceipt
to transaction metadata (#1592) - Add
initApprovals
method to generate approval requests from unapproved transactions (#1575) - Add
dappSuggestedGasFees
to transaction metadata (#1617) - Add optional
incomingTransactions
constructor arguments (#1579)apiKey
includeTokenTransfers
isEnabled
updateTransactions
- Add incoming transaction methods (#1579)
startIncomingTransactionPolling
stopIncomingTransactionPolling
updateIncomingTransactions
- Add
requireApproval
option toaddTransaction
method options (#1580) - Add
address
argument towipeTransactions
method (#1573)
- BREAKING: Add required
getSelectedAddress
callback argument to constructor (#1579) - BREAKING: Add
isSupportedNetwork
method toRemoteTransactionSource
interface (#1579) - BREAKING: Move all but first argument to options bag in
addTransaction
method (#1576) - BREAKING: Update properties of
RemoteTransactionSourceRequest
type (#1579)- The
fromBlock
property has changed fromstring
tonumber
- The
networkType
property has been removed - This type is intended mainly for internal use, so it's likely this change doesn't affect most projects
- The
- BREAKING: Remove
fetchAll
method (#1579)- This method was used to fetch transaction history from Etherscan
- This is now handled automatically by the controller on each new block, if polling is enabled
- Polling can be enabled or disabled by calling
startIncomingTransactionPolling
orstopIncomingTransactionPolling
respectively - An immediate update can be requested by calling
updateIncomingTransactions
- The new constructor parameter
incomingTransactions.isEnabled
acts as an override to disable this functionality based on a client preference for example
- BREAKING: Remove
prepareUnsignedEthTx
andgetCommonConfiguration
methods (#1581)- These methods were intended mainly for internal use, so it's likely this change doesn't affect most projects
- Replace
eth-query
^2.1.2 with@metamask/eth-query
^3.0.1 (#1546)
- BREAKING: Change
babel-runtime
from adependency
to apeerDependency
(#1504) - Update
@metamask/utils
to^6.2.0
(#1514)
- BREAKING: Change the approveTransaction and cancelTransaction methods to private (#1435)
- Consumers should migrate from use of these methods to use of
processApproval
.
- Consumers should migrate from use of these methods to use of
- Update the TransactionController to await the approval request promise before automatically performing the relevant logic, either signing and submitting the transaction, or cancelling it (#1435)
- Relax types of
provider
andblockTracker
options (#1443)- The types used to require proxy versions of Provider and BlockTracker. Now they just require the non-proxy versions, which are a strict subset of the proxied versions.
- Update transaction controller to automatically initiate, finalize, and cancel approval requests as transactions move through states (#1241)
- The
ApprovalController:addRequest
action will be called when a new transaction is initiated - The
ApprovalController:rejectRequest
action will be called if a transaction fails - The
ApprovalController:acceptRequest
action will be called when a transaction is approved
- The
- BREAKING: Bump to Node 16 (#1262)
- BREAKING: Update
@metamask/network-controller
dependency and peer dependency (#1367)- This affects the
getNetworkState
andonNetworkStateChange
constructor parameters
- This affects the
- BREAKING: Change format of chain ID in state to
Hex
(#1367)- The
chainId
property of theTransaction
type has been changed fromnumber
toHex
- The
chainId
property of theTransactionMeta
type has been changed from a decimalstring
toHex
, and thetransaction
property has been updated along with theTransaction
type (as described above). - The state property
transactions
is an array ofTransactionMeta
objects, so it has changed according to the description above.- This requires a state migration: each entry should have the
chainId
property converted from a decimalstring
toHex
, and thetransaction.chainId
property changed fromnumber
toHex
.
- This requires a state migration: each entry should have the
- The
addTransaction
andestimateGas
methods now expect the first parameter (transaction
) to use typeHex
for thechainId
property. - The
updateTransaction
method now expects thetransactionMeta
parameter to use typeHex
for thechainId
property (and for the nestedtransaction.chainId
property)
- The
- BREAKING: Add
messenger
as required constructor parameter (#1241) - BREAKING: Add
@metamask/approval-controller
as a dependency and peer dependency (#1241, #1393) - Add
@metamask/utils
dependency (#1367)
- Fix inaccurate hard-coded
chainId
on incoming token transactions (#1366)
- BREAKING: peerDeps: @metamask/[email protected]>8.0.0 (#1196)
- deps: [email protected]>4.0.2 (#1215)
- Add nonce tracker to transactions controller (#1147)
- Previously this controller would get the next nonce by calling
eth_getTransactionCount
with a block reference ofpending
. The next nonce would then be returned from our middleware (withinweb3-provider-engine
). - Instead we're now using the nonce tracker to get the next nonce, dropping our reliance on this
eth_getTransactionCount
middleware. This will let us drop that middleware in a future update without impacting the transaction controller. - This should result in no functional changes, except that the nonce middleware is no longer required.
- Previously this controller would get the next nonce by calling
- Use
NetworkType
enum for chain configuration (#1132)
- 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
- Add Etherscan API support for Sepolia and Goerli (#1041)
- Export
isEIP1559Transaction
function from package (#1058)
- BREAKING: Drop Etherscan API support for Ropsten, Rinkeby, and Kovan (#1041)
- Rename this repository to
core
(#1031) - Update
@metamask/controller-utils
package (#1041)
- BREAKING: Update
getNetworkState
constructor option to take an object withproviderConfig
property rather thanproviderConfig
(#995) - Relax dependency on
@metamask/base-controller
,@metamask/controller-utils
, and@metamask/network-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/transaction
- Transaction-related functions from
src/util.ts
and accompanying tests
All changes listed after this point were applied to this package following the monorepo conversion.
- Everything in
-