Skip to content

Latest commit

 

History

History
431 lines (368 loc) · 34.7 KB

CHANGELOG.md

File metadata and controls

431 lines (368 loc) · 34.7 KB

Changelog

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.

Changed

  • 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
      • @metamask/network-controller updated from v21.1.0 to v22.0.0 (#471)
      • @metamask/transaction-controller updated from v37.3.0 to v38.0.0 (#471)
  • 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 and updateTransaction #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)

Changed

  • BREAKING Update @metamask/polling-controller from ^8.0.0 to ^11.0.0 (#448)
    • startPollingByNetworkClientId has been renamed to startPolling, accepting a SmartTransactionsControllerPollingInput 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)

Added

  • Add metrics events for Receive and Request (#429)
    • Add ReceiveRequest variant to MetaMetricsEvents enum
    • Add Navigation variant to MetaMetricsEventCategory enum

Changed

  • Emit a new "smartTransactionConfirmationDone" event (#424)
  • Use a new API (Sentinel) for a health check (#411)

Changed

  • BREAKING: Updated SmartTransactionsController to inherit from StaticIntervalPollingController instead of StaticIntervalPollingControllerV1 (#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 a messenger option (with the corresponding type SmartTransactionsControllerMessenger now available).
    • The constructor no longer accepts onNetworkStateChange; instead, it subscribes to NetworkController: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 with SmartTransactionsControllerOptions.
    • Added and exported the following types: SmartTransactionsControllerMessenger, SmartTransactionsControllerState, SmartTransactionsControllerGetStateAction, SmartTransactionsControllerActions, SmartTransactionsControllerStateChangeEvent, SmartTransactionsControllerSmartTransactionEvent, and SmartTransactionsControllerEvents.

Changed

  • Remove logic for ensuring uniqueness of smart transactions (#404)
    • This issue has been resolved in production.

Fixed

  • Fix issue where this.ethQuery is sometimes unexpectedly undefined (#405)

Changed

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

Changed

  • adapt to eip-1193 provider changes (#384)
  • BREAKING: Save new event props to a newly created smart transaction, use both properties and sensitiveProperties for events. (#386)(#390)

Changed

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

Changed

  • Update @metamask/transaction-controller from 29.1.0 to 32.0.0 (#348)

Changed

  • Update @metamask/polling-controller from 6.0.2 to 8.0.0 (#352)

Changed

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

Changed

  • Update jest from v26 to v29, ts-jest from v26 to v29 and nock from v13 to v14 (#325)

Fixed

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

Fixed

  • Call the "poll" function only once on a network switch (#348)
  • Update @metamask/transaction-controller from ^29.1.0 to ^30.0.0 (#342)

Changed

  • Update @metamask/transaction-controller from ^28.1.0 to ^29.1.0 (#339)

Fixed

  • Emit an event with an updated Smart Transaction before confirmation (#333)

Fixed

  • BREAKING: Flip the behavior of the wipeSmartTransactions method's ignoreNetwork option (#323)
    • Passing false will now wipe transactions for the globally selected chain, and passing true will now wipe transactions from each chain stored in state, instead of the other way around

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)

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)

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)

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.

Fixed

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

6.2.1 [DEPRECATED]

Fixed

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

6.2.0 [DEPRECATED]

Added

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

6.1.0 [DEPRECATED]

Added

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

Changed

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

6.0.0 [DEPRECATED]

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)

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)

Changed

  • 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.
  • Update metamask/* dependencies (#131), (#172)
  • Move @types/lodash to devDependencies (#141)

Changed

  • Replace use of full @metamask/controllers repo with packages from @metamask/core-monorepo (#110, #112, #113)

Changed

Fixed

  • Ensure the nonce lock is always released (#108)

Changed

  • Replace ethers with submodules (@ethersproject/bignumber,@ethersproject/bytes, @ethersproject/providers,) - no functional change (#95)

Changed

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

Added

  • Add the "clearFees" function (#84)

Changed

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

Added

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

Changed

  • Previous version deprecated due to missing build files. No code changes made.

2.0.0 [DEPRECATED]

Added

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

Added

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

Added

  • Use the "confirmExternalTransaction" fn directly (#56)

Added

  • Only accept the "getNonceLock" fn and not the whole "nonceTracker" (#54)

Added

  • Do not update an STX which doesn't exist anymore, add UTs (#52)

Added

  • Fix UTs, change threshold (#49)

Added

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

Added

  • Add "fees" and "liveness" into the smartTransactionsState, update version (#41)

Added

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

Added

  • Use the production version of the Transaction APIs repo (#37)

Added

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

Added

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

Added

  • 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