Skip to content

Releases: MetaMask/smart-transactions-controller

9.0.0

26 Apr 07:37
de0c8fc
Compare
Choose a tag to compare

Added

  • Add Sepolia support (#316)
  • Add function wipeSmartTransactions to clear all state for a given address (needs to be supplied in all-lowercase) (#316)

Changed

  • 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)

Removed

  • BREAKING: Remove Goerli support (#316)

8.1.0

10 Apr 20:30
0d17c88
Compare
Choose a tag to compare

Changed

  • Update a URL for transaction-api from https://transaction.metaswap.codefi.network to https://transaction.api.cx.metamask.io, since we shouldn't be using codefi.network anymore (#314)
  • Add a new function called getSmartTransactionByMinedTxHash, which can be used to get a smart transaction by its minedHash prop (#314)
  • Add new props on the SmartTransactionsStatus type, so they can be used e.g. as event props (#314)

8.0.0

28 Mar 17:19
0baaed5
Compare
Choose a tag to compare

Changed

  • 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)

7.0.0

19 Mar 18:21
521c2d8
Compare
Choose a tag to compare

Added

  • BREAKING: Track fees and liveness for multiple chains by adding feesByChainId and livenessByChainId properties to SmartTransactionsControllerState (#237)
    • In particular, clients should prefer accessing feesByChainId and livenessByChainId instead of fees and liveness, which will be removed in a future major version.
  • SmartTransactionsController now inherits from StaticIntervalPollingControllerV1 (#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
  • 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 a transactionMeta option which is used to set the type of the submitted smart transaction (#298)
  • submitSignedTransactions now sets uuid and txHash 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.

Changed

  • 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.
  • 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 to Provider from @metamask/network-controller (#237)
  • BREAKING: The constructor now takes a required argument getNetworkClientById, which should be bound from NetworkController's getNetworkClientById 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 on SmartTransaction type in favor of creationTime (#298)

Removed

  • BREAKING: Remove property ethersProvider from SmartTransactionsController (#237)

Fixed

  • Fix getFees so that it does not blow away an existing nonce on the trade transaction (#271)
  • Fix submitSignedTransactions so that it sets a nonce 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.

6.2.2

09 Nov 17:25
949bf97
Compare
Choose a tag to compare

Fixed

  • Revert "Parameterize SmartTransactionsController state by ChainId for MultiChain + Integrate PollingController Mixin (#235)

6.2.1

08 Nov 17:37
b139ac1
Compare
Choose a tag to compare

Fixed

  • Fix a typo in a URL for submitting transactions (#230)

6.2.0

07 Nov 19:19
520a70d
Compare
Choose a tag to compare

Added

  • Pass current version of this package to API when submitting transactions (#227)

6.1.0

06 Nov 16:40
741d6ea
Compare
Choose a tag to compare

Added

  • Add a new "userOptInV2" prop (#222)

Changed

  • Bump @metamask/network-controller from 15.0.0 to 15.1.0 (#219)

6.0.0

24 Oct 21:01
216f036
Compare
Choose a tag to compare

Added

  • 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 and stopPollingByPollingToken with the returned pollingToken to stop polling for that chain.

Changed

  • 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 the updateSmartTransaction method (#210)

5.0.0

02 Oct 22:27
4cae857
Compare
Choose a tag to compare

Changed

  • 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)

Removed

  • BREAKING: Remove metamaskNetworkId from smart transaction state (#191)
    • To migrate, remove references to TransactionMeta.metamaskNetworkId and TransactionMeta.history.metamaskNetworkId
  • Remove getNetwork from constructor options (#191)