@metamask-previews/transaction-controller 52.2.0-preview-9f91d514 → 52.2.0-preview-aa7690c1

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +0 -5
  2. package/dist/TransactionController.cjs +4 -18
  3. package/dist/TransactionController.cjs.map +1 -1
  4. package/dist/TransactionController.d.cts.map +1 -1
  5. package/dist/TransactionController.d.mts.map +1 -1
  6. package/dist/TransactionController.mjs +5 -19
  7. package/dist/TransactionController.mjs.map +1 -1
  8. package/dist/constants.cjs +0 -1
  9. package/dist/constants.cjs.map +1 -1
  10. package/dist/constants.d.cts +0 -1
  11. package/dist/constants.d.cts.map +1 -1
  12. package/dist/constants.d.mts +0 -1
  13. package/dist/constants.d.mts.map +1 -1
  14. package/dist/constants.mjs +0 -1
  15. package/dist/constants.mjs.map +1 -1
  16. package/dist/gas-flows/DefaultGasFeeFlow.cjs +3 -1
  17. package/dist/gas-flows/DefaultGasFeeFlow.cjs.map +1 -1
  18. package/dist/gas-flows/DefaultGasFeeFlow.d.cts +2 -2
  19. package/dist/gas-flows/DefaultGasFeeFlow.d.cts.map +1 -1
  20. package/dist/gas-flows/DefaultGasFeeFlow.d.mts +2 -2
  21. package/dist/gas-flows/DefaultGasFeeFlow.d.mts.map +1 -1
  22. package/dist/gas-flows/DefaultGasFeeFlow.mjs +3 -1
  23. package/dist/gas-flows/DefaultGasFeeFlow.mjs.map +1 -1
  24. package/dist/gas-flows/LineaGasFeeFlow.cjs +1 -1
  25. package/dist/gas-flows/LineaGasFeeFlow.cjs.map +1 -1
  26. package/dist/gas-flows/LineaGasFeeFlow.d.cts +1 -5
  27. package/dist/gas-flows/LineaGasFeeFlow.d.cts.map +1 -1
  28. package/dist/gas-flows/LineaGasFeeFlow.d.mts +1 -5
  29. package/dist/gas-flows/LineaGasFeeFlow.d.mts.map +1 -1
  30. package/dist/gas-flows/LineaGasFeeFlow.mjs +1 -1
  31. package/dist/gas-flows/LineaGasFeeFlow.mjs.map +1 -1
  32. package/dist/gas-flows/OptimismLayer1GasFeeFlow.cjs +1 -1
  33. package/dist/gas-flows/OptimismLayer1GasFeeFlow.cjs.map +1 -1
  34. package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.cts +1 -5
  35. package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.cts.map +1 -1
  36. package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.mts +1 -5
  37. package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.mts.map +1 -1
  38. package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs +1 -1
  39. package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs.map +1 -1
  40. package/dist/gas-flows/OracleLayer1GasFeeFlow.cjs.map +1 -1
  41. package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts +1 -5
  42. package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts.map +1 -1
  43. package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts +1 -5
  44. package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts.map +1 -1
  45. package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs.map +1 -1
  46. package/dist/gas-flows/ScrollLayer1GasFeeFlow.cjs +1 -1
  47. package/dist/gas-flows/ScrollLayer1GasFeeFlow.cjs.map +1 -1
  48. package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.cts +1 -5
  49. package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.cts.map +1 -1
  50. package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.mts +1 -5
  51. package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.mts.map +1 -1
  52. package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs +1 -1
  53. package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs.map +1 -1
  54. package/dist/gas-flows/TestGasFeeFlow.cjs +1 -1
  55. package/dist/gas-flows/TestGasFeeFlow.cjs.map +1 -1
  56. package/dist/gas-flows/TestGasFeeFlow.d.cts +2 -2
  57. package/dist/gas-flows/TestGasFeeFlow.d.cts.map +1 -1
  58. package/dist/gas-flows/TestGasFeeFlow.d.mts +2 -2
  59. package/dist/gas-flows/TestGasFeeFlow.d.mts.map +1 -1
  60. package/dist/gas-flows/TestGasFeeFlow.mjs +1 -1
  61. package/dist/gas-flows/TestGasFeeFlow.mjs.map +1 -1
  62. package/dist/helpers/GasFeePoller.cjs +8 -11
  63. package/dist/helpers/GasFeePoller.cjs.map +1 -1
  64. package/dist/helpers/GasFeePoller.d.cts +5 -6
  65. package/dist/helpers/GasFeePoller.d.cts.map +1 -1
  66. package/dist/helpers/GasFeePoller.d.mts +5 -6
  67. package/dist/helpers/GasFeePoller.d.mts.map +1 -1
  68. package/dist/helpers/GasFeePoller.mjs +8 -11
  69. package/dist/helpers/GasFeePoller.mjs.map +1 -1
  70. package/dist/helpers/PendingTransactionTracker.cjs +2 -6
  71. package/dist/helpers/PendingTransactionTracker.cjs.map +1 -1
  72. package/dist/helpers/PendingTransactionTracker.d.cts +2 -5
  73. package/dist/helpers/PendingTransactionTracker.d.cts.map +1 -1
  74. package/dist/helpers/PendingTransactionTracker.d.mts +2 -5
  75. package/dist/helpers/PendingTransactionTracker.d.mts.map +1 -1
  76. package/dist/helpers/PendingTransactionTracker.mjs +2 -6
  77. package/dist/helpers/PendingTransactionTracker.mjs.map +1 -1
  78. package/dist/helpers/TransactionPoller.cjs +8 -12
  79. package/dist/helpers/TransactionPoller.cjs.map +1 -1
  80. package/dist/helpers/TransactionPoller.d.cts +3 -7
  81. package/dist/helpers/TransactionPoller.d.cts.map +1 -1
  82. package/dist/helpers/TransactionPoller.d.mts +3 -7
  83. package/dist/helpers/TransactionPoller.d.mts.map +1 -1
  84. package/dist/helpers/TransactionPoller.mjs +7 -11
  85. package/dist/helpers/TransactionPoller.mjs.map +1 -1
  86. package/dist/types.cjs.map +1 -1
  87. package/dist/types.d.cts +5 -18
  88. package/dist/types.d.cts.map +1 -1
  89. package/dist/types.d.mts +5 -18
  90. package/dist/types.d.mts.map +1 -1
  91. package/dist/types.mjs.map +1 -1
  92. package/dist/utils/feature-flags.cjs +1 -37
  93. package/dist/utils/feature-flags.cjs.map +1 -1
  94. package/dist/utils/feature-flags.d.cts +0 -49
  95. package/dist/utils/feature-flags.d.cts.map +1 -1
  96. package/dist/utils/feature-flags.d.mts +0 -49
  97. package/dist/utils/feature-flags.d.mts.map +1 -1
  98. package/dist/utils/feature-flags.mjs +0 -34
  99. package/dist/utils/feature-flags.mjs.map +1 -1
  100. package/dist/utils/gas-fees.cjs +3 -21
  101. package/dist/utils/gas-fees.cjs.map +1 -1
  102. package/dist/utils/gas-fees.d.cts +0 -14
  103. package/dist/utils/gas-fees.d.cts.map +1 -1
  104. package/dist/utils/gas-fees.d.mts +0 -14
  105. package/dist/utils/gas-fees.d.mts.map +1 -1
  106. package/dist/utils/gas-fees.mjs +2 -19
  107. package/dist/utils/gas-fees.mjs.map +1 -1
  108. package/dist/utils/gas-flow.cjs +2 -3
  109. package/dist/utils/gas-flow.cjs.map +1 -1
  110. package/dist/utils/gas-flow.d.cts +1 -3
  111. package/dist/utils/gas-flow.d.cts.map +1 -1
  112. package/dist/utils/gas-flow.d.mts +1 -3
  113. package/dist/utils/gas-flow.d.mts.map +1 -1
  114. package/dist/utils/gas-flow.mjs +2 -3
  115. package/dist/utils/gas-flow.mjs.map +1 -1
  116. package/dist/utils/layer1-gas-fee-flow.cjs +4 -9
  117. package/dist/utils/layer1-gas-fee-flow.cjs.map +1 -1
  118. package/dist/utils/layer1-gas-fee-flow.d.cts +1 -4
  119. package/dist/utils/layer1-gas-fee-flow.d.cts.map +1 -1
  120. package/dist/utils/layer1-gas-fee-flow.d.mts +1 -4
  121. package/dist/utils/layer1-gas-fee-flow.d.mts.map +1 -1
  122. package/dist/utils/layer1-gas-fee-flow.mjs +4 -9
  123. package/dist/utils/layer1-gas-fee-flow.mjs.map +1 -1
  124. package/dist/utils/utils.cjs +1 -23
  125. package/dist/utils/utils.cjs.map +1 -1
  126. package/dist/utils/utils.d.cts +0 -8
  127. package/dist/utils/utils.d.cts.map +1 -1
  128. package/dist/utils/utils.d.mts +0 -8
  129. package/dist/utils/utils.d.mts.map +1 -1
  130. package/dist/utils/utils.mjs +1 -22
  131. package/dist/utils/utils.mjs.map +1 -1
  132. package/package.json +1 -1
  133. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs +0 -123
  134. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs.map +0 -1
  135. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts +0 -28
  136. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts.map +0 -1
  137. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts +0 -28
  138. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts.map +0 -1
  139. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs +0 -118
  140. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -7,11 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
