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.
- Add
estimateGasBatchfunction and messenger action to estimate gas for batch transactions (#7405)- Add optional
gasLimit7702property toTransactionBatchRequest.
- Add optional
- Automatically fail pending transactions if no receipt and hash not recognised by network after multiple attempts (#7329)
- Add optional
isTimeoutEnabledcallback to disable for specific transactions. - Ignores transactions with future nonce.
- Threshold determined by feature flag.
- Add optional
- Adding a new transaction meta property
requestId. It is supported for both simple and batched transactions (#7415)
- Throw with more specific error message if publish fails (#7418)
- Prevent
TransactionController:transactionApprovedevent firing if keyring throws during signing (#7410)
- Use gas fee properties from first transaction in EIP-7702 transactions (#7323)
- Bump
@metamask/remote-feature-flag-controllerfrom^2.0.1to^3.0.0(#7309
- Add
overwriteUpgradeoption toTransactionBatchRequestto allow overwriting existing EIP-7702 delegations (#7282)
- Bump
@metamask/network-controllerfrom^26.0.0to^27.0.0(#7258)
- Fail required transactions of any approved and signed transactions during initialisation (#7251)
- Include
isExternalSignwhen fetching gas fee tokens in messenger action or before publish check.
- Include
- Check balance and gas fee tokens only after before sign hook (#7234)
- Add
musdConversiontransaction type (#7218)
- Move peer dependencies for controller and service packages to direct dependencies (#7209)
- The dependencies moved are:
@metamask/accounts-controller(^35.0.0)@metamask/approval-controller(^8.0.0)@metamask/gas-fee-controller(^26.0.0)@metamask/network-controller(^26.0.0)@metamask/remote-feature-flag-controller(^2.0.1)
- In clients, it is now possible for multiple versions of these packages to exist in the dependency tree.
- For example, this scenario would be valid: a client relies on
@metamask/controller-a1.0.0 and@metamask/controller-b1.0.0, and@metamask/controller-bdepends on@metamask/controller-a1.1.0.
- For example, this scenario would be valid: a client relies on
- Note, however, that the versions specified in the client's
package.jsonalways "win", and you are expected to keep them up to date so as not to break controller and service intercommunication.
- The dependencies moved are:
- Performance optimisations in
addTransactionandaddTransactionBatchmethods (#7205)- Add
skipInitialGasEstimateoption toaddTransactionandaddTransactionBatchmethods. - Add
disableUpgradeoption toaddTransactionBatchmethod.
- Add
- Add
TransactionController:getGasFeeTokensmessenger action (#7197)- Add
TransactionControllerGetGasFeeTokensActionandGetGasFeeTokensRequesttypes.
- Add
- Bump
@metamask/controller-utilsfrom^11.15.0to^11.16.0(#7202) - BREAKING: Bump
@metamask/network-controllerfrom^25.0.0to^26.0.0(#7202) - BREAKING: Bump
@metamask/gas-fee-controllerfrom^25.0.0to^26.0.0(#7202) - BREAKING: Bump
@metamask/accounts-controllerfrom^34.0.0to^35.0.0(#7202)
- Always run
beforeSignhook even if usinggasFeeTokenandisGasFeeTokenIgnoredIfBalance(#7172)
- Add optional
gasFeeTokenproperty toaddTransactionandaddTransactionBatchmethods (#7123)- Also add optional
gasFeeTokenandisGasFeeTokenIgnoredIfBalanceproperties toTransactionMeta.
- Also add optional
- Calculate operator fee for OP stack networks and include it in
layer1GasFee(#6979) - Add support for
isGasFeeSponsoredfield in transaction batch and add transaction options (#7064)
- Prevent transactions marked as
droppedif nonce matches incoming transaction (#7097)
- Add optional
isIntentCompleteproperty toTransactionMetato indicate transaction outcome was achieved via an alternate chain or mechanism (#6950)
- Bump
@metamask/controller-utilsfrom^11.14.1to^11.15.0(#7003) - Identify OP stack chains using gas API (#6899)
- BREAKING: Use new
Messengerfrom@metamask/messenger(#6386)- Previously,
TransactionControlleraccepted aRestrictedMessengerinstance from@metamask/base-controller.
- Previously,
- BREAKING: Bump
@metamask/accounts-controllerfrom^33.0.0to^34.0.0(#6962) - BREAKING: Bump
@metamask/approval-controllerfrom^7.0.0to^8.0.0(#6962) - BREAKING: Bump
@metamask/gas-fee-controllerfrom^24.0.0to^25.0.0(#6962) - BREAKING: Bump
@metamask/network-controllerfrom^24.0.0to^25.0.0(#6962) - BREAKING: Bump
@metamask/remote-feature-flag-controllerfrom^1.5.0to^2.0.0(#6962) - Bump
@metamask/base-controllerfrom^8.4.2to^9.0.0(#6962) - Bump
@metamask/polling-controllerfrom^14.0.2to^15.0.0( #6962)
- Add actions
TransactionController:emulateNewTransactionandTransactionController:emulateTransactionUpdate(#6935)
- Bump
@metamask/base-controllerfrom^8.4.1to^8.4.2(#6917)
- Prevent race condition causing excessive incoming transaction polling (#6913)
- Add
predictWithdrawtoTransactionType(#6860)
- Convert existing transaction to EIP-7702 on publish if
batchTransactionsare set (#6844)- Add optional
newSignaturetoonPublishcallback inTransactionBatchSingleRequest.
- Add optional
- Add
MONADnetwork support (#6827)- Add account address relationship API support
- Add incoming transactions API support
- Bump
@metamask/eth-block-trackerfrom^13.0.0to^14.0.0(#6883) - Update dependencies that indirectly use v4 of
eth-json-rpc-provider(#6811)
- Add
txMetaproperty toGetSimulationConfigcallback (#6833)
- Bump
@metamask/base-controllerfrom^8.4.0to^8.4.1(#6807) - Bump
@metamask/controller-utilsfrom^11.14.0to^11.14.1(#6807)
- Expose
addTransactionandaddTransactionBatchmethods through the messenger (#6749)- Add types:
AddTransactionOptionsTransactionControllerAddTransactionActionTransactionControllerAddTransactionBatchAction
- Add types:
- Add new
shieldSubscriptionApprovetransaction type for shield subscription confirmation (#6769)
- Add
predictBuy,predictClaim,predictDepositandpredictSelltoTransactionType(#6690)
- Bump
@metamask/utilsfrom^11.8.0to^11.8.1(#6708)
- Update
isFirstTimeInteractionto be determined using recipient if token transfer. (#6686)
- Expose
confirmExternalTransaction,getNonceLock,getTransactions, andupdateTransactionactions through the messenger (#6615)- Like other action methods, they are callable as
TransactionController:* - Also add associated types:
TransactionControllerConfirmExternalTransactionActionTransactionControllerGetNonceLockActionTransactionControllerGetTransactionsActionTransactionControllerUpdateTransactionAction
- Like other action methods, they are callable as
- Bump
@metamask/controller-utilsfrom^11.12.0to^11.14.0(#6620, #6629) - Bump
@metamask/utilsfrom^11.4.2to^11.8.0(#6588) - Bump
@metamask/base-controllerfrom^8.3.0to^8.4.0(#6632)
- Add two new controller state metadata properties:
includeInStateLogsandusedInUi(#6473)
- Update nonce of existing transaction if converted to batch via
batchTransactionsbut not first transaction (#6528) - Bump
@metamask/base-controllerfrom^8.2.0to^8.3.0(#6465)
- Add
isGasFeeIncludedtoTransactionMeta,TransactionBatchRequestandaddTransactionoptions so the client can signal that MetaMask is compensated for the gas fee by the transaction (#6428) - Add optional
gasUsedproperty toTransactionMeta, returned by the transaction simulation result (#6410)
- Add optional
batchTransactionsOptionstoTransactionMeta(#6368)- Add optional
isAfterproperty tobatchTransactionsentries inTransactionMeta. - Add
BatchTransactiontype.
- Add optional
- Add optional
metamaskPayandrequiredTransactionIdsproperties toTransactionMeta(#6361)- Add
updateRequiredTransactionIdsmethod.
- Add
- Add
getSimulationConfigconstructor property (#6281)
- Bump
@metamask/base-controllerfrom^8.1.0to^8.2.0(#6355)
- Add
isGasFeeSponsoredproperty toTransactionMetatype (#6244)
- BREAKING: Bump peer dependency
@metamask/accounts-controllerfrom^32.0.0to^33.0.0(#6345) - Bump
@metamask/controller-utilsfrom^11.11.0to^11.12.0(#6303)
- Add optional
updateTypeproperty to disabletypeupdate inupdateEditableParamsmethod (#6289) - Add
perpsDeposittoTransactionType(#6282)
- Bump
@metamask/base-controllerfrom^8.0.1to^8.1.0(#6284)
- Add
assetsFiatValuesproperty onaddTransactionoptions (#6178)assetsFiatValues.sendingis total fiat value of sent assetsassetsFiatValues.receivingis total fiat value of recieved assets
- Add and export
AddTransactionOptionstype (#6178)
- Preserve provided
originintransactionswhen callingaddTransactionBatch(#6178)
- Add fallback to the sequential hook when
publishBatchHookreturns empty (#6063)
- BREAKING: Bump peer dependency
@metamask/accounts-controllerto^32.0.0(#6171)
- Preserve provided
typeintransactionswhen callingaddTransactionBatch(#6056) - Normalize transaction
datato ensure case-insensitive detection (#6102)
- Bump
@metamask/controller-utilsfrom^11.10.0to^11.11.0(#6069)- This upgrade includes performance improvements to checksum hex address normalization
- Bump
@metamask/utilsfrom^11.2.0to^11.4.2(#6054)
- Support
containerTypesproperty inupdateEditableParamsmethod (#6014) - Add specific transaction types to outgoing transactions retrieved from accounts API (#5987)
- Add optional
amountproperty totransferInformationobject inTransactionMetatype.
- Add optional
- Automatically update
gasFeeEstimatesin unapprovedtransactionBatches(#5950) - Estimate gas for type-4 transactions with
datausingeth_estimateGasand state overrides if simulation fails #6016) - Query only latest page of transactions from accounts API (#5983)
- Remove incoming transactions when calling
wipeTransactions(#5986) - Poll immediately when calling
startIncomingTransactionPolling(#5986)
- BREAKING: Bump peer dependency
@metamask/accounts-controllerto^31.0.0(#5999) - BREAKING: Bump peer dependency
@metamask/gas-fee-controllerto^24.0.0(#5999) - BREAKING: Bump peer dependency
@metamask/network-controllerto^24.0.0(#5999)
- Add optional
afterSimulateandbeforeSignhooks to constructor (#5503)- Add
AfterSimulateHooktype. - Add
BeforeSignHooktype. - Add
TransactionContainerTypeenum. - Add
TransactionControllerEstimateGasActiontype. - Add optional
containerTypesproperty toTransactionMeta. - Add optional
ignoreDelegationSignaturesboolean toestimateGasmethod.
- Add
- Add
gasFeeEstimatesproperty toTransactionBatchMeta, populated usingDefaultGasFeeFlow(#5886)
- Handle unknown chain IDs on incoming transactions (#5985)
- Add
SEInetwork support (#5694)- Add account address relationship API support
- Add incoming transactions API support
- Add
lendingWithdrawtoTransactionType(#5936)
- Bump
@metamask/controller-utilsto^11.10.0(#5935)
- Avoid coercing
publishBatchHookto a boolean (#5934)
- Add
gasproperty toTransactionBatchMeta, populated using simulation API (#5852)
- Include gas limit and gas fees in simulation requests (#5754)
- Add optional
feeproperty toGasFeeToken.
- Add optional
- Default addTransactionBatch to EIP7702 if supported, otherwise use sequential batch (#5853)
- BREAKING: bump
@metamask/accounts-controllerpeer dependency to^30.0.0(#5888)
- Include
originforwallet_sendCallsrequests to the security alerts API (#5876)- Extend
ValidateSecurityRequestwithoriginproperty. - Send
originviavalidateSecuritycallback.
- Extend
- Add optional approval request when calling
addTransactionBatch(#5793)- Add
transactionBatchesarray to state. - Add
TransactionBatchMetatype.
- Add
- Support leading zeroes in
authorizationListproperties (#5830)
- Add sequential batch support when
publishBatchHookis not defined (#5762)
- Fix
userFeeLevelasdappSuggestedinitially when dApp suggested gas values for legacy transactions (#5821) - Fix
addTransactionfunction to correctly identify a transaction as asimpleSendtype when the recipient is a smart account (#5822) - Fix gas fee randomisation with many decimal places (#5839)
- Automatically update gas fee properties in
txParamswhenupdateTransactionGasFeesmethod is called withuserFeeLevel(#5800) - Support additional debug of incoming transaction requests (#5803)
- Add optional
incomingTransactions.clientconstructor property. - Add optional
tagsproperty toupdateIncomingTransactionsmethod.
- Add optional
- Bump
@metamask/controller-utilsto^11.9.0(#5812)
- Throw correct error code if upgrade rejected (#5814)
- BREAKING: bump
@metamask/accounts-controllerpeer dependency to^29.0.0(#5802) - Configure incoming transaction polling interval using feature flag (#5792)
- Fix type-4 gas estimation (#5790)
- Bump
@metamask/controller-utilsto^11.8.0(#5765)
- Validate correct origin in EIP-7702 transaction (#5771)
- Set
userFeeLeveltomediuminstead ofdappSuggestedwhengasPriceis suggested (#5773)
- Add optional
isEIP7702GasFeeTokensEnabledconstructor callback (#5706) - Add
lendingDepositTransactionType(#5747)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency to^28.0.0(#5763)
- Bump
@metamask/network-controllerfrom^23.2.0to^23.3.0(#5729) - Remove validation of
fromiforiginis internal (#5707)
- Add optional
gasTransferproperty toGasFeeToken(#5681)
- Bump
@metamask/base-controllerfrom ^8.0.0 to ^8.0.1 (#5722)
- Add optional
afterAddhook to constructor (#5692)- Add optional
txParamsOriginalproperty toTransactionMeta. - Add
AfterAddHooktype.
- Add optional
- Handle errors in
isAtomicBatchSupportedmethod (#5704)
- Configure gas estimation buffers using feature flags (#5637)
- Update error codes for duplicate batch ID and batch size limit errors (#5635)
- Do not use fixed gas for type 4 transactions (#5646)
- Throw if
addTransactionBatchis called with any nested transaction withtomatching internal account and includingdata(#5635) - Fix incoming transaction support with
queryEntireHistoryset tofalse(#5582)
- Add
isExternalSignproperty toTransactionMetato disable nonce generation and signing (#5604) - Add types for
isAtomicBatchSupportedmethod (#5600)IsAtomicBatchSupportedRequestIsAtomicBatchSupportedResultIsAtomicBatchSupportedResultEntry
- BREAKING: Update signature of
isAtomicBatchSupportedmethod (#5600)- Replace
addressargument withrequestobject containingaddressand optionalchainIds. - Return array of
IsAtomicBatchSupportedResultEntryobjects.
- Replace
- Skip
originvalidation forbatchtransaction type (#5586)
- BREAKING:
enableTxParamsGasFeeUpdatesis renamed toisAutomaticGasFeeUpdateEnablednow expects a callback function instead of a boolean. (#5602)- This callback is invoked before performing
txParamsgas fee updates. The update will proceed only if the callback returns a truthy value. - If not set it will default to return
false.
- This callback is invoked before performing
- Add
gasPaymenttoTransactionTypeenum (#5584) - Add
TransactionControllerUpdateCustodialTransactionActionmessenger action (#5045)
- BREAKING: Return
PromisefrombeforePublishandbeforeCheckPendingTransactionhooks (#5045) - Support additional parameters in
updateCustodialTransactionmethod (#5045)gasLimitgasPricemaxFeePerGasmaxPriorityFeePerGasnoncetype
- Configure gas estimation fallback using remote feature flags (#5556)
- Throw if
chainIdinTransactionParamsdoes not matchnetworkClientIdwhen callingaddTransaction(#5511)- Mark
chainIdinTransactionParamsas deprecated.
- Mark
- Bump
@metamask/controller-utilsto^11.7.0(#5583)
- BREAKING: Remove
custodyIdandcustodyStatusproperties fromTransactionMeta(#5045)
- Adds
RandomisedEstimationsGasFeeFlowto gas fee flows inTransactionController(#5511)- Added flow only will be activated if chainId is defined in feature flags.
- Configure pending transaction polling intervals using remote feature flags (#5549)
- Fix EIP-7702 contract signature validation on chains with odd-length hexadecimal ID (#5563)
- Fix simulation of type-4 transactions (#5552)
- Display incoming transactions in active tab (#5487)
- Fix bug in
updateTransactionGasFeesaffectingtxParamsgas updates whenenableTxParamsGasFeeUpdatesis enabled. (#5539)
- Add
gasFeeTokenstoTransactionMeta(#5524)- Add
GasFeeTokentype. - Add
selectedGasFeeTokentoTransactionMeta. - Add
updateSelectedGasFeeTokenmethod.
- Add
- Support security validation of transaction batches (#5526)
- Add
ValidateSecurityRequesttype. - Add optional
securityAlertIdtoSecurityAlertResponse. - Add optional
securityAlertIdtoTransactionBatchRequest. - Add optional
validateSecuritycallback toTransactionBatchRequest.
- Add
- Support publish batch hook (#5401)
- Add
hooks.publishBatchoption to constructor. - Add
updateBatchTransactionsmethod. - Add
maxFeePerGasandmaxPriorityFeePerGastoupdateEditableParamsoptions. - Add types.
PublishBatchHookPublishBatchHookRequestPublishBatchHookResultPublishBatchHookTransactionPublishHookPublishHookResult
- Add optional properties to
TransactionMeta.batchTransactionsdisableGasBuffer
- Add optional properties to
BatchTransactionParams.gasmaxFeePerGasmaxPriorityFeePerGas
- Add optional
existingTransactionproperty toTransactionBatchSingleRequest. - Add optional
useHookproperty toTransactionBatchRequest.
- Add
- Add
enableTxParamsGasFeeUpdatesconstructor option (5394)- If not set it will default to
false. - Automatically update gas fee properties in
txParamswhen thegasFeeEstimatesare updated via polling.
- If not set it will default to
- Fix gas estimation for type 4 transactions (#5519)
- BREAKING: Remove
chainIdsargument from incoming transaction methods (#5436)startIncomingTransactionPollingstopIncomingTransactionPollingupdateIncomingTransactions
- BREAKING: Bump peer dependency
@metamask/accounts-controllerto^27.0.0(#5507) - BREAKING: Bump peer dependency
@metamask/gas-fee-controllerto^23.0.0(#5507) - BREAKING: Bump peer dependency
@metamask/network-controllerto^23.0.0(#5507)
- Add additional metadata for batch metrics (#5488)
- Add
delegationAddresstoTransactionMeta. - Add
NestedTransactionMetadatatype containingBatchTransactionParamsandtype. - Add optional
typetoTransactionBatchSingleRequest.
- Add
- Verify EIP-7702 contract address using signatures (#5472)
- Add optional
publicKeyEIP7702property to constructor. - Add dependency on
^5.7.0of@ethersproject/wallet.
- Add optional
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency to^26.1.0(#5481) - BREAKING: Add additional metadata for batch metrics (#5488)
- Change
errorinTransactionMetato optional for all statuses. - Change
nestedTransactionsinTransactionMetato array ofNestedTransactionMetadata.
- Change
- Throw if
addTransactionBatchcalled with external origin and size limit exceeded (#5489) - Verify EIP-7702 contract address using signatures (#5472)
- Use new
contractsproperty from feature flags instead ofcontractAddresses.
- Use new
- Add
revertDelegationtoTransactionType(#5468) - Add optional batch ID to metadata (#5462)
- Add optional
batchIdproperty toTransactionMeta. - Add optional
transactionHashtoTransactionReceipt. - Add optional
datatoLog. - Add optional
batchIdtoTransactionBatchRequest. - Add optional
batchIdtoaddTransactionoptions. - Throw if
batchIdalready exists on a transaction.
- Add optional
- BREAKING: Add optional batch ID to metadata (#5462)
- Change
batchIdinTransactionBatchResulttoHex. - Return
batchIdfromaddTransactionBatchif provided. - Generate random batch ID if no
batchIdprovided.
- Change
- Normalize gas limit using
gasandgasLimitproperties (#5396)
- Prevent external transactions to internal accounts if
dataincluded (#5418)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency to^26.0.0(#5439) - BREAKING: Bump
@ethereumjs/utilfrom^8.1.0to^9.1.0(#5347)
- Persist user rejection optional data in rejected error (#5355)
- Add
updateAtomicBatchDatamethod (#5380) - Support atomic batch transactions (#5306)
- Add methods:
addTransactionBatchisAtomicBatchSupported
- Add
batchtoTransactionType. - Add
nestedTransactionstoTransactionMeta. - Add new types:
BatchTransactionParamsTransactionBatchSingleRequestTransactionBatchRequestTransactionBatchResult
- Add dependency on
@metamask/remote-feature-flag-controller:^1.4.0.
- Add methods:
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency to^25.0.0(#5426) - BREAKING: Require messenger permissions for
KeyringController:signEip7702Authorizationaction (#5410) - BREAKING: Support atomic batch transactions (#5306)
- Require
AccountsController:getStateaction permission in messenger. - Require
RemoteFeatureFlagController:getStateaction permission in messenger.
- Require
- Bump
@metamask/utilsfrom^11.1.0to^11.2.0(#5301) - Throw if
addTransactionBatchis called with any nested transaction withtomatching internal account (#5369)
- Adds ability of re-simulating transaction depending on the
isActiveproperty ontransactionMeta(#5189)isActiveproperty is expected to set by client.- Re-simulation of transactions will occur every 3 seconds if
isActiveistrue.
- Adds
setTransactionActivefunction to update theisActiveproperty ontransactionMeta. (#5189)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^23.0.0to^24.0.0(#5318)
- Add support for EIP-7702 / type 4 transactions (#5285)
- Add
setCodetoTransactionEnvelopeType. - Add
authorizationListtoTransactionParams. - Export
AuthorizationandAuthorizationListtypes.
- Add
- The TransactionController messenger must now allow the
KeyringController:signAuthorizationaction (#5285) - Bump
@metamask/base-controllerfrom^7.1.1to^8.0.0(#5305) - Bump
ethereumjs/txfrom^4.2.0to^5.4.0(#5285) - Bump
ethereumjs/commonfrom^3.2.0to^4.5.0(#5285)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^22.0.0to^23.0.0(#5292)
- Rename
ControllerMessengertoMessenger(#5234) - Bump
@metamask/utilsfrom^11.0.1to^11.1.0(#5223)
- Prevent transaction resubmit on multiple endpoints (#5262)
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^21.0.0to^22.0.0(#5218)
- Add
gasLimitNoBufferproperty toTransactionMetatype (#5113)gasLimitNoBufferis the estimated gas for the transaction without any buffer applied.
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^20.0.0to^21.0.0(#5140) - Bump
@metamask/base-controllerfrom7.1.0to^7.1.1(#5135)
- Validate
gasandgasLimitare hexadecimal strings (#5093)
- Bump
@metamask/base-controllerfrom^7.0.0to^7.1.0(#5079) - Bump
@metamask/utilsto^11.0.1and@metamask/rpc-errorsto^7.0.2(#5080)
- Retrieve incoming transactions using Accounts API (#4927)
- Add
INCOMING_TRANSACTIONS_SUPPORTED_CHAIN_IDSconstant.
- Add
- BREAKING: Retrieve incoming transactions using Accounts API (#4927)
- Rename
TransactionControllerIncomingTransactionBlockReceivedEventtoTransactionControllerIncomingTransactionsReceivedEvent. - Replace
networkClientIdsargument withchainIdsin following methods:startIncomingTransactionPollingstopIncomingTransactionPollingupdateIncomingTransactions
- Rename
- Bump
@metamask/eth-block-trackerfrom^11.0.2to^11.0.3(#5025)
- BREAKING: Retrieve incoming transactions using Accounts API (#4927)
- Remove
ETHERSCAN_SUPPORTED_NETWORKSconstant. - Remove types:
EtherscanTransactionMetaRemoteTransactionSourceRemoteTransactionSourceRequest
- Remove
- Add optional
destinationChainIdproperty toTransactionMetato facilitate Bridge transactions (#4988)
- Bump
@metamask/controller-utilsfrom^11.4.3to^11.4.4(#5012)
- Make implicit peer dependencies explicit (#4974)
- Add the following packages as peer dependencies of this package to satisfy peer dependency requirements from other dependencies:
@babel/runtime^7.0.0(required by@metamask/ethjs-provider-http)@metamask/eth-block-tracker>=9(required by@metamask/nonce-tracker)
- These dependencies really should be present in projects that consume this package (e.g. MetaMask clients), and this change ensures that they now are.
- Furthermore, we are assuming that clients already use these dependencies, since otherwise it would be impossible to consume this package in its entirety or even create a working build. Hence, the addition of these peer dependencies is really a formality and should not be breaking.
- Add the following packages as peer dependencies of this package to satisfy peer dependency requirements from other dependencies:
- Correct ESM-compatible build so that imports of the following packages that re-export other modules via
export *are no longer corrupted: (#5011)@ethereumjs/common@ethereumjs/util@metamask/eth-querybn.jsfast-json-patchlodash
- BREAKING: Remove global network usage (#4920)
- Add required
networkClientIdargument tohandleMethodDatamethod.
- Add required
- BREAKING: Remove global network usage (#4920)
- Require
networkClientIdoption inaddTransactionmethod. - Require
networkClientIdproperty inTransactionMetatype. - Change
wipeTransactionsmethod arguments to optional object containingaddressandchainIdproperties. - Require
networkClientIdargument inestimateGas,estimateGasBufferedandgetNonceLockmethods.
- Require
- BREAKING: Remove global network usage (#4920)
- Remove the
blockTracker,isMultichainEnabled,onNetworkStateChangeandproviderconstructor options. - Remove
filterToCurrentNetworkoption fromgetTransactionsmethod.
- Remove the
- Add
firstTimeInteractionto transaction meta (#4895)- This is a boolean value that indicates whether the transaction is the first time the user has interacted with it.
- Add
isFirstTimeInteractionEnabledcallback constructor option (#4895)- This is a function that returns a boolean value indicating whether the first time interaction check should be enabled.
- BREAKING: Bump
@metamask/accounts-controllerpeer dependency from^19.0.0to^20.0.0(#4195)
- Temporarily increase the pending transaction polling rate when polling starts (#4917)
- Poll every 3 seconds up to ten times, then poll on each new block.
- BREAKING: Bump peer dependency
@metamask/accounts-controllerfrom^18.0.0to^19.0.0(#4915) - Bump
@metamask/controller-utilsfrom^11.4.2to^11.4.3(#4915)
- Validate gas fee properties to ensure they are valid hexadecimal strings (#4854)
- Fix gas limit estimation on new transactions and via
estimateGasandestimateGasBufferedmethods (#4897)
- Add staking transaction types (#4874)
stakingClaimstakingDepositstakingUnstake
- Bump
@metamask/controller-utilsfrom^11.4.1to^11.4.2(#4870) - Bump
@metamask/accounts-controllerfrom^18.2.2to^18.2.3(#4870) - Bump
@metamask/network-controllerfrom^22.0.0to^22.0.1(#4870)
- Automatically re-simulate transactions based on security criteria (#4792)
- If the security provider marks the transaction as malicious.
- If the simulated native balance change does not match the
value. - Set new
isUpdatedAfterSecurityCheckproperty totrueif the subsequent simulation response has changed.
- Bump
@metamask/eth-json-rpc-providerfrom^4.1.5to^4.1.6(#4862) - Bump
@metamask/approval-controllerfrom^7.1.0to^7.1.1(#4862) - Bump
@metamask/controller-utilsfrom^11.4.0to^11.4.1(#4862) - Bump
@metamask/base-controllerfrom7.0.1to^7.0.2(#4862)
- BREAKING: Bump
@metamask/gas-fee-controllerpeer dependency from^20.0.0to^21.0.0(#4810) - BREAKING: Bump
@metamask/network-controllerpeer dependency from^21.0.0to^22.0.0(#4841) - Bump
@metamask/controller-utilsto^11.4.0(#4834) - Bump
@metamask/rpc-errorsto^7.0.1(#4831) - Bump
@metamask/utilsto^10.0.0(#4831)
- Add types for bridge transactions (#4714)
- Reduce gas limit fallback from 95% to 35% of the block gas limit on failed gas limit estimations (#4739)
- Use contract ABIs to decode the token balance responses (#4775)
- Add optional
incomingTransactions.etherscanApiKeysByChainIdconstructor property to support API keys in requests to Etherscan (#4748)
- Cleanup transactions only during initialisation (#4753)
- Remove
gasPricefrom requests tolinea_estimateGas(#4737)
- Populate
submitHistoryin state when submitting transactions to network (#4706) - Export
CHAIN_IDS,ETHERSCAN_SUPPORTED_NETWORKSandSPEED_UP_RATEconstants (#4706)
- Make
getPermittedAccountsconstructor callback optional (#4706) - Bump accounts related packages (#4713), (#4728)
- Those packages are now built slightly differently and are part of the accounts monorepo.
- Bump
@metamask/keyring-apifrom^8.1.0to^8.1.4
- Remove unapproved transactions during initialisation (#4658)
- Fail approved and signed transactions during initialisation (#4658)
- Remove
TraceContext,TraceRequest, andTraceCallbacktypes (#4655)- These were moved to
@metamask/controller-utils.
- These were moved to
- 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
exportsfield inpackage.jsonlinked 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 missing
TransactionControllerOptionstype in package-level export (#4683)
- BREAKING: Bump devDependency and peerDependency
@metamask/network-controllerfrom^20.0.0to^21.0.0(#4651) - BREAKING: Bump devDependency and peerDependency
@metamask/gas-fee-controllerfrom^19.0.0to^20.0.0( #4651) - Bump
@metamask/base-controllerfrom^6.0.3to^7.0.0(#4643) - Bump
@metamask/controller-utilsfrom^11.0.2to^11.2.0(#4639, #4651)
- Add tracing infrastructure (#4575)
- Add optional
tracecallback to constructor. - Add optional
traceContextoption toaddTransactionmethod. - Add initial tracing of transaction lifecycle.
- Add optional
- Bump
@metamask/base-controllerfrom^6.0.2to^6.0.3(#4625) - Bump
@metamask/network-controllerfrom^20.1.0to^20.2.0(#4618) - Bump
@metamask/eth-json-rpc-providerfrom^4.1.2to^4.1.3(#4607)
- Remove validation of
gasValuespassed tospeedUpTransactionandstopTransactionmethods (#4617)
- Fix gaps in transaction validation and async error logging (#4596)
- Upgrade
@metamask/nonce-trackerfrom v5 to v6 (#4591)
- Add
DISPLAYED_TRANSACTION_HISTORY_PATHSconstant, 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_LENGTHconstant, representing the expected maximum size of thehistoryproperty 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-controllerfrom^17.0.0to^18.0.0(#4548) - Remove
@metamask/accounts-controller,@metamask/approval-controller,@metamask/gas-fee-controller, and@metamask/network-controllerdependencies #4556- These were listed under
peerDependenciesalready, so they were redundant as dependencies.
- These were listed under
- Upgrade TypeScript version to
~5.0.4and setmoduleResolutionoption toNode16(#3645) - Bump
@metamask/base-controllerfrom^6.0.0to^6.0.2(#4517, #4544) - Bump
@metamask/controller-utilsfrom^11.0.0to^11.0.2(#4517, #4544) - Bump
@metamask/rpc-errorsfrom^6.2.1to^6.3.1(#4516) - Bump
@metamask/utilsfrom^8.3.0to^9.1.0(#4516, #4529)
- Fix simulation data parsing logic to avoid failed simulations creating
ApprovalForAllevents (#4512)
- BREAKING: Bump peerDependency
@metamask/network-controllerto^20.0.0(#4508) - BREAKING: Bump peerDependency
@metamask/gas-fee-controllerto^19.0.0(#4508)
- BREAKING: Bump dependency and peer dependency
@metamask/gas-fee-controllerto^18.0.0(#4498) - Bump dependency
@metamask/accounts-controllerto^17.2.0(#4498)
- BREAKING: The
TransactionControllermessenger must now allow theAccountsController:getSelectedAccountaction (#4244) - BREAKING:
getCurrentAccountreturns anInternalAccountinstead of astringin theIncomingTransactionHelper(#4244) - BREAKING: Bump dependency and peer dependency
@metamask/accounts-controllerto^17.0.0(#4413) - Bump
@metamask/eth-snap-keyringto^4.3.1(#4405) - Bump
@metamask/keyring-apito^8.0.0(#4405)
- BREAKING: Remove
getSelectedAddressoption fromTransactionController(#4244)- The AccountsController is used to get the currently selected address automatically.
MultichainTrackingHelper.getEthQuerynow returns globalethQuerywith (#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-controllerto^7.0.0(#4352) - BREAKING: Bump dependency and peer dependency
@metamask/gas-fee-controllerto^17.0.0(#4352) - BREAKING: Bump dependency and peer dependency
@metamask/network-controllerto^19.0.0(#4352) - Bump
@metamask/base-controllerto^6.0.0(#4352) - Bump
@metamask/controller-utilsto^11.0.0(#4352)
- BREAKING: Bump dependency and peer dependency
@metamask/approval-controllerto^6.0.2(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/gas-fee-controllerto^16.0.0(#4342) - BREAKING: Bump dependency and peer dependency
@metamask/network-controllerto^18.1.3(#4342) - Bump
async-mutexto^0.5.0(#4335) - Bump
@metamask/controller-utilsto^10.0.0(#4342)
- BREAKING: Remove
signfromTransactionType(#4319)- This represented an
eth_signtransaction, but support for that RPC method is being removed, so this is no longer needed.
- This represented an
- Pass an unfrozen transaction to the
afterSignhook so that it is able to modify the transaction (#4343)
- BREAKING: Update from
nonce-tracker@^3.0.0to@metamask/nonce-tracker@^5.0.0to mitigate issue with redundant polling loops in block tracker. (#4309)- The constructor now expects the
blockTrackeroption being an instance of@metamask/eth-block-trackerinstead 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-controllerto^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
estimateGasFeemethod (#4216)- Add
TestGasFeeFlowthat is activated by optionaltestGasFeeFlowsconstructor option. - Add related types:
FeeMarketGasFeeEstimateForLevelFeeMarketGasFeeEstimatesGasFeeEstimatesGasFeeEstimateLevelGasFeeEstimateTypeGasPriceGasFeeEstimatesLegacyGasFeeEstimates
- Add
- BREAKING: Update
GasFeeEstimatestype to support alternate estimate types (#4216) - Bump
@metamask/base-controllerto^5.0.2(#4232) - Bump
@metamask/approval-controllerto^6.0.2(#4234) - Bump
@metamask/gas-fee-controllerto^15.1.1(#4234)
- BREAKING: Remove
gasFeeControllerEstimateTypeproperty frommergeGasFeeEstimatesfunction (#4216)
- Bump
@metamask/gas-fee-controllerto ^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
getLayer1GasFeearguments 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.isResubmitEnabledfrom optionalbooleanto optional callback (#4113)
- Check pending transactions on startup (#4113)
- Run
OptimismLayer1GasFeeFlowon Optimism stack based transactions in order to addlayer1GasFeeproperty to transaction meta. (#4055) - Add
getLayer1GasFeemethod toTransactionControllerto get the layer 1 gas fee for the given transaction params (#4055) - Add
SimulationErrorCodeenum (#4106)
- BREAKING: Bump peer dependency
@metamask/gas-fee-controllerto^15.0.0(#4121) - Update
addTransactionto skip simulation ifrequireApprovalis specified asfalse(#4106) - Provide simulation error code in locally generated errors (under the
codeproperty) (#4106) - Add dependency
@ethersproject/contracts^5.7.0(#4055) - Add dependency
@ethersproject/providers^5.7.0(#4055) - Bump dependency
@metamask/network-controllerto^18.1.0(#4121)
- BREAKING: Remove
isRevertedproperty fromSimulationErrortype. (#4106)
- Add support for transactions with type
increaseAllowance(#4069)- Also add "increaseAllowance" to
TransactionTypeundertokenMethodIncreaseAllowance
- Also add "increaseAllowance" to
- Bump
@metamask/metamask-eth-abisto^3.1.1(#4069)
- Provide updated transaction metadata to publish hook (#4101)
- Bump
TypeScriptversion to~4.9.5(#4084)
- Emit finished event for custodial transactions when updating status to
submittedorfailed(#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
Layer1GasFeeFlowsand addlayer1GasFeeproperty toTransactionMeta(#3944)
- Fix
typesfield inpackage.json(#4047)
- BREAKING: Add ESM build (#3998)
- It's no longer possible to import files from
./distdirectly.
- It's no longer possible to import files from
- Add new types for TransactionController messenger actions (#3827)
TransactionControllerActionsTransactionControllerGetStateAction
- Add new types for TransactionController messenger events (#3827)
TransactionControllerEventsTransactionControllerIncomingTransactionBlockReceivedEventTransactionControllerPostTransactionBalanceUpdatedEventTransactionControllerSpeedupTransactionAddedEventTransactionControllerStateChangeEventTransactionControllerTransactionApprovedEventTransactionControllerTransactionConfirmedEventTransactionControllerTransactionDroppedEventTransactionControllerTransactionFailedEventTransactionControllerTransactionFinishedEventTransactionControllerTransactionNewSwapApprovalEventTransactionControllerTransactionNewSwapEventTransactionControllerTransactionPublishingSkippedTransactionControllerTransactionRejectedEventTransactionControllerTransactionStatusUpdatedEventTransactionControllerTransactionSubmittedEventTransactionControllerUnapprovedTransactionAddedEvent
- Add optional
simulationDataproperty toTransactionMetawhich will be automatically populated (#4020) - Add optional
isSimulationEnabledconstructor 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
txHistoryLimitoption totransactionHistoryLimit(#3827) - BREAKING: Switch some type definitions from
interfacetotype(#3827)- These types are affected:
DappSuggestedGasFeesLogMethodDataTransactionControllerState(formerlyTransactionState)TransactionParamsTransactionReceipt
- This is a breaking change because type aliases have different behavior from interfaces. Specifically, the
Jsontype in@metamask/utils, which BaseController v2 controller state must conform to, is not compatible with interfaces.
- These types are affected:
- BREAKING: Align
parsedRegistryMethodinMethodDatatype 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
TransactionStatetoTransactionControllerState(#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:incomingTransactionBlockReceivedTransactionController:postTransactionBalanceUpdatedTransactionController:speedUpTransactionAddedTransactionController:transactionApprovedTransactionController:transactionConfirmedTransactionController:transactionDroppedTransactionController:transactionFinishedTransactionController:transactionFinishedTransactionController:transactionPublishingSkippedTransactionController:transactionRejectedTransactionController:transactionStatusUpdatedTransactionController:transactionSubmittedTransactionController:unapprovedTransactionAdded
- The restricted messenger must allow the following events:
- BREAKING: Update
TransactionMetatype to be compatible withJson(#3827)- As dictated by BaseController v2, any types that are part of state need to be compatible with the
Jsontype from@metamask/utils.
- As dictated by BaseController v2, any types that are part of state need to be compatible with the
- BREAKING: Transform
rpcproperty on transaction errors so they're JSON-encodable (#3827)- This change also results in typing this property as
Jsoninstead ofunknown, avoiding a "Type instantiation is excessively deep and possibly infinite" error when resolving theTransactionControllerStatetype.
- This change also results in typing this property as
- BREAKING: Bump dependency and peer dependency on
@metamask/approval-controllerto^6.0.0(#4039) - BREAKING: Bump dependency and peer dependency on
@metamask/gas-fee-controllerto^14.0.0(#4039) - BREAKING: Bump dependency and peer dependency on
@metamask/network-controllerto^18.0.0(#4039) - BREAKING: Bump
@metamask/base-controllerto^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-utilsto^9.0.0(#4039)
- BREAKING: Remove
TransactionConfigtype (#3827)- The properties in this type have been absorbed into
TransactionControllerOptions.
- The properties in this type have been absorbed into
- BREAKING: Remove
hubproperty 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:incomingTransactionBlockReceivedpost-transaction-balance-updated->TransactionController:postTransactionBalanceUpdatedtransaction-approved->TransactionController:transactionApprovedtransaction-confirmed->TransactionController:transactionConfirmedtransaction-dropped->TransactionController:transactionDroppedtransaction-finished->TransactionController:transactionFinishedtransaction-rejected->TransactionController:transactionRejectedtransaction-status-update->TransactionController:transactionStatusUpdatedtransaction-submitted->TransactionController:transactionSubmittedunapprovedTransaction->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)addTransactionconfirmExternalTransactionspeedUpTransactionupdateCustodialTransactionupdateSecurityAlertResponseupdateTransaction
- Fix
handleMethodDatamethod to update state with an empty registry object instead of blowing up if registry could be found (#3827)
- Add
normalizeTransactionParamsmethod (#3990)
- BREAKING: Remove support for retrieving transactions via Etherscan for Optimism Goerli; add support for Optimism Sepolia instead (#3999)
- Normalize
dataproperty into an even length hex string (#3990) - Bump
@metamask/approval-controllerto^5.1.3(#4007) - Bump
@metamask/controller-utilsto^8.0.4(#4007) - Bump
@metamask/gas-fee-controllerto^13.0.2(#4007) - Bump
@metamask/network-controllerto^17.2.1(#4007)
- Add
gasFeeEstimatesLoadedproperty toTransactionMeta(#3948) - Add
gasFeeEstimatesproperty toTransactionMetato be automatically populated on unapproved transactions (#3913)
- Use the
linea_estimateGasRPC method to provide transaction specific gas fee estimates on Linea networks (#3913)
- BREAKING: Constructor now expects a
getNetworkClientRegistrycallback function (#3643) - BREAKING: Messenger now requires
NetworkController:stateChangeto be an allowed event (#3643) - BREAKING: Messenger now requires
NetworkController:findNetworkClientByChainIdandNetworkController:getNetworkClientByIdactions (#3643) - Adds a feature flag parameter
isMultichainEnabledpassed 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
isMultichainEnabledfeature flag on, also stops polling Etherscan for transaction updates relevant to each currently polled networkClientId. (#3643)
- When called with the
- Exports
PendingTransactionOptionstype (#3643) - Exports
TransactionControllerOptionstype (#3643)
- BREAKING:
approveTransactionsWithSameNonce()now requireschainIdto be populated in for each TransactionParams that is passed (#3643) addTransaction()now accepts optionalnetworkClientIdin its options param which specifies the network client that the transaction will be processed with during its lifecycle if theisMultichainEnabledfeature flag is on (#3643)- when called with the
isMultichainEnabledfeature 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
isMultichainEnabledfeature 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
isMultichainEnabledfeature 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
isMultichainEnabledfeature 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
isMultichainEnabledfeature 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)TransactionMetatype now specifies an optionalnetworkClientIdfield (#3643)startIncomingTransactionPolling()now accepts an optional array ofnetworkClientIds. (#3643)- When
networkClientIdsis provided and theisMultichainEnabledfeature flag is on, the controller will start polling Etherscan for transaction updates relevant to the networkClientIds. - When
networkClientIdsis provided and theisMultichainEnabledfeature flag is off, nothing will happen. - If
networkClientIdsis 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
networkClientIdsis provided and theisMultichainEnabledfeature flag is on, the controller will stop polling Ethercsan for transaction updates relevant to the networkClientIds. - When
networkClientIdsis provided and theisMultichainEnabledfeature flag is off, nothing will happen. - If
networkClientIdsis 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-registryfrom^3.0.0to^4.0.0(#3897) - Bump
@metamask/controller-utilsto^8.0.3(#3915) - Bump
@metamask/gas-fee-controllerto^13.0.1(#3915)
- BREAKING: Remove
cancelMultiplierandspeedUpMultiplierconstructor options as both values are now fixed at1.1. (#3909)
- Remove implicit peerDependency on
babel-runtime(#3897)
- Add optional
publishhook to support custom logic instead of submission to the RPC provider (#3883) - Add
hasNonceoption toapproveTransactionsWithSameNoncemethod (#3883)
- Add
abortTransactionSigningmethod (#3870)
- Resolves transaction custodian promise when setting transaction status to
submittedorfailed(#3845) - Fix normalizer ensuring property
typeis always present inTransactionParams(#3817)
- BREAKING: Bump
@metamask/approval-controllerpeer dependency to^5.1.2(#3821) - BREAKING: Bump
@metamask/gas-fee-controllerpeer dependency to^13.0.0(#3821) - BREAKING: Bump
@metamask/network-controllerpeer dependency to^17.2.0(#3821) - Bump
@metamask/base-controllerto^4.1.1(#3821) - Bump
@metamask/controller-utilsto^8.0.2(#3821)
- BREAKING: Change type of
destinationTokenDecimalsproperty inTransactionMetatonumber(#3749)
- Handle missing current account in incoming transactions (#3741)
- Bump
eth-method-registryfrom^1.1.0to^3.0.0(#3688)
- BREAKING: Bump
@metamask/approval-controllerdependency and peer dependency from^5.1.0to^5.1.1(#3695) - BREAKING: Bump
@metamask/gas-fee-controllerdependency and peer dependency from^11.0.0to^12.0.0(#3695) - BREAKING: Bump
@metamask/network-controllerdependency and peer dependency from^17.0.0to^17.1.0(#3695) - Bump
@metamask/base-controllerto^4.0.1(#3695) - Bump
@metamask/controller-utilsto^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
droppedstatus detection by ignoring transactions on other chains. - Start polling if network changes and associated transactions are pending.
- Record
r,s, andvvalues even if zero. - Only fail transactions if receipt
statusis explicitly0x0.
- Fix
- Fix incoming transactions on Linea Goerli (#3674)
- Add optional
getExternalPendingTransactionscallback argument to constructor (#3587)
- Add the
customNonceValueproperty to the transaction metadata (#3579)
- Update transaction metadata after approval if the approval result includes the
value.txMetaproperty (#3579) - Add
typeproperty to all incoming transactions (#3579)
- Add
cancelMultiplierandspeedUpMultiplierconstructor arguments to optionally override the default multipliers of1.5and1.1respectively (#2678)
- Populate the
preTxBalanceproperty before publishing transactions with theswaptype (#2678) - Change the status of transactions with matching nonces to
droppedwhen confirming a transaction (#2678)
- Add
updateEditableParamsmethod (#2056) - Add
initApprovalsmethod to trigger the approval flow for any pending transactions during initialisation (#2056) - Add
getTransactionsmethod to search transactions using the given criteria and options (#2056)
- BREAKING: Bump
@metamask/base-controllerto ^4.0.0 (#2063)- This is breaking because the type of the
messengerhas backward-incompatible changes. See the changelog for this package for more.
- This is breaking because the type of the
- BREAKING: Add
finishedandpublish-skipevents toEventstype - BREAKING: Update
TransactionReceipttype sotransactionIndexis now a string rather than a number (#2063) - Bump
nonce-trackerto ^3.0.0 (#2040) - The controller now emits a
transaction-status-updateevent each time the status of a transaction changes (e.g. submitted, rejected, etc.) (#2027) - Make
getCurrentAccountEIP1559Compatibilityconstructor parameter optional (#2056) - Normalize the gas values provided to the
speedUpTransactionandstopTransactionmethods (#2056) - Persist any property changes performed by the
afterSignhook (#2056) - Report success to the approver if publishing is skipped by the
beforePublishhook (#2056) - Update
postTxBalanceafter all swap transactions (#2056) - Bump
@metamask/approval-controllerto ^5.0.0 (#2063) - Bump
@metamask/controller-utilsto ^6.0.0 (#2063) - Bump
@metamask/gas-fee-controllerto ^11.0.0 (#2063) - Bump
@metamask/network-controllerto ^17.0.0 (#2063)
- BREAKING: Add additional support swaps support (#1877)
- Swap transaction updates can be prevented by setting
disableSwapsastrue. If not set it will default tofalse. - If
disableSwapsisfalseor not set, then thecreateSwapsTransactioncallback MUST be defined.
- Swap transaction updates can be prevented by setting
- Add optional hooks to support alternate flows (#1787)
- Add the
getAdditionalSignArgumentshook to provide additional arguments when signing. - Add the
beforeApproveOnInithook to execute additional logic before starting an approval flow for a transaction during initialization. Returnfalseto skip the transaction. - Add the
afterSignhook to execute additional logic after signing a transaction. Returnfalseto not change thestatustosigned. - Add the
beforePublishhook to execute additional logic before publishing a transaction. Returnfalseto 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
getSavedGasFeescallback to constructor.
- Add optional
- Add
updateCustodialTransactionmethod to update custodial transactions (#2018) - Add
accessListto txParam types (#2016) - Add
estimateGasBufferedmethod to estimate gas and apply a specific buffer multiplier (#2021) - Add
updateSecurityAlertResponsemethod (#1985) - Add gas values validation (#1978)
- Add
approveTransactionsWithSameNoncemethod (#1961) - Add
clearUnapprovedTransactionsmethod (#1979) - Add
updatePreviousGasParamsmethod (#1943) - Emit additional events to support metrics in the clients (#1894)
- Populate the
firstRetryBlockNumber,retryCount, andwarningproperties in the transaction metadata. (#1896)
- BREAKING: Pending transactions are now automatically resubmitted. (#1896)
- This can be disabled by setting the new
pendingTransactions.isResubmitEnabledconstructor option tofalse.
- This can be disabled by setting the new
- BREAKING: Bump dependency and peer dependency on
@metamask/network-controllerto ^16.0.0 - Persist specific error properties in core transaction metadata (#1915)
- Create
TransactionErrortype with explicit properties.
- Create
- Align core transaction error messages with extension (#1980)
- Catch of the
initApprovalsmethod to skip logging when the error isuserRejectedRequest.
- Catch of the
- Create an additional transaction metadata entry when calling
stopTransaction(#1998) - Bump dependency
@metamask/eth-queryfrom ^3.0.1 to ^4.0.0 (#2028) - Bump dependency and peer dependency on
@metamask/gas-fee-controllerto ^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-controllerto ^10.0.0 - Bump dependency and peer dependency on
@metamask/network-controllerto ^15.1.0
- BREAKING: Bump dependency and peer dependency on
@metamask/network-controllerto ^15.0.0 - Bump dependency on
@metamask/rpc-errorsto ^6.1.0 (#1653) - Bump dependency and peer dependency on
@metamask/approval-controllerto ^4.0.1
- BREAKING: Add required
getPermittedAccountsargument to constructor, used to validatefromaddresses (#1722) - Add
securityProviderRequestoption to constructor (#1725) - Add
methodoption toaddTransactionmethod (#1725) - Add
securityProviderRequestproperty to TransactionMetaBase (#1725) - Add SecurityProviderRequest type (#1725)
- Update
addTransactionto setsecurityProviderRequeston transaction metadata when requested to do so (#1725) - Update
txParamsvalidation to validatechainId(#1723) - Update
addTransactionto ensure allowedfromaddress whenoriginis specified (#1722)
- Bump dependency on
@metamask/utilsto ^8.1.0 (#1639) - Bump dependency and peer dependency on
@metamask/approval-controllerto ^4.0.0 - Bump dependency on
@metamask/base-controllerto ^3.2.3 - Bump dependency on
@metamask/controller-utilsto ^5.0.2 - Bump dependency and peer dependency on
@metamask/network-controllerto ^14.0.0
- BREAKING: Remove
intervalconfig option (#1746)- The block tracker (which has its own interval) is now used to poll for pending transactions instead.
- BREAKING: Remove
pollmethod (#1746)- The block tracker is assumed to be running, TransactionController does not offer a way to stop it.
- BREAKING: Remove
queryTransactionStatusesmethod (#1746)- This functionality has been moved to a private interface and there is no way to use it externally.
- BREAKING: Add required
getCurrentAccountEIP1559CompatibilityandgetCurrentNetworkEIP1559Compatibilitycallback arguments to constructor (#1693) - Update
validateTxParamsto throw standardised errors using the@metamask/rpc-errorspackage (#1690)- The dependency
eth-rpc-errorshas been replaced by@metamask/rpc-errors
- The dependency
- Preserve
typetransaction parameter for legacy transactions (#1713) - Update TypeScript to v4.8.x (#1718)
- BREAKING: Use only
chainIdto determine if a transaction belongs to the current network (#1633)- No longer uses
networkIDas a fallback ifchainIdis missing
- No longer uses
- BREAKING: Change
TransactionMeta.chainIdto be required (#1633) - BREAKING: Bump peer dependency on
@metamask/network-controllerto ^13.0.0 (#1633) - Update
TransactionMeta.networkIDas deprecated (#1633) - Change
TransactionMeta.networkIDto be readonly (#1633) - Bump dependency on
@metamask/controller-utilsto ^5.0.0 (#1633)
- Remove
networkIdparam fromRemoteTransactionSource.isSupportedNetwork()interface (#1633) - Remove
currentNetworkIdproperty fromRemoteTransactionSourceRequest(#1633)
- Add
typeproperty to the transaction metadata (#1670)
- Add optional
getLastBlockVariationsmethod toRemoteTransactionSourcetype (#1668) - Add
updateTransactionGasFeesmethod toTransactionController(#1674) - Add
r,sandvproperties to the transaction metadata (#1664) - Add
sendFlowHistoryproperty to the transaction metadata (#1665) - Add
updateTransactionSendFlowHistorymethod toTransactionController(#1665) - Add
originalGasEstimateproperty to the transaction metadata (#1656) - Add
incomingTransactions.queryEntireHistoryconstructor option (#1652)
- BREAKING: Remove
apiKeyproperty fromRemoteTransactionSourceRequesttype (#1668) - BREAKING: Remove unused
FetchAllOptionstype fromTransactionController(#1668) - BREAKING: Remove
incomingTransactions.apiKeyconstructor option (#1668) - BREAKING: Rename the
transactionobject totxParamsin the transaction metadata (#1651) - BREAKING: Add
disableHistoryconstructor option (#1657)- Defaults to
falsebut will increase state size considerably unless disabled
- Defaults to
- BREAKING: Add
disableSendFlowHistoryconstructor option (#1665)- Defaults to
falsebut will increase state size considerably unless disabled
- Defaults to
- BREAKING: Rename the
transactionHashproperty tohashin the transaction metadata
- Fix the sorting of incoming and updated transactions (#1652)
- Prevent rate limit errors when
incomingTransactions.includeTokenTransfersistrueby by alternating Etherscan request types on each update (#1668)
- Add
submittedTimeto the transaction metadata (#1645) - Add optional
actionIdargument toaddTransactionandspeedUpTransactionto prevent duplicate requests (#1582) - Add
confirmExternalTransactionmethod (#1625)
- BREAKING: Rename
rawTransactiontorawTxin the transaction metadata (#1624)
- Persist
estimatedBaseFeeinstopTransactionandspeedUpTransaction(#1621) - Add
securityAlertResponsetoaddTransactionoptsargument (#1636)
- Add
blockTimestamptoTransactionMetaBasetype (#1616) - Update
queryTransactionStatusesto populateblockTimestampon each transaction when it is verified (#1616)
- Bump dependency and peer dependency on
@metamask/approval-controllerto ^3.5.1 - Bump dependency on
@metamask/base-controllerto ^3.2.1 - Bump dependency on
@metamask/controller-utilsto ^4.3.2 - Bump dependency and peer dependency on
@metamask/network-controllerto ^12.1.2
- Add
baseFeePerGasto transaction metadata (#1590) - Add
txReceiptto transaction metadata (#1592) - Add
initApprovalsmethod to generate approval requests from unapproved transactions (#1575) - Add
dappSuggestedGasFeesto transaction metadata (#1617) - Add optional
incomingTransactionsconstructor arguments (#1579)apiKeyincludeTokenTransfersisEnabledupdateTransactions
- Add incoming transaction methods (#1579)
startIncomingTransactionPollingstopIncomingTransactionPollingupdateIncomingTransactions
- Add
requireApprovaloption toaddTransactionmethod options (#1580) - Add
addressargument towipeTransactionsmethod (#1573)
- BREAKING: Add required
getSelectedAddresscallback argument to constructor (#1579) - BREAKING: Add
isSupportedNetworkmethod toRemoteTransactionSourceinterface (#1579) - BREAKING: Move all but first argument to options bag in
addTransactionmethod (#1576) - BREAKING: Update properties of
RemoteTransactionSourceRequesttype (#1579)- The
fromBlockproperty has changed fromstringtonumber - The
networkTypeproperty 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
fetchAllmethod (#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
startIncomingTransactionPollingorstopIncomingTransactionPollingrespectively - An immediate update can be requested by calling
updateIncomingTransactions - The new constructor parameter
incomingTransactions.isEnabledacts as an override to disable this functionality based on a client preference for example
- BREAKING: Remove
prepareUnsignedEthTxandgetCommonConfigurationmethods (#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-runtimefrom adependencyto apeerDependency(#1504) - Update
@metamask/utilsto^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
providerandblockTrackeroptions (#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:addRequestaction will be called when a new transaction is initiated - The
ApprovalController:rejectRequestaction will be called if a transaction fails - The
ApprovalController:acceptRequestaction will be called when a transaction is approved
- The
- BREAKING: Bump to Node 16 (#1262)
- BREAKING: Update
@metamask/network-controllerdependency and peer dependency (#1367)- This affects the
getNetworkStateandonNetworkStateChangeconstructor parameters
- This affects the
- BREAKING: Change format of chain ID in state to
Hex(#1367)- The
chainIdproperty of theTransactiontype has been changed fromnumbertoHex - The
chainIdproperty of theTransactionMetatype has been changed from a decimalstringtoHex, and thetransactionproperty has been updated along with theTransactiontype (as described above). - The state property
transactionsis an array ofTransactionMetaobjects, so it has changed according to the description above.- This requires a state migration: each entry should have the
chainIdproperty converted from a decimalstringtoHex, and thetransaction.chainIdproperty changed fromnumbertoHex.
- This requires a state migration: each entry should have the
- The
addTransactionandestimateGasmethods now expect the first parameter (transaction) to use typeHexfor thechainIdproperty. - The
updateTransactionmethod now expects thetransactionMetaparameter to use typeHexfor thechainIdproperty (and for the nestedtransaction.chainIdproperty)
- The
- BREAKING: Add
messengeras required constructor parameter (#1241) - BREAKING: Add
@metamask/approval-controlleras a dependency and peer dependency (#1241, #1393) - Add
@metamask/utilsdependency (#1367)
- Fix inaccurate hard-coded
chainIdon incoming token transactions (#1366)
- BREAKING: peerDeps: @metamask/network-controller@6.0.0->8.0.0 (#1196)
- deps: eth-rpc-errors@4.0.0->4.0.2 (#1215)
- Add nonce tracker to transactions controller (#1147)
- Previously this controller would get the next nonce by calling
eth_getTransactionCountwith 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_getTransactionCountmiddleware. 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
NetworkTypeenum for chain configuration (#1132)
- BREAKING: Remove
isomorphic-fetch(#1106)- Consumers must now import
isomorphic-fetchor 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
isEIP1559Transactionfunction from package (#1058)
- BREAKING: Drop Etherscan API support for Ropsten, Rinkeby, and Kovan (#1041)
- Rename this repository to
core(#1031) - Update
@metamask/controller-utilspackage (#1041)
- BREAKING: Update
getNetworkStateconstructor option to take an object withproviderConfigproperty 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/controllersv33.0.0, namely:- Everything in
src/transaction - Transaction-related functions from
src/util.tsand accompanying tests
All changes listed after this point were applied to this package following the monorepo conversion.
- Everything in
-