@metamask-previews/transaction-controller 43.0.0-preview-f3d5e317 → 43.0.0-preview-37da015

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,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 ability of re-simulating transaction depending on the `isFocused` property on `transactionMeta` ([#5189](https://github.com/MetaMask/core/pull/5189))
13
- - `isFocused` property is expected to set by client.
14
-
15
10
  ## [43.0.0]
16
11
 
17
12
  ### Added
@@ -44,7 +44,6 @@ const IncomingTransactionHelper_1 = require("./helpers/IncomingTransactionHelper
44
44
  const MethodDataHelper_1 = require("./helpers/MethodDataHelper.cjs");
45
45
  const MultichainTrackingHelper_1 = require("./helpers/MultichainTrackingHelper.cjs");
46
46
  const PendingTransactionTracker_1 = require("./helpers/PendingTransactionTracker.cjs");
47
- const ResimulateHelper_1 = require("./helpers/ResimulateHelper.cjs");
48
47
  const logger_1 = require("./logger.cjs");
49
48
  const types_1 = require("./types.cjs");
50
49
  const external_transactions_1 = require("./utils/external-transactions.cjs");
@@ -54,6 +53,7 @@ const gas_flow_1 = require("./utils/gas-flow.cjs");
54
53
  const history_1 = require("./utils/history.cjs");
55
54
  const layer1_gas_fee_flow_1 = require("./utils/layer1-gas-fee-flow.cjs");
56
55
  const nonce_1 = require("./utils/nonce.cjs");
56
+ const resimulate_1 = require("./utils/resimulate.cjs");
57
57
  const retry_1 = require("./utils/retry.cjs");
58
58
  const simulation_1 = require("./utils/simulation.cjs");
59
59
  const swaps_1 = require("./utils/swaps.cjs");
@@ -304,17 +304,6 @@ class TransactionController extends base_controller_1.BaseController {
304
304
  // when transactionsController state changes
305
305
  // check for pending transactions and start polling if there are any
306
306
  this.messagingSystem.subscribe('TransactionController:stateChange', __classPrivateFieldGet(this, _TransactionController_checkForPendingTransactionAndStartPolling, "f"));
307
- new ResimulateHelper_1.ResimulateHelper({
308
- getBlockTracker: (networkClientId) => {
309
- const { blockTracker } = this.messagingSystem.call(`NetworkController:getNetworkClientById`, networkClientId);
310
- return blockTracker;
311
- },
312
- updateSimulationData: __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateSimulationData).bind(this),
313
- onStateChange: (listener) => {
314
- this.messagingSystem.subscribe('TransactionController:stateChange', listener);
315
- },
316
- getTransactions: () => this.state.transactions,
317
- });
318
307
  this.onBootCleanup();
319
308
  __classPrivateFieldGet(this, _TransactionController_checkForPendingTransactionAndStartPolling, "f").call(this);
320
309
  }
@@ -800,22 +789,6 @@ class TransactionController extends base_controller_1.BaseController {
800
789
  this.updateTransaction(updatedTransaction, `Update Editable Params for ${txId}`);
801
790
  return this.getTransaction(txId);
802
791
  }
803
- /**
804
- * Update the isFocus state of a transaction.
805
- * @param transactionId - The ID of the transaction to update.
806
- * @param isFocused - The new focus state.
807
- */
808
- updateTransactionFocus(transactionId, isFocused) {
809
- const transactionMeta = this.getTransaction(transactionId);
810
- if (!transactionMeta) {
811
- throw new Error(`Transaction with id ${transactionId} not found`);
812
- }
813
- const updatedTransactionMeta = {
814
- ...transactionMeta,
815
- isFocused,
816
- };
817
- this.updateTransaction(updatedTransactionMeta, 'TransactionController#updateTransactionFocus - Transaction focus updated');
818
- }
819
792
  /**
820
793
  * Signs and returns the raw transaction data for provided transaction params list.
821
794
  *
@@ -1896,7 +1869,7 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
1896
1869
  (0, validation_1.validateTxParams)(transactionMeta.txParams);
1897
1870
  }
1898
1871
  if (!skipResimulateCheck && __classPrivateFieldGet(this, _TransactionController_isSimulationEnabled, "f").call(this)) {
1899
- resimulateResponse = (0, ResimulateHelper_1.shouldResimulate)(originalTransactionMeta, transactionMeta);
1872
+ resimulateResponse = (0, resimulate_1.shouldResimulate)(originalTransactionMeta, transactionMeta);
1900
1873
  }
1901
1874
  const shouldSkipHistory = this.isHistoryDisabled || skipHistory;
1902
1875
  if (!shouldSkipHistory) {
@@ -1978,7 +1951,7 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
1978
1951
  }));
1979
1952
  if (blockTime &&
1980
1953
  prevSimulationData &&
1981
- (0, ResimulateHelper_1.hasSimulationDataChanged)(prevSimulationData, simulationData)) {
1954
+ (0, resimulate_1.hasSimulationDataChanged)(prevSimulationData, simulationData)) {
1982
1955
  simulationData = {
1983
1956
  ...simulationData,
1984
1957
  isUpdatedAfterSecurityCheck: true,
@@ -1998,6 +1971,7 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
1998
1971
  }, (txMeta) => {
1999
1972
  txMeta.simulationData = simulationData;
2000
1973
  });
1974
+ (0, logger_1.projectLogger)('Updated simulation data', transactionId, simulationData);
2001
1975
  }, _TransactionController_onGasFeePollerTransactionUpdate = function _TransactionController_onGasFeePollerTransactionUpdate({ transactionId, gasFeeEstimates, gasFeeEstimatesLoaded, layer1GasFee, }) {
2002
1976
  __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_updateTransactionInternal).call(this, { transactionId, skipHistory: true }, (txMeta) => {
2003
1977
  if (gasFeeEstimates) {