- ### Added
11
-
12
- - Adds `RandomisedEstimationsGasFeeFlow` to gas fee flows in `TransactionController` ([#5511](https://github.com/MetaMask/core/pull/5511))
13
- - Added flow only will be activated if chainId is defined in feature flags.
14
-
15
10
  ### Fixed
16
11
 
17
12
  - Fix simulation of type-4 transactions ([#5552](https://github.com/MetaMask/core/pull/5552))
@@ -32,7 +32,6 @@ const accounts_api_1 = require("./api/accounts-api.cjs");
32
32
  const DefaultGasFeeFlow_1 = require("./gas-flows/DefaultGasFeeFlow.cjs");
33
33
  const LineaGasFeeFlow_1 = require("./gas-flows/LineaGasFeeFlow.cjs");
34
34
  const OptimismLayer1GasFeeFlow_1 = require("./gas-flows/OptimismLayer1GasFeeFlow.cjs");
35
- const RandomisedEstimationsGasFeeFlow_1 = require("./gas-flows/RandomisedEstimationsGasFeeFlow.cjs");
36
35
  const ScrollLayer1GasFeeFlow_1 = require("./gas-flows/ScrollLayer1GasFeeFlow.cjs");
37
36
  const TestGasFeeFlow_1 = require("./gas-flows/TestGasFeeFlow.cjs");
38
37
  const AccountsApiRemoteTransactionSource_1 = require("./helpers/AccountsApiRemoteTransactionSource.cjs");
@@ -249,7 +248,6 @@ class TransactionController extends base_controller_1.BaseController {
249
248
  getProvider: (networkClientId) => __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getProvider).call(this, { networkClientId }),
250
249
  getTransactions: () => this.state.transactions,
251
250
  layer1GasFeeFlows: this.layer1GasFeeFlows,
252
- messenger: this.messagingSystem,
253
251
  onStateChange: (listener) => {
254
252
  this.messagingSystem.subscribe('TransactionController:stateChange', listener);
255
253
  },
@@ -400,10 +398,6 @@ class TransactionController extends base_controller_1.BaseController {
400
398
  const delegationAddressPromise = (0, eip7702_1.getDelegationAddress)(txParams.from, ethQuery).catch(() => undefined);
401
399
  const isEIP1559Compatible = await this.getEIP1559Compatibility(networkClientId);
402
400
  (0, validation_1.validateTxParams)(txParams, isEIP1559Compatible);
403
- if (!txParams.type) {
404
- // Determine transaction type based on transaction parameters and network compatibility
405
- (0, utils_2.setEnvelopeType)(txParams, isEIP1559Compatible);
406
- }
407
401
  const isDuplicateBatchId = batchId?.length &&
408
402
  this.state.transactions.some((tx) => tx.batchId?.toLowerCase() === batchId?.toLowerCase());
409
403
  if (isDuplicateBatchId && origin && origin !== controller_utils_1.ORIGIN_METAMASK) {
@@ -844,7 +838,6 @@ class TransactionController extends base_controller_1.BaseController {
844
838
  updatedTransaction.type = type;
845
839
  await (0, layer1_gas_fee_flow_1.updateTransactionLayer1GasFee)({
846
840
  layer1GasFeeFlows: this.layer1GasFeeFlows,
847
- messenger: this.messagingSystem,
848
841
  provider,
849
842
  transactionMeta: updatedTransaction,
850
843
  });
@@ -1057,7 +1050,7 @@ class TransactionController extends base_controller_1.BaseController {
1057
1050
  networkClientId,
1058
1051
  };
1059
1052
  // Guaranteed as the default gas fee flow matches all transactions.
1060
- const gasFeeFlow = (0, gas_flow_1.getGasFeeFlow)(transactionMeta, this.gasFeeFlows, this.messagingSystem);
1053
+ const gasFeeFlow = (0, gas_flow_1.getGasFeeFlow)(transactionMeta, this.gasFeeFlows);
1061
1054
  const ethQuery = new eth_query_1.default(provider);
1062
1055
  const gasFeeControllerData = await this.getGasFeeEstimates({
1063
1056
  networkClientId,
@@ -1065,7 +1058,6 @@ class TransactionController extends base_controller_1.BaseController {
1065
1058
  return gasFeeFlow.getGasFees({
1066
1059
  ethQuery,
1067
1060
  gasFeeControllerData,
1068
- messenger: this.messagingSystem,
1069
1061
  transactionMeta,
1070
1062
  });
1071
1063
  }
@@ -1085,7 +1077,6 @@ class TransactionController extends base_controller_1.BaseController {
1085
1077
  });
1086
1078
  return await (0, layer1_gas_fee_flow_1.getTransactionLayer1GasFee)({
1087
1079
  layer1GasFeeFlows: this.layer1GasFeeFlows,
1088
- messenger: this.messagingSystem,
1089
1080
  provider,
1090
1081
  transactionMeta: {
1091
1082
  txParams: transactionParams,
@@ -1244,12 +1235,10 @@ class TransactionController extends base_controller_1.BaseController {
1244
1235
  gasFeeFlows: this.gasFeeFlows,
1245
1236
  getGasFeeEstimates: this.getGasFeeEstimates,
1246
1237
  getSavedGasFees: this.getSavedGasFees.bind(this),
1247
- messenger: this.messagingSystem,
1248
1238
  txMeta: transactionMeta,
1249
1239
  }));
1250
1240
  await __classPrivateFieldGet(this, _TransactionController_trace, "f").call(this, { name: 'Update Layer 1 Gas Fees', parentContext: traceContext }, async () => await (0, layer1_gas_fee_flow_1.updateTransactionLayer1GasFee)({
1251
1241
  layer1GasFeeFlows: this.layer1GasFeeFlows,
1252
- messenger: this.messagingSystem,
1253
1242
  provider,
1254
1243
  transactionMeta,
1255
1244
  }));
@@ -1960,7 +1949,6 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
1960
1949
  getGlobalLock: () => __classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").acquireNonceLockForChainIdKey({
1961
1950
  chainId,
1962
1951
  }),
1963
- messenger: this.messagingSystem,
1964
1952
  publishTransaction: (_ethQuery, transactionMeta) => this.publishTransaction(_ethQuery, transactionMeta, {
1965
1953
  skipSubmitHistory: true,
1966
1954
  }),
@@ -1997,11 +1985,7 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
1997
1985
  if (__classPrivateFieldGet(this, _TransactionController_testGasFeeFlows, "f")) {
1998
1986
  return [new TestGasFeeFlow_1.TestGasFeeFlow()];
1999
1987
  }
2000
- return [
2001
- new RandomisedEstimationsGasFeeFlow_1.RandomisedEstimationsGasFeeFlow(),
2002
- new LineaGasFeeFlow_1.LineaGasFeeFlow(),
2003
- new DefaultGasFeeFlow_1.DefaultGasFeeFlow(),
2004
- ];
1988
+ return [new LineaGasFeeFlow_1.LineaGasFeeFlow(), new DefaultGasFeeFlow_1.DefaultGasFeeFlow()];
2005
1989
  }, _TransactionController_getLayer1GasFeeFlows = function _TransactionController_getLayer1GasFeeFlows() {
2006
1990
  return [new OptimismLayer1GasFeeFlow_1.OptimismLayer1GasFeeFlow(), new ScrollLayer1GasFeeFlow_1.ScrollLayer1GasFeeFlow()];
2007
1991
  }, _TransactionController_updateTransactionInternal = function _TransactionController_updateTransactionInternal({ transactionId, note, skipHistory, skipValidation, skipResimulateCheck, }, callback) {
@@ -2132,10 +2116,12 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
2132
2116
  (0, logger_1.projectLogger)('Updated simulation data', transactionId, simulationData);
2133
2117
  }, _TransactionController_onGasFeePollerTransactionUpdate = function _TransactionController_onGasFeePollerTransactionUpdate({ transactionId, gasFeeEstimates, gasFeeEstimatesLoaded, layer1GasFee, }) {
2134
2118
  __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId, skipHistory: true }, (txMeta) => {
2119
+ // eslint-disable-next-line @typescript-eslint/no-floating-promises
2135
2120
  (0, GasFeePoller_1.updateTransactionGasFees)({
2136
2121
  txMeta,
2137
2122
  gasFeeEstimates,
2138
2123
  gasFeeEstimatesLoaded,
2124
+ getEIP1559Compatibility: this.getEIP1559Compatibility.bind(this),
2139
2125
  isTxParamsGasFeeUpdatesEnabled: this.isTxParamsGasFeeUpdatesEnabled,
2140
2126
  layer1GasFee,
2141
2127
  });