@metamask-previews/transaction-controller 50.0.0-preview-e744341c → 50.0.0-preview-f15cb863

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 (57) hide show
  1. package/dist/TransactionController.cjs +12 -2
  2. package/dist/TransactionController.cjs.map +1 -1
  3. package/dist/TransactionController.d.cts.map +1 -1
  4. package/dist/TransactionController.d.mts.map +1 -1
  5. package/dist/TransactionController.mjs +12 -2
  6. package/dist/TransactionController.mjs.map +1 -1
  7. package/dist/gas-flows/DefaultGasFeeFlow.cjs +0 -1
  8. package/dist/gas-flows/DefaultGasFeeFlow.cjs.map +1 -1
  9. package/dist/gas-flows/DefaultGasFeeFlow.mjs +0 -1
  10. package/dist/gas-flows/DefaultGasFeeFlow.mjs.map +1 -1
  11. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs +159 -0
  12. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs.map +1 -0
  13. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts +11 -0
  14. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts.map +1 -0
  15. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts +11 -0
  16. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts.map +1 -0
  17. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs +155 -0
  18. package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs.map +1 -0
  19. package/dist/helpers/GasFeePoller.cjs +10 -4
  20. package/dist/helpers/GasFeePoller.cjs.map +1 -1
  21. package/dist/helpers/GasFeePoller.d.cts +4 -1
  22. package/dist/helpers/GasFeePoller.d.cts.map +1 -1
  23. package/dist/helpers/GasFeePoller.d.mts +4 -1
  24. package/dist/helpers/GasFeePoller.d.mts.map +1 -1
  25. package/dist/helpers/GasFeePoller.mjs +10 -4
  26. package/dist/helpers/GasFeePoller.mjs.map +1 -1
  27. package/dist/types.cjs.map +1 -1
  28. package/dist/types.d.cts +4 -1
  29. package/dist/types.d.cts.map +1 -1
  30. package/dist/types.d.mts +4 -1
  31. package/dist/types.d.mts.map +1 -1
  32. package/dist/types.mjs.map +1 -1
  33. package/dist/utils/feature-flags.cjs +3 -1
  34. package/dist/utils/feature-flags.cjs.map +1 -1
  35. package/dist/utils/feature-flags.d.cts +16 -0
  36. package/dist/utils/feature-flags.d.cts.map +1 -1
  37. package/dist/utils/feature-flags.d.mts +16 -0
  38. package/dist/utils/feature-flags.d.mts.map +1 -1
  39. package/dist/utils/feature-flags.mjs +2 -1
  40. package/dist/utils/feature-flags.mjs.map +1 -1
  41. package/dist/utils/gas-fees.cjs +3 -2
  42. package/dist/utils/gas-fees.cjs.map +1 -1
  43. package/dist/utils/gas-fees.d.cts +2 -0
  44. package/dist/utils/gas-fees.d.cts.map +1 -1
  45. package/dist/utils/gas-fees.d.mts +2 -0
  46. package/dist/utils/gas-fees.d.mts.map +1 -1
  47. package/dist/utils/gas-fees.mjs +3 -2
  48. package/dist/utils/gas-fees.mjs.map +1 -1
  49. package/dist/utils/gas-flow.cjs +3 -2
  50. package/dist/utils/gas-flow.cjs.map +1 -1
  51. package/dist/utils/gas-flow.d.cts +3 -1
  52. package/dist/utils/gas-flow.d.cts.map +1 -1
  53. package/dist/utils/gas-flow.d.mts +3 -1
  54. package/dist/utils/gas-flow.d.mts.map +1 -1
  55. package/dist/utils/gas-flow.mjs +3 -2
  56. package/dist/utils/gas-flow.mjs.map +1 -1
  57. package/package.json +1 -1
@@ -33,6 +33,7 @@ const accounts_api_1 = require("./api/accounts-api.cjs");
33
33
  const DefaultGasFeeFlow_1 = require("./gas-flows/DefaultGasFeeFlow.cjs");
34
34
  const LineaGasFeeFlow_1 = require("./gas-flows/LineaGasFeeFlow.cjs");
35
35
  const OptimismLayer1GasFeeFlow_1 = require("./gas-flows/OptimismLayer1GasFeeFlow.cjs");
36
+ const RandomisedEstimationsGasFeeFlow_1 = require("./gas-flows/RandomisedEstimationsGasFeeFlow.cjs");
36
37
  const ScrollLayer1GasFeeFlow_1 = require("./gas-flows/ScrollLayer1GasFeeFlow.cjs");
37
38
  const TestGasFeeFlow_1 = require("./gas-flows/TestGasFeeFlow.cjs");
