@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.
- package/CHANGELOG.md +0 -5
- package/dist/TransactionController.cjs +4 -18
- package/dist/TransactionController.cjs.map +1 -1
- package/dist/TransactionController.d.cts.map +1 -1
- package/dist/TransactionController.d.mts.map +1 -1
- package/dist/TransactionController.mjs +5 -19
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/constants.cjs +0 -1
- package/dist/constants.cjs.map +1 -1
- package/dist/constants.d.cts +0 -1
- package/dist/constants.d.cts.map +1 -1
- package/dist/constants.d.mts +0 -1
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +0 -1
- package/dist/constants.mjs.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.cjs +3 -1
- package/dist/gas-flows/DefaultGasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.d.cts +2 -2
- package/dist/gas-flows/DefaultGasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.d.mts +2 -2
- package/dist/gas-flows/DefaultGasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.mjs +3 -1
- package/dist/gas-flows/DefaultGasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.cjs +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.d.cts +1 -5
- package/dist/gas-flows/LineaGasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.d.mts +1 -5
- package/dist/gas-flows/LineaGasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.mjs +1 -1
- package/dist/gas-flows/LineaGasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.cjs +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.cts +1 -5
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.mts +1 -5
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs +1 -1
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts +1 -5
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts +1 -5
- package/dist/gas-flows/OracleLayer1GasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.cjs +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.cts +1 -5
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.mts +1 -5
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs +1 -1
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.cjs +1 -1
- package/dist/gas-flows/TestGasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.d.cts +2 -2
- package/dist/gas-flows/TestGasFeeFlow.d.cts.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.d.mts +2 -2
- package/dist/gas-flows/TestGasFeeFlow.d.mts.map +1 -1
- package/dist/gas-flows/TestGasFeeFlow.mjs +1 -1
- package/dist/gas-flows/TestGasFeeFlow.mjs.map +1 -1
- package/dist/helpers/GasFeePoller.cjs +8 -11
- package/dist/helpers/GasFeePoller.cjs.map +1 -1
- package/dist/helpers/GasFeePoller.d.cts +5 -6
- package/dist/helpers/GasFeePoller.d.cts.map +1 -1
- package/dist/helpers/GasFeePoller.d.mts +5 -6
- package/dist/helpers/GasFeePoller.d.mts.map +1 -1
- package/dist/helpers/GasFeePoller.mjs +8 -11
- package/dist/helpers/GasFeePoller.mjs.map +1 -1
- package/dist/helpers/PendingTransactionTracker.cjs +2 -6
- package/dist/helpers/PendingTransactionTracker.cjs.map +1 -1
- package/dist/helpers/PendingTransactionTracker.d.cts +2 -5
- package/dist/helpers/PendingTransactionTracker.d.cts.map +1 -1
- package/dist/helpers/PendingTransactionTracker.d.mts +2 -5
- package/dist/helpers/PendingTransactionTracker.d.mts.map +1 -1
- package/dist/helpers/PendingTransactionTracker.mjs +2 -6
- package/dist/helpers/PendingTransactionTracker.mjs.map +1 -1
- package/dist/helpers/TransactionPoller.cjs +8 -12
- package/dist/helpers/TransactionPoller.cjs.map +1 -1
- package/dist/helpers/TransactionPoller.d.cts +3 -7
- package/dist/helpers/TransactionPoller.d.cts.map +1 -1
- package/dist/helpers/TransactionPoller.d.mts +3 -7
- package/dist/helpers/TransactionPoller.d.mts.map +1 -1
- package/dist/helpers/TransactionPoller.mjs +7 -11
- package/dist/helpers/TransactionPoller.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +5 -18
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +5 -18
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/feature-flags.cjs +1 -37
- package/dist/utils/feature-flags.cjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +0 -49
- package/dist/utils/feature-flags.d.cts.map +1 -1
- package/dist/utils/feature-flags.d.mts +0 -49
- package/dist/utils/feature-flags.d.mts.map +1 -1
- package/dist/utils/feature-flags.mjs +0 -34
- package/dist/utils/feature-flags.mjs.map +1 -1
- package/dist/utils/gas-fees.cjs +3 -21
- package/dist/utils/gas-fees.cjs.map +1 -1
- package/dist/utils/gas-fees.d.cts +0 -14
- package/dist/utils/gas-fees.d.cts.map +1 -1
- package/dist/utils/gas-fees.d.mts +0 -14
- package/dist/utils/gas-fees.d.mts.map +1 -1
- package/dist/utils/gas-fees.mjs +2 -19
- package/dist/utils/gas-fees.mjs.map +1 -1
- package/dist/utils/gas-flow.cjs +2 -3
- package/dist/utils/gas-flow.cjs.map +1 -1
- package/dist/utils/gas-flow.d.cts +1 -3
- package/dist/utils/gas-flow.d.cts.map +1 -1
- package/dist/utils/gas-flow.d.mts +1 -3
- package/dist/utils/gas-flow.d.mts.map +1 -1
- package/dist/utils/gas-flow.mjs +2 -3
- package/dist/utils/gas-flow.mjs.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.cjs +4 -9
- package/dist/utils/layer1-gas-fee-flow.cjs.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.d.cts +1 -4
- package/dist/utils/layer1-gas-fee-flow.d.cts.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.d.mts +1 -4
- package/dist/utils/layer1-gas-fee-flow.d.mts.map +1 -1
- package/dist/utils/layer1-gas-fee-flow.mjs +4 -9
- package/dist/utils/layer1-gas-fee-flow.mjs.map +1 -1
- package/dist/utils/utils.cjs +1 -23
- package/dist/utils/utils.cjs.map +1 -1
- package/dist/utils/utils.d.cts +0 -8
- package/dist/utils/utils.d.cts.map +1 -1
- package/dist/utils/utils.d.mts +0 -8
- package/dist/utils/utils.d.mts.map +1 -1
- package/dist/utils/utils.mjs +1 -22
- package/dist/utils/utils.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs +0 -123
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs.map +0 -1
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts +0 -28
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts.map +0 -1
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts +0 -28
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts.map +0 -1
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs +0 -118
- 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
|
|
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
|
});
|