@metamask/transaction-controller 59.1.0 → 59.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [59.2.0]
11
+
12
+ ### Added
13
+
14
+ - Add optional `updateType` property to disable `type` update in `updateEditableParams` method ([#6289](https://github.com/MetaMask/core/pull/6289))
15
+ - Add `perpsDeposit` to `TransactionType` ([#6282](https://github.com/MetaMask/core/pull/6282))
16
+
17
+ ### Changed
18
+
19
+ - Bump `@metamask/base-controller` from `^8.0.1` to `^8.1.0` ([#6284](https://github.com/MetaMask/core/pull/6284))
20
+
10
21
  ## [59.1.0]
11
22
 
12
23
  ### Added
@@ -1745,7 +1756,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1745
1756
 
1746
1757
  All changes listed after this point were applied to this package following the monorepo conversion.
1747
1758
 
1748
- [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@59.1.0...HEAD
1759
+ [Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@59.2.0...HEAD
1760
+ [59.2.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@59.1.0...@metamask/transaction-controller@59.2.0
1749
1761
  [59.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@59.0.0...@metamask/transaction-controller@59.1.0
1750
1762
  [59.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@58.1.1...@metamask/transaction-controller@59.0.0
1751
1763
  [58.1.1]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@58.1.0...@metamask/transaction-controller@58.1.1
@@ -875,11 +875,12 @@ class TransactionController extends base_controller_1.BaseController {
875
875
  * @param params.gasPrice - Price per gas for legacy transactions.
876
876
  * @param params.maxFeePerGas - Maximum amount per gas to pay for the transaction, including the priority fee.
877
877
  * @param params.maxPriorityFeePerGas - Maximum amount per gas to give to validator as incentive.
878
+ * @param params.updateType - Whether to update the transaction type. Defaults to `true`.
878
879
  * @param params.to - Address to send the transaction to.
879
880
  * @param params.value - Value associated with the transaction.
880
881
  * @returns The updated transaction metadata.
881
882
  */
882
- async updateEditableParams(txId, { containerTypes, data, from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, value, }) {
883
+ async updateEditableParams(txId, { containerTypes, data, from, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to, updateType, value, }) {
883
884
  const transactionMeta = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransaction).call(this, txId);
884
885
  if (!transactionMeta) {
885
886
  throw new Error(`Cannot update editable params as no transaction metadata found`);
@@ -902,8 +903,10 @@ class TransactionController extends base_controller_1.BaseController {
902
903
  const { networkClientId } = transactionMeta;
903
904
  const provider = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getProvider).call(this, { networkClientId });
904
905
  const ethQuery = new eth_query_1.default(provider);
905
- const { type } = await (0, transaction_type_1.determineTransactionType)(updatedTransaction.txParams, ethQuery);
906
- updatedTransaction.type = type;
906
+ if (updateType !== false) {
907
+ const { type } = await (0, transaction_type_1.determineTransactionType)(updatedTransaction.txParams, ethQuery);
908
+ updatedTransaction.type = type;
909
+ }
907
910
  if (containerTypes) {
908
911
  updatedTransaction.containerTypes = containerTypes;
909
912
  }