All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- BREAKING: 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
,getFeatureFlags
andupdateTransaction
#467) - Update
@metamask/polling-controller
from v11.0.0 to v12.0.0 (#471) - Remove test-helpers from build (#459)
- Bump
@metamask/eth-json-rpc-provider
from^4.1.0
to^4.1.6
(#460)
- BREAKING Update
@metamask/polling-controller
from^8.0.0
to^11.0.0
(#448)startPollingByNetworkClientId
has been renamed tostartPolling
, accepting aSmartTransactionsControllerPollingInput
object instead of a string as argument.
- Update
@metamask/transaction-controller
from^34.0.0
to^37.3.0
(#446) - Update
@metamask/base-controller
from^6.0.0
to^7.0.1
(#448) - Update
@metamask/network-controller
from^20.0.0
to^21.1.0
(#447)
- Add metrics events for Receive and Request (#429)
- Add
ReceiveRequest
variant toMetaMetricsEvents
enum - Add
Navigation
variant toMetaMetricsEventCategory
enum
- Add
- Emit a new "smartTransactionConfirmationDone" event (#424)
- Use a new API (Sentinel) for a health check (#411)
- BREAKING: Updated
SmartTransactionsController
to inherit fromStaticIntervalPollingController
instead ofStaticIntervalPollingControllerV1
(#397).- The constructor for
SmartTransactionsController
now accepts a single options object instead of three separate arguments, with configuration options merged into this object. SmartTransactionsController
now requires amessenger
option (with the corresponding typeSmartTransactionsControllerMessenger
now available).- The constructor no longer accepts
onNetworkStateChange
; instead, it subscribes toNetworkController:stateChange
. - The
getNetworkClientById
argument 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
SmartTransactionsControllerConfig
type 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
properties
andsensitiveProperties
for 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-cache
flag 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-controller
from^29.1.0
to^30.0.0
(#342)
- Update
@metamask/transaction-controller
from^28.1.0
to^29.1.0
(#339)
- Emit an event with an updated Smart Transaction before confirmation (#333)
- BREAKING: Flip the behavior of the
wipeSmartTransactions
method'signoreNetwork
option (#323)- Passing
false
will now wipe transactions for the globally selected chain, and passingtrue
will now wipe transactions from each chain stored in state, instead of the other way around
- Passing
- Add Sepolia support (#316)
- Add function
wipeSmartTransactions
to clear all state for a given address (needs to be supplied in all-lowercase) (#316)
- Update
@metamask/base-controller
from^4.1.1
to^5.0.1
(#296) - Update
@metamask/controller-utils
from^8.0.3
to^9.1.0
(#318) - Update
@metamask/network-controller
from^17.2.0
to^18.1.0
(#310) - Update
@metamask/polling-controller
from^5.0.1
to^6.0.1
(#294) - Update
@metamask/transaction-controller
from^25.1.0
to^28.1.0
(#319)
- BREAKING: Remove Goerli support (#316)
- Update a URL for transaction-api from
https://transaction.metaswap.codefi.network
tohttps://transaction.api.cx.metamask.io
, since we shouldn't be usingcodefi.network
anymore (#314) - Add a new function called
getSmartTransactionByMinedTxHash
, which can be used to get a smart transaction by itsminedHash
prop (#314) - Add new props on the
SmartTransactionsStatus
type, so they can be used e.g. as event props (#314)
- BREAKING: The constructor now requires a
getTransactions
option, 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
feesByChainId
andlivenessByChainId
properties to SmartTransactionsControllerState (#237)- In particular, clients should prefer accessing
feesByChainId
andlivenessByChainId
instead offees
andliveness
, which will be removed in a future major version.
- In particular, clients should prefer accessing
SmartTransactionsController
now 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,
updateSmartTransactions
will still be called as the legacy polling does. The methods added are:setIntervalLength
getIntervalLength
startPollingByNetworkClientId
stopAllPolling
stopPollingByPollingToken
onPollingCompleteByNetworkClientId
- 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
skipConfirm
option (#271) - Several methods now take a
networkClientId
option 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)updateSmartTransaction
fetchSmartTransactionsStatus
getFees
submitSignedTransactions
cancelSmartTransaction
fetchLiveness
- Expose
eventEmitter
as a public property (#298) submitSignedTransactions
now takes atransactionMeta
option which is used to set thetype
of the submitted smart transaction (#298)submitSignedTransactions
now setsuuid
andtxHash
on the submitted smart transaction (#298)submitSignedTransactions
now returns metadata about the submitted transaction (#298)- Add
getTxHash
utility function which can be used to get the transaction hash from a signed transaction (#298) <transaction-uuid>:smartTransaction
is 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-controller
from^15.0.0
to^17.0.0
(#238 #241)- This is breaking because the type of the
messenger
has backward-incompatible changes. See the changelog for@metamask/[email protected]
for 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
provider
option toProvider
from@metamask/network-controller
(#237) - BREAKING: The constructor now takes a required argument
getNetworkClientById
, which should be bound from NetworkController'sgetNetworkClientById
method (#237) - BREAKING:
fetchSmartTransactionsStatus
now emits<transaction-uuid>:smartTransaction
instead 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-controller
from^3.2.1
to^4.0.0
(#237) - Bump
@metamask/controller-utils
from^5.0.0
to^8.0.3
(#242 #244)(#242) (#244) (#267) (#272) - Bump
@metamask/network-controller
from^15.2.0
to^17.2.0
(#238) (#241) (#255) (#264) (#265) - Bump
@metamask/polling-controller
from^2.0.0
to^5.0.0
(#265) - Remove
@ethersprovider/bignumber
and@ethersproject/providers
from dependencies; replace with@metamask/eth-query@^4.0.0
(#237) - Add
events@^3.3.0
as a dependency (#271) - Deprecate
time
property onSmartTransaction
type in favor ofcreationTime
(#298)
- BREAKING: Remove property
ethersProvider
fromSmartTransactionsController
(#237)
- Fix
getFees
so that it does not blow away an existingnonce
on the trade transaction (#271) - Fix
submitSignedTransactions
so that it sets anonce
on 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
getFees
as 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
provider
constructor argument to hit the currently selected network (#274)- This change was made because in the future, the
provider
may 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:
getNetworkClientById
is now required argument in constructor options object (#210) - Integrate
PollingController
mixin and_executePoll
method used for concurrent multichain polling (#210) - Consumers can now call
startPollingByNetworkClientId
with a networkClientId to start polling for a specific chain andstopPollingByPollingToken
with the returned pollingToken to stop polling for that chain.
- BREAKING: Bump
@metamask/network-controller
from ^13.0.1 to ^15.0.0 (#211) - BREAKING: Replace
@ethersproject/providers
with@metamask/eth-query
(#210) - Remove
@ethersproject/bignumber
(#210) - Add optional options object containing a
networkClientId
argument to theupdateSmartTransaction
method (#210)
- Bump dependency on
@metamask/network-controller
to ^13.0.0 (#191) - Bump dependency on
@metamask/base-controller
to ^3.2.1 (#191) - Bump dependency on
@metamask/controller-utils
to ^5.0.0 (#191)
- BREAKING: Remove
metamaskNetworkId
from smart transaction state (#191)- To migrate, remove references to
TransactionMeta.metamaskNetworkId
andTransactionMeta.history.metamaskNetworkId
- To migrate, remove references to
- Remove
getNetwork
from constructor options (#191)
- BREAKING: Bump minimum Node.js version to v16 (#161)
- BREAKING: Remove
isomorphic-fetch
(#131)- Projects lacking
fetch
will now have to supply their own polyfill.
- Projects lacking
- Update
metamask/*
dependencies (#131), (#172) - Move
@types/lodash
to devDependencies (#141)
- Replace use of full
@metamask/controllers
repo with packages from@metamask/core-monorepo
(#110, #112, #113)
- BREAKING: Bump required Node version to v14 (#90)
@metamask/[email protected]
(#104)
- Ensure the nonce lock is always released (#108)
- Replace
ethers
with submodules (@ethersproject/bignumber,@ethersproject/bytes, @ethersproject/providers,) - no functional change (#95)
- Remove unnecessary event props (#93)
- Update
is-release
filter (#91) - update is-release filter (#89)
- use
MetaMask/[email protected]
(#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:link
support, 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