@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.
- package/dist/TransactionController.cjs +12 -2
- 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 +12 -2
- package/dist/TransactionController.mjs.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.cjs +0 -1
- package/dist/gas-flows/DefaultGasFeeFlow.cjs.map +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.mjs +0 -1
- package/dist/gas-flows/DefaultGasFeeFlow.mjs.map +1 -1
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs +159 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.cjs.map +1 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts +11 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.cts.map +1 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts +11 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.d.mts.map +1 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs +155 -0
- package/dist/gas-flows/RandomisedEstimationsGasFeeFlow.mjs.map +1 -0
- package/dist/helpers/GasFeePoller.cjs +10 -4
- package/dist/helpers/GasFeePoller.cjs.map +1 -1
- package/dist/helpers/GasFeePoller.d.cts +4 -1
- package/dist/helpers/GasFeePoller.d.cts.map +1 -1
- package/dist/helpers/GasFeePoller.d.mts +4 -1
- package/dist/helpers/GasFeePoller.d.mts.map +1 -1
- package/dist/helpers/GasFeePoller.mjs +10 -4
- package/dist/helpers/GasFeePoller.mjs.map +1 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +4 -1
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +4 -1
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/feature-flags.cjs +3 -1
- package/dist/utils/feature-flags.cjs.map +1 -1
- package/dist/utils/feature-flags.d.cts +16 -0
- package/dist/utils/feature-flags.d.cts.map +1 -1
- package/dist/utils/feature-flags.d.mts +16 -0
- package/dist/utils/feature-flags.d.mts.map +1 -1
- package/dist/utils/feature-flags.mjs +2 -1
- package/dist/utils/feature-flags.mjs.map +1 -1
- package/dist/utils/gas-fees.cjs +3 -2
- package/dist/utils/gas-fees.cjs.map +1 -1
- package/dist/utils/gas-fees.d.cts +2 -0
- package/dist/utils/gas-fees.d.cts.map +1 -1
- package/dist/utils/gas-fees.d.mts +2 -0
- package/dist/utils/gas-fees.d.mts.map +1 -1
- package/dist/utils/gas-fees.mjs +3 -2
- package/dist/utils/gas-fees.mjs.map +1 -1
- package/dist/utils/gas-flow.cjs +3 -2
- package/dist/utils/gas-flow.cjs.map +1 -1
- package/dist/utils/gas-flow.d.cts +3 -1
- package/dist/utils/gas-flow.d.cts.map +1 -1
- package/dist/utils/gas-flow.d.mts +3 -1
- package/dist/utils/gas-flow.d.mts.map +1 -1
- package/dist/utils/gas-flow.mjs +3 -2
- package/dist/utils/gas-flow.mjs.map +1 -1
- 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 [
|
|
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) {
|