38
39
  const AccountsApiRemoteTransactionSource_1 = require("./helpers/AccountsApiRemoteTransactionSource.cjs");
@@ -47,6 +48,7 @@ const types_1 = require("./types.cjs");
47
48
  const batch_1 = require("./utils/batch.cjs");
48
49
  const eip7702_1 = require("./utils/eip7702.cjs");
49
50
  const external_transactions_1 = require("./utils/external-transactions.cjs");
51
+ const feature_flags_1 = require("./utils/feature-flags.cjs");
50
52
  const gas_1 = require("./utils/gas.cjs");
51
53
  const gas_fees_1 = require("./utils/gas-fees.cjs");
52
54
  const gas_flow_1 = require("./utils/gas-flow.cjs");
@@ -247,6 +249,7 @@ class TransactionController extends base_controller_1.BaseController {
247
249
  getProvider: (networkClientId) => __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getProvider).call(this, { networkClientId }),
248
250
  getTransactions: () => this.state.transactions,
249
251
  layer1GasFeeFlows: this.layer1GasFeeFlows,
252
+ messenger: this.messagingSystem,
250
253
  onStateChange: (listener) => {
251
254
  this.messagingSystem.subscribe('TransactionController:stateChange', listener);
252
255
  },
@@ -1031,19 +1034,21 @@ class TransactionController extends base_controller_1.BaseController {
1031
1034
  chainId,
1032
1035
  networkClientId: requestNetworkClientId,
1033
1036
  });
1037
+ const featureFlags = (0, feature_flags_1.getFeatureFlags)(this.messagingSystem);
1034
1038
  const transactionMeta = {
1035
1039
  txParams: transactionParams,
1036
1040
  chainId,
1037
1041
  networkClientId,
1038
1042
  };
1039
1043
  // Guaranteed as the default gas fee flow matches all transactions.
1040
- const gasFeeFlow = (0, gas_flow_1.getGasFeeFlow)(transactionMeta, this.gasFeeFlows);
1044
+ const gasFeeFlow = (0, gas_flow_1.getGasFeeFlow)(transactionMeta, this.gasFeeFlows, featureFlags);
1041
1045
  const ethQuery = new eth_query_1.default(provider);
1042
1046
  const gasFeeControllerData = await this.getGasFeeEstimates({
1043
1047
  networkClientId,
1044
1048
  });
1045
1049
  return gasFeeFlow.getGasFees({
1046
1050
  ethQuery,
1051
+ featureFlags,
1047
1052
  gasFeeControllerData,
1048
1053
  transactionMeta,
1049
1054
  });
@@ -1187,6 +1192,7 @@ class TransactionController extends base_controller_1.BaseController {
1187
1192
  await __classPrivateFieldGet(this, _TransactionController_trace, "f").call(this, { name: 'Update Gas Fees', parentContext: traceContext }, async () => await (0, gas_fees_1.updateGasFees)({
1188
1193
  eip1559: isEIP1559Compatible,
1189
1194
  ethQuery,
1195
+ featureFlags: (0, feature_flags_1.getFeatureFlags)(this.messagingSystem),
1190
1196
  gasFeeFlows: this.gasFeeFlows,
1191
1197
  getGasFeeEstimates: this.getGasFeeEstimates,
1192
1198
  getSavedGasFees: this.getSavedGasFees.bind(this),
@@ -1923,7 +1929,11 @@ _TransactionController_internalEvents = new WeakMap(), _TransactionController_me
1923
1929
  if (__classPrivateFieldGet(this, _TransactionController_testGasFeeFlows, "f")) {
1924
1930
  return [new TestGasFeeFlow_1.TestGasFeeFlow()];
1925
1931
  }
1926
- return [new LineaGasFeeFlow_1.LineaGasFeeFlow(), new DefaultGasFeeFlow_1.DefaultGasFeeFlow()];
1932
+ return [
1933
+ new RandomisedEstimationsGasFeeFlow_1.RandomisedEstimationsGasFeeFlow(),
1934
+ new LineaGasFeeFlow_1.LineaGasFeeFlow(),
1935
+ new DefaultGasFeeFlow_1.DefaultGasFeeFlow(),
1936
+ ];
1927
1937
  }, _TransactionController_getLayer1GasFeeFlows = function _TransactionController_getLayer1GasFeeFlows() {
1928
1938
  return [new OptimismLayer1GasFeeFlow_1.OptimismLayer1GasFeeFlow(), new ScrollLayer1GasFeeFlow_1.ScrollLayer1GasFeeFlow()];
1929
1939
  }, _TransactionController_updateTransactionInternal = function _TransactionController_updateTransactionInternal({ transactionId, note, skipHistory, skipValidation, skipResimulateCheck, }, callback) {