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.
- feat(STX-501): route sentinel migration via remote feature flags (#580)
- Expose
SmartTransactionsControllermethods through its messenger (#574)- The following actions are now available:
SmartTransactionsController:checkPollSmartTransactionsController:initializeSmartTransactionsForChainIdSmartTransactionsController:pollSmartTransactionsController:stopSmartTransactionsController:setOptInStateSmartTransactionsController:trackStxStatusChangeSmartTransactionsController:isNewSmartTransactionSmartTransactionsController:updateSmartTransactionSmartTransactionsController:updateSmartTransactionsSmartTransactionsController:fetchSmartTransactionsStatusSmartTransactionsController:clearFeesSmartTransactionsController:getFeesSmartTransactionsController:submitSignedTransactionsSmartTransactionsController:cancelSmartTransactionSmartTransactionsController:fetchLivenessSmartTransactionsController:setStatusRefreshIntervalSmartTransactionsController:getTransactionsSmartTransactionsController:getSmartTransactionByMinedTxHashSmartTransactionsController:wipeSmartTransactions
- Corresponding action types (e.g.
SmartTransactionsControllerCheckPollAction) are available as well.
- The following actions are now available:
- feat: migrate to @metamask/messenger-cli for action types codegen (#579)
- BREAKING: Upgrade TypeScript from
~4.8.4to~5.3.3(#574)- Consumers on TypeScript 4.x may experience type errors and should upgrade to TypeScript 5.x.
- BREAKING: Replace
getBearerTokenconstructor parameter with directAuthenticationController:getBearerTokencall (#578)- Consumers must add
AuthenticationController:getBearerTokento the allowed actions in the controller messenger, and remove any usage of thegetBearerTokenconstructor parameter.
- Consumers must add
- Bump
@metamask/messengerfrom^0.3.0to^1.1.0(#578)
- BREAKING:
ErrorReportingService:captureExceptionis no longer an allowed action on the messenger; consumers must stop allowlisting it (#572) - Move controller packages from peer to direct dependencies and bump to latest majors (#572)
@metamask/network-controller^25.0.0 → ^30.0.0@metamask/transaction-controller^61.0.0 → ^63.0.0@metamask/remote-feature-flag-controller^2.0.0 → ^4.1.0@metamask/polling-controller^15.0.0 → ^16.0.0
- Authenticate calls to transaction api (#570)
- chore(gasless-bridge): add gaslessBridgeWith7702Enabled feature flag (#568)
- Log the original transaction status (#566)
- Add
originto sentinel metadata (#564)
- Change
clientfield type inSentinelMetafromClientIdenum tostringfor device identification (#562)
- Add
Feature,Kind,ClientandWalletfields toSentinelMeta(#560)
- Add support for signed transactions with metadata in SmartTransactionsController (#557)
- BREAKING: The controller now reads feature flags directly from
RemoteFeatureFlagControllervia the messenger instead of using thegetFeatureFlagscallback (#550)- Clients must configure the following as allowed actions in the controller messenger:
RemoteFeatureFlagController:getStateErrorReportingService:captureException(for reporting validation errors to Sentry)
- Clients must configure
RemoteFeatureFlagController:stateChangeas an allowed event - The
getFeatureFlagsconstructor option is now deprecated and ignored
- Clients must configure the following as allowed actions in the controller messenger:
- Add
chainIdparameter tofetchLivenessmethod, allowing direct chain ID specification without requiring a network client ID (#554)
- Deprecate
networkClientIdparameter infetchLivenessin favor ofchainId(#554)
- Mark multiple transactions as failed if a batch smart transaction fails (#551)
- BREAKING: Remove an unnecessary confirmExternalTransaction call (#548)
- feat(STX-271): add sentinel URL for Polygon (#546)
- BREAKING: Migrate
SmartTransactionsControllerto newMessengerfrom@metamask/messenger(#543) - BREAKING: Metadata property
anonymousrenamed toincludeInDebugSnapshot(#543) - BREAKING: Bump
@metamask/network-controllerpeer dependency from^24.0.Oto^25.0.0(#543) - BREAKING: Bump
@metamask/transaction-controllerpeer dependency from^60.4.0to^61.0.0(#543) - Bump
@metamask/base-controllerfrom^8.3.0to^9.0.0(#543) - Bump
@metamask/polling-controllerfrom^14.0.0to^15.0.0(#543) - Set
moduleResolutionoption toNode16(#543)
- Export
SmartTransactionMinedTx,SmartTransactionCancellationReason,SmartTransactionStatuses, andClientIdenums values instead of types only (#541)
- Add missing constants and helpers exports (#538)
MetaMetricsEventCategoryMetaMetricsEventNamegetSmartTransactionMetricsPropertiesgetSmartTransactionMetricsSensitiveProperties
- Add missing exports for types (#537)
FeeFeesIndividualTxFeesFeatureFlagsSmartTransactionMinedTxSmartTransactionSmartTransactionCancellationReasonSmartTransactionStatusesClientId
- This package can now be used in ESM environments as well as CommonJS (#469)
- Add two new controller state metadata properties:
includeInStateLogsandusedInUi(#531)
- BREAKING: Disallow subpath exports (#469)
- BREAKING: Upgrade peer dependency
@metamask/transaction-controllerfrom^58.0.0to^60.4.0(#532, #534) - BREAKING: Remove
getNonceLock,confirmExternalTransaction,getTransactions, andupdateTransactionconstructor option in favor of messenger actions (#534)- The messenger is now used to access TransactionController; you must add these actions to the SmartTransactionController messenger allowlist:
TransactionController:getNonceLockTransactionController:confirmExternalTransactionTransactionController:getTransactionsTransactionController:updateTransaction
- The messenger is now used to access TransactionController; you must add these actions to the SmartTransactionController messenger allowlist:
- Upgrade
@metamask/base-controllerfrom^7.0.1to^8.3.0(#529) - Upgrade
@metamask/polling-controllerfrom^12.0.0to^14.0.0(#529)
- BREAKING: Remove default export (#535)
- Use
import { SmartTransactionsController } from '@metamask/smart-transactions-controller'instead.
- Use
- Add Linea URL for Sentinel (#527)
- BREAKING:: Don't persist controller state (#525)
- Add support for type 4 transaction (#521)
- BREAKING: Bump peer dependency on
@metamask/network-controllerto^24.0.0(#519) - BREAKING: Bump dependency and peer dependency on
@metamask/transaction-controllerto^58.0.0(#520)- The
confirmExternalTransactionconstructor option now expects to matchTransactionControllerfrom this version - The
getNonceLockconstructor option now expects to matchTransactionControllerfrom this version - The
getTransactionsconstructor option now returns an object that matchesTransactionMetafrom this version - The
updateTransactionconstructor option now expects an object that matchesTransactionMetafrom this version - The
transactionMetaoption of thesubmitSignedTransactionsmethod now expects an object that matchesTransactionMetafrom this version - The
txParamsoption of thesubmitSignedTransactionsmethod now expects an object that matchesTransactionParamsfrom this version
- The
- Add Arbitrum URL for Sentinel (#517)
- Add performance tracing to the STX controller (#515)
- Improve error handling and monitoring (#508)
- Support batch transactions during submit (#504)
- Added multi-chain smart transaction support (#498)
- Improve changelog linting to prevent formatting issues (#502)
- Add Base Sentinel endpoint to STX controller (#500)
- Add workflow_dispatch to security-code-scanner (#499)
- SmartTransactionsController
stateshould persist (#493) After opening your browser smart transactions should be preserved.
- Extend definition of when a regular tx is marked as failed based on a smart transaction status, clean up unsupported statuses (#485)
- BREAKING Update
@metamask/transaction-controllerpeer dependency from^38.0.0to^42.0.0(#482)
- BREAKING Remove exports for
AllowedActionsandAllowedEventstypes (#482)
- Update constants.ts to add a BSC url for smart transactions (#483)
- Remove unnecessary
eventsdependency (#473)
- BREAKING: Recategorize controllers as peer dependencies (#472)
- The following packages have been removed as dependencies, and added as peer dependencies:
@metamask/network-controller@^22.0.0@metamask/transaction-controller@^38.0.0
- Note that these versions have also been updated
- The following packages have been removed as dependencies, and added as peer dependencies:
- BREAKING: Add support for returning a transaction hash asap after a smart transaction is submitted. This requires to pass 3 new parameters when calling the STX controller:
clientId,getFeatureFlagsandupdateTransaction#467) - Update
@metamask/polling-controllerfrom v11.0.0 to v12.0.0 (#471) - Remove test-helpers from build (#459)
- Bump
@metamask/eth-json-rpc-providerfrom^4.1.0to^4.1.6(#460)
- BREAKING Update
@metamask/polling-controllerfrom^8.0.0to^11.0.0(#448)startPollingByNetworkClientIdhas been renamed tostartPolling, accepting aSmartTransactionsControllerPollingInputobject instead of a string as argument.
- Update
@metamask/transaction-controllerfrom^34.0.0to^37.3.0(#446) - Update
@metamask/base-controllerfrom^6.0.0to^7.0.1(#448) - Update
@metamask/network-controllerfrom^20.0.0to^21.1.0(#447)
- Add metrics events for Receive and Request (#429)
- Add
ReceiveRequestvariant toMetaMetricsEventsenum - Add
Navigationvariant toMetaMetricsEventCategoryenum
- Add
- Emit a new "smartTransactionConfirmationDone" event (#424)
- Use a new API (Sentinel) for a health check (#411)
- BREAKING: Updated
SmartTransactionsControllerto inherit fromStaticIntervalPollingControllerinstead ofStaticIntervalPollingControllerV1(#397).- The constructor for
SmartTransactionsControllernow accepts a single options object instead of three separate arguments, with configuration options merged into this object. SmartTransactionsControllernow requires amessengeroption (with the corresponding typeSmartTransactionsControllerMessengernow available).- The constructor no longer accepts
onNetworkStateChange; instead, it subscribes toNetworkController:stateChange. - The
getNetworkClientByIdargument has been removed from the constructor and is now accessed through the messenger. - The controller no longer subscribes to its own events; this is now managed via the messenger.
- Event emission is no longer handled by
EventEmitter; the messenger is now used for emitting events. - The
SmartTransactionsControllerConfigtype has been removed and replaced withSmartTransactionsControllerOptions. - Added and exported the following types:
SmartTransactionsControllerMessenger,SmartTransactionsControllerState,SmartTransactionsControllerGetStateAction,SmartTransactionsControllerActions,SmartTransactionsControllerStateChangeEvent,SmartTransactionsControllerSmartTransactionEvent, andSmartTransactionsControllerEvents.
- The constructor for
- Remove logic for ensuring uniqueness of smart transactions (#404)
- This issue has been resolved in production.
- Fix issue where this.ethQuery is sometimes unexpectedly undefined (#405)
- Upgrade @metamask/network-controller from 19.0.0 to 20.0.0 (#395)
- BREAKING: Removed providerConfig from state and provider object from constructor parameters. Instead provider object will be used from selected network client. (#395)
- adapt to eip-1193 provider changes (#384)
- BREAKING: Save new event props to a newly created smart transaction, use both
propertiesandsensitivePropertiesfor events. (#386)(#390)
- Update metrics, so events work even for non-swaps transactions (#374)
- Update @metamask/transaction-controller from 32.0.0 to 34.0.0 (#371)
- Update braces from 3.0.2 to 3.0.3 and remove the
--immutable-cacheflag in a build file (#367)
- Update @metamask/transaction-controller from 29.1.0 to 32.0.0 (#348)
- Update @metamask/polling-controller from 6.0.2 to 8.0.0 (#352)
- Update @metamask/network-controller from 18.1.1 to 19.0.0 (#349)
- Update @metamask/base-controller from 5.0.2 to 6.0.0 (#351)
- Update jest from v26 to v29, ts-jest from v26 to v29 and nock from v13 to v14 (#325)
- fix: Improve state management to ensure unique smart transactions in a rare edge case. This will be removed in a future version once we have confirmed this is resolved. (#353)
- Bring release instructions in README up to date (#354)
- Call the "poll" function only once on a network switch (#348)
- Update
@metamask/transaction-controllerfrom^29.1.0to^30.0.0(#342)
- Update
@metamask/transaction-controllerfrom^28.1.0to^29.1.0(#339)
- Emit an event with an updated Smart Transaction before confirmation (#333)
- BREAKING: Flip the behavior of the
wipeSmartTransactionsmethod'signoreNetworkoption (#323)- Passing
falsewill now wipe transactions for the globally selected chain, and passingtruewill now wipe transactions from each chain stored in state, instead of the other way around
- Passing
- Add Sepolia support (#316)
- Add function
wipeSmartTransactionsto clear all state for a given address (needs to be supplied in all-lowercase) (#316)
- Update
@metamask/base-controllerfrom^4.1.1to^5.0.1(#296) - Update
@metamask/controller-utilsfrom^8.0.3to^9.1.0(#318) - Update
@metamask/network-controllerfrom^17.2.0to^18.1.0(#310) - Update
@metamask/polling-controllerfrom^5.0.1to^6.0.1(#294) - Update
@metamask/transaction-controllerfrom^25.1.0to^28.1.0(#319)
- BREAKING: Remove Goerli support (#316)
- Update a URL for transaction-api from
https://transaction.metaswap.codefi.networktohttps://transaction.api.cx.metamask.io, since we shouldn't be usingcodefi.networkanymore (#314) - Add a new function called
getSmartTransactionByMinedTxHash, which can be used to get a smart transaction by itsminedHashprop (#314) - Add new props on the
SmartTransactionsStatustype, so they can be used e.g. as event props (#314)
- BREAKING: The constructor now requires a
getTransactionsoption, which can be used to get a list of existing transactions (#301) - Ensure that a transaction does not get re-confirmed if it is already confirmed or submitted. MetaMask Swaps are confirmed from this controller, other transaction types are most of the time confirmed from the TransactionController. (#301)
- BREAKING: Track fees and liveness for multiple chains by adding
feesByChainIdandlivenessByChainIdproperties to SmartTransactionsControllerState (#237)- In particular, clients should prefer accessing
feesByChainIdandlivenessByChainIdinstead offeesandliveness, which will be removed in a future major version.
- In particular, clients should prefer accessing
SmartTransactionsControllernow inherits fromStaticIntervalPollingControllerV1(#237, #265)- This change introduces a set of public methods to the controller which is designed to manage polling on a particular network instead of the globally selected network. Internally,
updateSmartTransactionswill still be called as the legacy polling does. The methods added are:setIntervalLengthgetIntervalLengthstartPollingByNetworkClientIdstopAllPollingstopPollingByPollingTokenonPollingCompleteByNetworkClientId
- This change introduces a set of public methods to the controller which is designed to manage polling on a particular network instead of the globally selected network. Internally,
- Validation can be now be circumvented by passing the
skipConfirmoption (#271) - Several methods now take a
networkClientIdoption within an options object which can be used to operate on smart transactions that live on a particular chain instead of the globally selected one (#237)updateSmartTransactionfetchSmartTransactionsStatusgetFeessubmitSignedTransactionscancelSmartTransactionfetchLiveness
- Expose
eventEmitteras a public property (#298) submitSignedTransactionsnow takes atransactionMetaoption which is used to set thetypeof the submitted smart transaction (#298)submitSignedTransactionsnow setsuuidandtxHashon the submitted smart transaction (#298)submitSignedTransactionsnow returns metadata about the submitted transaction (#298)- Add
getTxHashutility function which can be used to get the transaction hash from a signed transaction (#298) <transaction-uuid>:smartTransactionis now emitted whenever a smart transaction is updated (#298)- This occurs after transactions are submitted, after they are confirmed, after statuses are updated, and also explicitly via
updateSmartTransaction.
- This occurs after transactions are submitted, after they are confirmed, after statuses are updated, and also explicitly via
- BREAKING: Bump
@metamask/network-controllerfrom^15.0.0to^17.0.0(#238 #241)- This is breaking because the type of the
messengerhas backward-incompatible changes. See the changelog for@metamask/base-controller@4.0.0for more.
- This is breaking because the type of the
- BREAKING: The set of supported chains (configurable via
supportedChainIds) now defaults to including Goerli instead of Rinkeby (#237) - BREAKING: Minimum Node.js version is now 18.18 (#270)
- BREAKING: Constrain the type of the constructor
provideroption toProviderfrom@metamask/network-controller(#237) - BREAKING: The constructor now takes a required argument
getNetworkClientById, which should be bound from NetworkController'sgetNetworkClientByIdmethod (#237) - BREAKING:
fetchSmartTransactionsStatusnow emits<transaction-uuid>:smartTransactioninstead of<transaction-uuid>:transaction-hash(#279)- This event contains more information than just the transaction hash.
- This event is also always emitted even if there is no transaction hash.
- BREAKING: Use a category of "Transactions" for MetaMetrics events rather than "swaps" (#282)
- Bump
@metamask/base-controllerfrom^3.2.1to^4.0.0(#237) - Bump
@metamask/controller-utilsfrom^5.0.0to^8.0.3(#242 #244)(#242) (#244) (#267) (#272) - Bump
@metamask/network-controllerfrom^15.2.0to^17.2.0(#238) (#241) (#255) (#264) (#265) - Bump
@metamask/polling-controllerfrom^2.0.0to^5.0.0(#265) - Remove
@ethersprovider/bignumberand@ethersproject/providersfrom dependencies; replace with@metamask/eth-query@^4.0.0(#237) - Add
events@^3.3.0as a dependency (#271) - Deprecate
timeproperty onSmartTransactiontype in favor ofcreationTime(#298)
- BREAKING: Remove property
ethersProviderfromSmartTransactionsController(#237)
- Fix
getFeesso that it does not blow away an existingnonceon the trade transaction (#271) - Fix
submitSignedTransactionsso that it sets anonceon the resulting transaction if it doesn't have one (#271) - Fix updating a smart transaction to no longer throw when no smart transactions have been previously saved under the current chain (#271)
- Properly override controller name to
SmartTransactionController(#273) - Properly mark
getFeesas having an optional second argument, since it was being handled that way anyway (#271) - The controller now waits until the first NetworkController update before making use of the
providerconstructor argument to hit the currently selected network (#274)- This change was made because in the future, the
providermay no longer be defined initially. - This change may cause errors to be thrown immediately following a network switch until a future NetworkController state update or polling iteration.
- This change was made because in the future, the
- Revert "Parameterize SmartTransactionsController state by ChainId for MultiChain + Integrate PollingController Mixin (#235)
6.2.1 [DEPRECATED]
- Fix a typo in a URL for submitting transactions (#230)
6.2.0 [DEPRECATED]
- Pass current version of this package to API when submitting transactions (#227)
6.1.0 [DEPRECATED]
- Add a new "userOptInV2" prop (#222)
- Bump @metamask/network-controller from 15.0.0 to 15.1.0 (#219)
6.0.0 [DEPRECATED]
- BREAKING:
getNetworkClientByIdis now required argument in constructor options object (#210) - Integrate
PollingControllermixin and_executePollmethod used for concurrent multichain polling (#210) - Consumers can now call
startPollingByNetworkClientIdwith a networkClientId to start polling for a specific chain andstopPollingByPollingTokenwith the returned pollingToken to stop polling for that chain.
- BREAKING: Bump
@metamask/network-controllerfrom ^13.0.1 to ^15.0.0 (#211) - BREAKING: Replace
@ethersproject/providerswith@metamask/eth-query(#210) - Remove
@ethersproject/bignumber(#210) - Add optional options object containing a
networkClientIdargument to theupdateSmartTransactionmethod (#210)
- Bump dependency on
@metamask/network-controllerto ^13.0.0 (#191) - Bump dependency on
@metamask/base-controllerto ^3.2.1 (#191) - Bump dependency on
@metamask/controller-utilsto ^5.0.0 (#191)
- BREAKING: Remove
metamaskNetworkIdfrom smart transaction state (#191)- To migrate, remove references to
TransactionMeta.metamaskNetworkIdandTransactionMeta.history.metamaskNetworkId
- To migrate, remove references to
- Remove
getNetworkfrom constructor options (#191)
- BREAKING: Bump minimum Node.js version to v16 (#161)
- BREAKING: Remove
isomorphic-fetch(#131)- Projects lacking
fetchwill now have to supply their own polyfill.
- Projects lacking
- Update
metamask/*dependencies (#131), (#172) - Move
@types/lodashto devDependencies (#141)
- Replace use of full
@metamask/controllersrepo with packages from@metamask/core-monorepo(#110, #112, #113)
- Ensure the nonce lock is always released (#108)
- Replace
etherswith submodules (@ethersproject/bignumber,@ethersproject/bytes, @ethersproject/providers,) - no functional change (#95)
- Remove unnecessary event props (#93)
- Update
is-releasefilter (#91) - update is-release filter (#89)
- use
MetaMask/action-is-release@v1.0(#88) - add config for MetaMask/action-npm-publish (#85)
- Add the "clearFees" function (#84)
- chore(deps): bump @metamask/controllers from 30.0.0 to 30.1.0 (#81)
- chore(deps-dev): bump @metamask/eslint-config-nodejs from 8.0.0 to 9.0.0 (#80)
- chore(deps-dev): bump @metamask/auto-changelog from 2.6.0 to 2.6.1 (#79)
- Return all error props in an error response (#82)
- chore(deps): bump @metamask/controllers from 29.0.1 to 30.0.0 (#75)
- chore(deps-dev): bump @metamask/auto-changelog from 2.5.0 to 2.6.0 (#71)
- Return a pending status for a cancelled tx that hasn't been settled yet (#74)
- Previous version deprecated due to missing build files. No code changes made.
2.0.0 [DEPRECATED]
- "estimateGas" -> "getFees", support a new cancellation reason, refactoring (#69)
- chore(deps): bump @metamask/controllers from 28.0.0 to 29.0.1 (#68)
- If mined status is not mined and cancel reason not set, then show the cancel link, refactoring (#66)
- chore(deps): bump @metamask/controllers from 27.1.1 to 28.0.0 (#65)
- Handle the "cancelled" status, lower status polling interval from 10s to 5s, don't mark a tx as cancelled immediately, track uuid (#63)
- chore(deps): bump @metamask/controllers from 25.1.0 to 27.1.1 (#62)
- Add tracking of the "current_stx_enabled" param (#58)
- Use the "confirmExternalTransaction" fn directly (#56)
- Only accept the "getNonceLock" fn and not the whole "nonceTracker" (#54)
- Do not update an STX which doesn't exist anymore, add UTs (#52)
- Fix UTs, change threshold (#49)
- Change cancellable interval to be 1 minute (#47)
- Estimate approval transaction along with swaps transaction (#46)
- chore(deps): bump @metamask/controllers from 20.1.0 to 25.1.0 (#44)
- Add support for approveTxParams (#45)
- Add method for estimateGas (#43)
- Add "fees" and "liveness" into the smartTransactionsState, update version (#41)
- Add isomorphic-fetch to stx controller (#38)
- feat: create new handleFetch with custom error handling (#35)
- Unblock submit if ethers errors (#30)
- Parse chain ids from hex to dec instead of mapping them (#31)
- chore(deps): bump @metamask/controllers from 20.0.0 to 20.1.0 (#28)
- getTransactions -> getFees, refactoring (#27)
- chore(deps): bump @metamask/controllers from 19.0.0 to 20.0.0 (#24)
- Switch license with MetaMask license (#25)
- Use the production version of the Transaction APIs repo (#37)
- Add more unit tests for SmartTransactionsController (#23)
- chore(deps): bump @metamask/controllers from 16.0.0 to 19.0.0 (#18)
- Add cancelled status to stx after successful cancel request (#21)
- 1.1.0 (#22)
- Tracking of STX status changes (#20)
- Remove cancelled transaction when new trx with same nonce submitted (#19)
- chore: modify polling and clean up tests (#17)
- State changes + getTransactions fn (#16)
- Add updatedTxParams and confirm history event (#15)
- Smart Transactions List (#13)
- Adds nonce to a tx, adds
yarn build:linksupport, updates functions for API calls, refactoring (#8) - Add many unit tests, support for the batch_status API, refactoring (#6)
- Bump @metamask/controllers from 15.1.0 to 16.0.0
- Bump @metamask/controllers from 15.0.0 to 15.1.0 (#4)
- Add initial methods (#3)
- Add initial SmartTransactionsController (#1)
- Initial commit