@metamask/transaction-controller 27.0.1 → 28.1.0
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 +19 -1
- package/dist/TransactionController.js +19 -17
- package/dist/TransactionController.mjs +18 -16
- package/dist/{chunk-5WFLNKCL.js → chunk-2XKEAKQG.js} +11 -5
- package/dist/chunk-2XKEAKQG.js.map +1 -0
- package/dist/{chunk-LYD4TEKH.js → chunk-4RJXBKSR.js} +5 -5
- package/dist/{chunk-DRSMLO7B.mjs → chunk-5G6OHAXI.mjs} +2 -2
- package/dist/{chunk-CPYXP2OC.js → chunk-5XQ2KRYL.js} +3 -3
- package/dist/{chunk-WLCFETHR.js → chunk-C2LNDHP4.js} +10 -10
- package/dist/{chunk-TKWTUPCQ.mjs → chunk-CPMTUMMZ.mjs} +3 -3
- package/dist/{chunk-5SKCGFUC.js → chunk-DMMUAJKY.js} +106 -66
- package/dist/chunk-DMMUAJKY.js.map +1 -0
- package/dist/{chunk-L337FYVS.js → chunk-EQNKFFTM.js} +3 -3
- package/dist/{chunk-3JEUO765.js → chunk-EQT25RSP.js} +6 -6
- package/dist/{chunk-RXRJSBSF.mjs → chunk-F6E3TTR3.mjs} +2 -2
- package/dist/{chunk-F247MMTE.js → chunk-FDUCRHYT.js} +3 -3
- package/dist/chunk-FG74Z3F5.mjs +102 -0
- package/dist/chunk-FG74Z3F5.mjs.map +1 -0
- package/dist/{chunk-35MG26Y3.mjs → chunk-HHK4QSNF.mjs} +44 -34
- package/dist/chunk-HHK4QSNF.mjs.map +1 -0
- package/dist/{chunk-L7ZKSKEI.mjs → chunk-IZVRGO3P.mjs} +2 -2
- package/dist/{chunk-3VF7ZGRV.js → chunk-JAYYMCBQ.js} +4 -4
- package/dist/{chunk-P74YLPJO.mjs → chunk-LDXTSESK.mjs} +2 -2
- package/dist/{chunk-UBXRAA6G.js → chunk-LNX4JTOL.js} +3 -3
- package/dist/{chunk-JDLNCMGI.mjs → chunk-MG7HTD3H.mjs} +94 -54
- package/dist/chunk-MG7HTD3H.mjs.map +1 -0
- package/dist/{chunk-2XFBWPHD.mjs → chunk-NCRWKI6Y.mjs} +2 -2
- package/dist/{chunk-W3CS5GRD.mjs → chunk-NOHEXQ7Y.mjs} +11 -5
- package/dist/chunk-NOHEXQ7Y.mjs.map +1 -0
- package/dist/{chunk-CWWZQZVR.mjs → chunk-NPEXNXSY.mjs} +2 -2
- package/dist/chunk-NYKRCWBG.js +31 -0
- package/dist/chunk-NYKRCWBG.js.map +1 -0
- package/dist/{chunk-4VLQV2GA.mjs → chunk-O6ZZVIFH.mjs} +4 -2
- package/dist/{chunk-LQS2M5QR.js.map → chunk-O6ZZVIFH.mjs.map} +1 -1
- package/dist/{chunk-DOX6H5UJ.mjs → chunk-QZLPYOGC.mjs} +2 -2
- package/dist/{chunk-LQS2M5QR.js → chunk-UGN7PBON.js} +4 -2
- package/dist/chunk-UGN7PBON.js.map +1 -0
- package/dist/{chunk-HUVOOFOM.js → chunk-V6UIRCOF.js} +43 -33
- package/dist/chunk-V6UIRCOF.js.map +1 -0
- package/dist/{chunk-AO3AE3L7.js → chunk-V72C4MCR.js} +3 -3
- package/dist/chunk-VEVVBHP3.mjs +31 -0
- package/dist/chunk-VEVVBHP3.mjs.map +1 -0
- package/dist/chunk-WR5F34OW.js +23 -0
- package/dist/chunk-WR5F34OW.js.map +1 -0
- package/dist/chunk-YVCX6Z75.js +102 -0
- package/dist/chunk-YVCX6Z75.js.map +1 -0
- package/dist/chunk-Z4GV3YQQ.mjs +23 -0
- package/dist/chunk-Z4GV3YQQ.mjs.map +1 -0
- package/dist/{chunk-RBF6CW7D.mjs → chunk-ZGUNOEUQ.mjs} +2 -2
- package/dist/constants.js +2 -2
- package/dist/constants.mjs +1 -1
- package/dist/gas-flows/DefaultGasFeeFlow.js +5 -5
- package/dist/gas-flows/DefaultGasFeeFlow.mjs +4 -4
- package/dist/gas-flows/LineaGasFeeFlow.js +6 -6
- package/dist/gas-flows/LineaGasFeeFlow.mjs +5 -5
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.js +4 -3
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs +3 -2
- package/dist/gas-flows/OracleLayer1GasFeeFlow.js +9 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.js.map +1 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs +9 -0
- package/dist/gas-flows/OracleLayer1GasFeeFlow.mjs.map +1 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.js +11 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.js.map +1 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs +11 -0
- package/dist/gas-flows/ScrollLayer1GasFeeFlow.mjs.map +1 -0
- package/dist/helpers/EtherscanRemoteTransactionSource.js +4 -4
- package/dist/helpers/EtherscanRemoteTransactionSource.mjs +3 -3
- package/dist/helpers/GasFeePoller.js +3 -3
- package/dist/helpers/GasFeePoller.mjs +2 -2
- package/dist/helpers/MultichainTrackingHelper.js +5 -5
- package/dist/helpers/MultichainTrackingHelper.mjs +4 -4
- package/dist/index.js +19 -17
- package/dist/index.mjs +18 -16
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/TransactionController.d.ts +11 -6
- package/dist/types/TransactionController.d.ts.map +1 -1
- package/dist/types/constants.d.ts +2 -0
- package/dist/types/constants.d.ts.map +1 -1
- package/dist/types/gas-flows/OptimismLayer1GasFeeFlow.d.ts +5 -5
- package/dist/types/gas-flows/OptimismLayer1GasFeeFlow.d.ts.map +1 -1
- package/dist/types/gas-flows/OracleLayer1GasFeeFlow.d.ts +12 -0
- package/dist/types/gas-flows/OracleLayer1GasFeeFlow.d.ts.map +1 -0
- package/dist/types/gas-flows/ScrollLayer1GasFeeFlow.d.ts +10 -0
- package/dist/types/gas-flows/ScrollLayer1GasFeeFlow.d.ts.map +1 -0
- package/dist/types/helpers/GasFeePoller.d.ts.map +1 -1
- package/dist/types/utils/layer1-gas-fee-flow.d.ts.map +1 -1
- package/dist/utils/etherscan.js +3 -3
- package/dist/utils/etherscan.mjs +2 -2
- package/dist/utils/gas-fees.js +4 -4
- package/dist/utils/gas-fees.mjs +3 -3
- package/dist/utils/gas.js +3 -3
- package/dist/utils/gas.mjs +2 -2
- package/dist/utils/layer1-gas-fee-flow.js +2 -2
- package/dist/utils/layer1-gas-fee-flow.mjs +1 -1
- package/dist/utils/simulation.js +3 -3
- package/dist/utils/simulation.mjs +2 -2
- package/dist/utils/swaps.js +3 -3
- package/dist/utils/swaps.mjs +2 -2
- package/package.json +2 -2
- package/dist/chunk-35MG26Y3.mjs.map +0 -1
- package/dist/chunk-4VLQV2GA.mjs.map +0 -1
- package/dist/chunk-53IYIDVS.mjs +0 -132
- package/dist/chunk-53IYIDVS.mjs.map +0 -1
- package/dist/chunk-5SKCGFUC.js.map +0 -1
- package/dist/chunk-5WFLNKCL.js.map +0 -1
- package/dist/chunk-ETMW527M.js +0 -132
- package/dist/chunk-ETMW527M.js.map +0 -1
- package/dist/chunk-HUVOOFOM.js.map +0 -1
- package/dist/chunk-JDLNCMGI.mjs.map +0 -1
- package/dist/chunk-W3CS5GRD.mjs.map +0 -1
- /package/dist/{chunk-LYD4TEKH.js.map → chunk-4RJXBKSR.js.map} +0 -0
- /package/dist/{chunk-DRSMLO7B.mjs.map → chunk-5G6OHAXI.mjs.map} +0 -0
- /package/dist/{chunk-CPYXP2OC.js.map → chunk-5XQ2KRYL.js.map} +0 -0
- /package/dist/{chunk-WLCFETHR.js.map → chunk-C2LNDHP4.js.map} +0 -0
- /package/dist/{chunk-TKWTUPCQ.mjs.map → chunk-CPMTUMMZ.mjs.map} +0 -0
- /package/dist/{chunk-L337FYVS.js.map → chunk-EQNKFFTM.js.map} +0 -0
- /package/dist/{chunk-3JEUO765.js.map → chunk-EQT25RSP.js.map} +0 -0
- /package/dist/{chunk-RXRJSBSF.mjs.map → chunk-F6E3TTR3.mjs.map} +0 -0
- /package/dist/{chunk-F247MMTE.js.map → chunk-FDUCRHYT.js.map} +0 -0
- /package/dist/{chunk-L7ZKSKEI.mjs.map → chunk-IZVRGO3P.mjs.map} +0 -0
- /package/dist/{chunk-3VF7ZGRV.js.map → chunk-JAYYMCBQ.js.map} +0 -0
- /package/dist/{chunk-P74YLPJO.mjs.map → chunk-LDXTSESK.mjs.map} +0 -0
- /package/dist/{chunk-UBXRAA6G.js.map → chunk-LNX4JTOL.js.map} +0 -0
- /package/dist/{chunk-2XFBWPHD.mjs.map → chunk-NCRWKI6Y.mjs.map} +0 -0
- /package/dist/{chunk-CWWZQZVR.mjs.map → chunk-NPEXNXSY.mjs.map} +0 -0
- /package/dist/{chunk-DOX6H5UJ.mjs.map → chunk-QZLPYOGC.mjs.map} +0 -0
- /package/dist/{chunk-AO3AE3L7.js.map → chunk-V72C4MCR.js.map} +0 -0
- /package/dist/{chunk-RBF6CW7D.mjs.map → chunk-ZGUNOEUQ.mjs.map} +0 -0
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
+
var _chunkJAYYMCBQjs = require('./chunk-JAYYMCBQ.js');
|
|
4
|
+
|
|
5
|
+
|
|
3
6
|
var _chunkSD6CWFDFjs = require('./chunk-SD6CWFDF.js');
|
|
4
7
|
|
|
5
8
|
|
|
@@ -7,9 +10,12 @@ var _chunkSD6CWFDFjs = require('./chunk-SD6CWFDF.js');
|
|
|
7
10
|
var _chunkVH47Q6TSjs = require('./chunk-VH47Q6TS.js');
|
|
8
11
|
|
|
9
12
|
|
|
13
|
+
var _chunk7LXE4KHVjs = require('./chunk-7LXE4KHV.js');
|
|
14
|
+
|
|
10
15
|
|
|
11
16
|
|
|
12
|
-
|
|
17
|
+
|
|
18
|
+
var _chunkV72C4MCRjs = require('./chunk-V72C4MCR.js');
|
|
13
19
|
|
|
14
20
|
|
|
15
21
|
|
|
@@ -20,45 +26,42 @@ var _chunkQP75SWIQjs = require('./chunk-QP75SWIQ.js');
|
|
|
20
26
|
var _chunkZNZEJDOEjs = require('./chunk-ZNZEJDOE.js');
|
|
21
27
|
|
|
22
28
|
|
|
23
|
-
var
|
|
29
|
+
var _chunkNYKRCWBGjs = require('./chunk-NYKRCWBG.js');
|
|
24
30
|
|
|
25
31
|
|
|
26
|
-
var
|
|
32
|
+
var _chunkWR5F34OWjs = require('./chunk-WR5F34OW.js');
|
|
27
33
|
|
|
28
34
|
|
|
29
|
-
var
|
|
35
|
+
var _chunkV6UIRCOFjs = require('./chunk-V6UIRCOF.js');
|
|
30
36
|
|
|
31
37
|
|
|
32
38
|
|
|
33
|
-
var
|
|
39
|
+
var _chunk2XKEAKQGjs = require('./chunk-2XKEAKQG.js');
|
|
34
40
|
|
|
35
41
|
|
|
36
42
|
var _chunkDTDTOMTBjs = require('./chunk-DTDTOMTB.js');
|
|
37
43
|
|
|
38
44
|
|
|
39
|
-
var
|
|
45
|
+
var _chunk5XQ2KRYLjs = require('./chunk-5XQ2KRYL.js');
|
|
40
46
|
|
|
41
47
|
|
|
42
|
-
var
|
|
48
|
+
var _chunkEQT25RSPjs = require('./chunk-EQT25RSP.js');
|
|
43
49
|
|
|
44
50
|
|
|
45
51
|
var _chunk5KMU2IATjs = require('./chunk-5KMU2IAT.js');
|
|
46
52
|
|
|
47
53
|
|
|
48
|
-
var
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
var _chunkUBXRAA6Gjs = require('./chunk-UBXRAA6G.js');
|
|
54
|
+
var _chunkLNX4JTOLjs = require('./chunk-LNX4JTOL.js');
|
|
52
55
|
|
|
53
56
|
|
|
54
|
-
var
|
|
57
|
+
var _chunk4RJXBKSRjs = require('./chunk-4RJXBKSR.js');
|
|
55
58
|
|
|
56
59
|
|
|
57
|
-
var
|
|
60
|
+
var _chunkEQNKFFTMjs = require('./chunk-EQNKFFTM.js');
|
|
58
61
|
|
|
59
62
|
|
|
60
63
|
|
|
61
|
-
var
|
|
64
|
+
var _chunkC2LNDHP4js = require('./chunk-C2LNDHP4.js');
|
|
62
65
|
|
|
63
66
|
|
|
64
67
|
|
|
@@ -134,7 +137,7 @@ function getDefaultTransactionControllerState() {
|
|
|
134
137
|
lastFetchedBlockNumbers: {}
|
|
135
138
|
};
|
|
136
139
|
}
|
|
137
|
-
var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _transactionHistoryLimit, _isSimulationEnabled, _multichainTrackingHelper, _createNonceTracker, createNonceTracker_fn, _createIncomingTransactionHelper, createIncomingTransactionHelper_fn, _createPendingTransactionTracker, createPendingTransactionTracker_fn, _checkForPendingTransactionAndStartPolling, _stopAllTracking, stopAllTracking_fn, _removeIncomingTransactionHelperListeners, removeIncomingTransactionHelperListeners_fn, _addIncomingTransactionHelperListeners, addIncomingTransactionHelperListeners_fn, _removePendingTransactionTrackerListeners, removePendingTransactionTrackerListeners_fn, _addPendingTransactionTrackerListeners, addPendingTransactionTrackerListeners_fn, _getNonceTrackerPendingTransactions, getNonceTrackerPendingTransactions_fn, _getGasFeeFlows, getGasFeeFlows_fn, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn, _updateTransactionInternal, updateTransactionInternal_fn, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn, _updateSimulationData, updateSimulationData_fn;
|
|
140
|
+
var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _transactionHistoryLimit, _isSimulationEnabled, _multichainTrackingHelper, _createNonceTracker, createNonceTracker_fn, _createIncomingTransactionHelper, createIncomingTransactionHelper_fn, _createPendingTransactionTracker, createPendingTransactionTracker_fn, _checkForPendingTransactionAndStartPolling, _stopAllTracking, stopAllTracking_fn, _removeIncomingTransactionHelperListeners, removeIncomingTransactionHelperListeners_fn, _addIncomingTransactionHelperListeners, addIncomingTransactionHelperListeners_fn, _removePendingTransactionTrackerListeners, removePendingTransactionTrackerListeners_fn, _addPendingTransactionTrackerListeners, addPendingTransactionTrackerListeners_fn, _getNonceTrackerPendingTransactions, getNonceTrackerPendingTransactions_fn, _getGasFeeFlows, getGasFeeFlows_fn, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn, _updateTransactionInternal, updateTransactionInternal_fn, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn, _updateSimulationData, updateSimulationData_fn, _onGasFeePollerTransactionUpdate, onGasFeePollerTransactionUpdate_fn;
|
|
138
141
|
var TransactionController = class extends _basecontroller.BaseController {
|
|
139
142
|
/**
|
|
140
143
|
* Constructs a TransactionController.
|
|
@@ -217,6 +220,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
217
220
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _checkIfTransactionParamsUpdated);
|
|
218
221
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _onTransactionParamsUpdated);
|
|
219
222
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _updateSimulationData);
|
|
223
|
+
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _onGasFeePollerTransactionUpdate);
|
|
220
224
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _internalEvents, new (0, _events.EventEmitter)());
|
|
221
225
|
this.inProcessOfSigning = /* @__PURE__ */ new Set();
|
|
222
226
|
this.mutex = new (0, _asyncmutex.Mutex)();
|
|
@@ -260,7 +264,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
260
264
|
provider,
|
|
261
265
|
blockTracker
|
|
262
266
|
});
|
|
263
|
-
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _multichainTrackingHelper, new (0,
|
|
267
|
+
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _multichainTrackingHelper, new (0, _chunk5XQ2KRYLjs.MultichainTrackingHelper)({
|
|
264
268
|
isMultichainEnabled,
|
|
265
269
|
provider,
|
|
266
270
|
nonceTracker: this.nonceTracker,
|
|
@@ -291,7 +295,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
291
295
|
}
|
|
292
296
|
}));
|
|
293
297
|
_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).initialize();
|
|
294
|
-
const etherscanRemoteTransactionSource = new (0,
|
|
298
|
+
const etherscanRemoteTransactionSource = new (0, _chunkEQT25RSPjs.EtherscanRemoteTransactionSource)({
|
|
295
299
|
includeTokenTransfers: incomingTransactions.includeTokenTransfers
|
|
296
300
|
});
|
|
297
301
|
this.incomingTransactionHelper = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _createIncomingTransactionHelper, createIncomingTransactionHelper_fn).call(this, {
|
|
@@ -304,7 +308,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
304
308
|
});
|
|
305
309
|
this.gasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGasFeeFlows, getGasFeeFlows_fn).call(this);
|
|
306
310
|
this.layer1GasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn).call(this);
|
|
307
|
-
const gasFeePoller = new (0,
|
|
311
|
+
const gasFeePoller = new (0, _chunkV6UIRCOFjs.GasFeePoller)({
|
|
308
312
|
// Default gas fee polling is not yet supported by the clients
|
|
309
313
|
gasFeeFlows: this.gasFeeFlows.slice(0, -1),
|
|
310
314
|
getGasFeeControllerEstimates: this.getGasFeeEstimates,
|
|
@@ -323,7 +327,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
323
327
|
});
|
|
324
328
|
gasFeePoller.hub.on(
|
|
325
329
|
"transaction-updated",
|
|
326
|
-
|
|
330
|
+
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _onGasFeePollerTransactionUpdate, onGasFeePollerTransactionUpdate_fn).bind(this)
|
|
327
331
|
);
|
|
328
332
|
this.messagingSystem.subscribe(
|
|
329
333
|
"TransactionController:stateChange",
|
|
@@ -498,7 +502,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
498
502
|
if (!this.isHistoryDisabled) {
|
|
499
503
|
addedTransactionMeta = _chunkQP75SWIQjs.addInitialHistorySnapshot.call(void 0, addedTransactionMeta);
|
|
500
504
|
}
|
|
501
|
-
addedTransactionMeta =
|
|
505
|
+
addedTransactionMeta = _chunkC2LNDHP4js.updateSwapsTransaction.call(void 0,
|
|
502
506
|
addedTransactionMeta,
|
|
503
507
|
transactionType,
|
|
504
508
|
swaps,
|
|
@@ -823,7 +827,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
823
827
|
const ethQuery = _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getEthQuery({
|
|
824
828
|
networkClientId
|
|
825
829
|
});
|
|
826
|
-
const { estimatedGas, simulationFails } = await
|
|
830
|
+
const { estimatedGas, simulationFails } = await _chunkV72C4MCRjs.estimateGas.call(void 0,
|
|
827
831
|
transaction,
|
|
828
832
|
ethQuery
|
|
829
833
|
);
|
|
@@ -840,11 +844,11 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
840
844
|
const ethQuery = _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getEthQuery({
|
|
841
845
|
networkClientId
|
|
842
846
|
});
|
|
843
|
-
const { blockGasLimit, estimatedGas, simulationFails } = await
|
|
847
|
+
const { blockGasLimit, estimatedGas, simulationFails } = await _chunkV72C4MCRjs.estimateGas.call(void 0,
|
|
844
848
|
transaction,
|
|
845
849
|
ethQuery
|
|
846
850
|
);
|
|
847
|
-
const gas =
|
|
851
|
+
const gas = _chunkV72C4MCRjs.addGasBuffer.call(void 0, estimatedGas, blockGasLimit, multiplier);
|
|
848
852
|
return {
|
|
849
853
|
gas,
|
|
850
854
|
simulationFails
|
|
@@ -857,10 +861,8 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
857
861
|
* @param note - A note or update reason to include in the transaction history.
|
|
858
862
|
*/
|
|
859
863
|
updateTransaction(transactionMeta, note) {
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
skipHistory: this.isHistoryDisabled
|
|
863
|
-
});
|
|
864
|
+
const { id: transactionId } = transactionMeta;
|
|
865
|
+
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, note, skipHistory: this.isHistoryDisabled }, () => ({ ...transactionMeta }));
|
|
864
866
|
}
|
|
865
867
|
/**
|
|
866
868
|
* Update the security alert response for a transaction.
|
|
@@ -1156,7 +1158,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1156
1158
|
ethQuery
|
|
1157
1159
|
);
|
|
1158
1160
|
updatedTransaction.type = type;
|
|
1159
|
-
await
|
|
1161
|
+
await _chunk2XKEAKQGjs.updateTransactionLayer1GasFee.call(void 0, {
|
|
1160
1162
|
layer1GasFeeFlows: this.layer1GasFeeFlows,
|
|
1161
1163
|
provider,
|
|
1162
1164
|
transactionMeta: updatedTransaction
|
|
@@ -1367,18 +1369,23 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1367
1369
|
return filteredTransactions;
|
|
1368
1370
|
}
|
|
1369
1371
|
/**
|
|
1370
|
-
*
|
|
1372
|
+
* Determine the layer 1 gas fee for the given transaction parameters.
|
|
1371
1373
|
*
|
|
1372
|
-
* @param
|
|
1373
|
-
* @param
|
|
1374
|
-
* @param
|
|
1374
|
+
* @param request - The request object.
|
|
1375
|
+
* @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.
|
|
1376
|
+
* @param request.chainId - The ID of the chain where the transaction will be executed.
|
|
1377
|
+
* @param request.networkClientId - The ID of a specific network client to process the transaction.
|
|
1375
1378
|
*/
|
|
1376
|
-
async getLayer1GasFee(
|
|
1379
|
+
async getLayer1GasFee({
|
|
1380
|
+
transactionParams,
|
|
1381
|
+
chainId,
|
|
1382
|
+
networkClientId
|
|
1383
|
+
}) {
|
|
1377
1384
|
const provider = _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getProvider({
|
|
1378
1385
|
networkClientId,
|
|
1379
1386
|
chainId
|
|
1380
1387
|
});
|
|
1381
|
-
|
|
1388
|
+
return await _chunk2XKEAKQGjs.getTransactionLayer1GasFee.call(void 0, {
|
|
1382
1389
|
layer1GasFeeFlows: this.layer1GasFeeFlows,
|
|
1383
1390
|
provider,
|
|
1384
1391
|
transactionMeta: {
|
|
@@ -1386,7 +1393,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1386
1393
|
chainId
|
|
1387
1394
|
}
|
|
1388
1395
|
});
|
|
1389
|
-
return layer1GasFee;
|
|
1390
1396
|
}
|
|
1391
1397
|
async signExternalTransaction(chainId, transactionParams) {
|
|
1392
1398
|
if (!this.sign) {
|
|
@@ -1463,13 +1469,13 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1463
1469
|
networkClientId,
|
|
1464
1470
|
chainId
|
|
1465
1471
|
});
|
|
1466
|
-
await
|
|
1472
|
+
await _chunkV72C4MCRjs.updateGas.call(void 0, {
|
|
1467
1473
|
ethQuery,
|
|
1468
1474
|
chainId,
|
|
1469
1475
|
isCustomNetwork,
|
|
1470
1476
|
txMeta: transactionMeta
|
|
1471
1477
|
});
|
|
1472
|
-
await
|
|
1478
|
+
await _chunkEQNKFFTMjs.updateGasFees.call(void 0, {
|
|
1473
1479
|
eip1559: isEIP1559Compatible,
|
|
1474
1480
|
ethQuery,
|
|
1475
1481
|
gasFeeFlows: this.gasFeeFlows,
|
|
@@ -1477,7 +1483,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1477
1483
|
getSavedGasFees: this.getSavedGasFees.bind(this),
|
|
1478
1484
|
txMeta: transactionMeta
|
|
1479
1485
|
});
|
|
1480
|
-
await
|
|
1486
|
+
await _chunk2XKEAKQGjs.updateTransactionLayer1GasFee.call(void 0, {
|
|
1481
1487
|
layer1GasFeeFlows: this.layer1GasFeeFlows,
|
|
1482
1488
|
provider,
|
|
1483
1489
|
transactionMeta
|
|
@@ -2133,7 +2139,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
2133
2139
|
networkClientId: transactionMeta.networkClientId,
|
|
2134
2140
|
chainId: transactionMeta.chainId
|
|
2135
2141
|
});
|
|
2136
|
-
const { updatedTransactionMeta, approvalTransactionMeta } = await
|
|
2142
|
+
const { updatedTransactionMeta, approvalTransactionMeta } = await _chunkC2LNDHP4js.updatePostTransactionBalance.call(void 0, transactionMeta, {
|
|
2137
2143
|
ethQuery,
|
|
2138
2144
|
getTransaction: this.getTransaction.bind(this),
|
|
2139
2145
|
updateTransaction: this.updateTransaction.bind(this)
|
|
@@ -2320,32 +2326,43 @@ getNonceTrackerPendingTransactions_fn = function(chainId, address) {
|
|
|
2320
2326
|
};
|
|
2321
2327
|
_getGasFeeFlows = new WeakSet();
|
|
2322
2328
|
getGasFeeFlows_fn = function() {
|
|
2323
|
-
return [new (0,
|
|
2329
|
+
return [new (0, _chunkLNX4JTOLjs.LineaGasFeeFlow)(), new (0, _chunk4RJXBKSRjs.DefaultGasFeeFlow)()];
|
|
2324
2330
|
};
|
|
2325
2331
|
_getLayer1GasFeeFlows = new WeakSet();
|
|
2326
2332
|
getLayer1GasFeeFlows_fn = function() {
|
|
2327
|
-
return [new (0,
|
|
2333
|
+
return [new (0, _chunkNYKRCWBGjs.OptimismLayer1GasFeeFlow)(), new (0, _chunkWR5F34OWjs.ScrollLayer1GasFeeFlow)()];
|
|
2328
2334
|
};
|
|
2329
2335
|
_updateTransactionInternal = new WeakSet();
|
|
2330
|
-
updateTransactionInternal_fn = function(
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
const updatedTransactionParams = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn).call(this, normalizedTransaction);
|
|
2337
|
-
const transactionWithUpdatedHistory = skipHistory === true ? normalizedTransaction : _chunkQP75SWIQjs.updateTransactionHistory.call(void 0,
|
|
2338
|
-
normalizedTransaction,
|
|
2339
|
-
note ?? "Transaction updated"
|
|
2340
|
-
);
|
|
2336
|
+
updateTransactionInternal_fn = function({
|
|
2337
|
+
transactionId,
|
|
2338
|
+
note,
|
|
2339
|
+
skipHistory
|
|
2340
|
+
}, callback) {
|
|
2341
|
+
let updatedTransactionParams = [];
|
|
2341
2342
|
this.update((state) => {
|
|
2342
2343
|
const index = state.transactions.findIndex(
|
|
2343
|
-
({ id }) =>
|
|
2344
|
+
({ id }) => id === transactionId
|
|
2344
2345
|
);
|
|
2345
|
-
state.transactions[index]
|
|
2346
|
+
let transactionMeta2 = state.transactions[index];
|
|
2347
|
+
transactionMeta2 = callback(transactionMeta2) ?? transactionMeta2;
|
|
2348
|
+
transactionMeta2.txParams = _chunkUGFBA4GVjs.normalizeTransactionParams.call(void 0,
|
|
2349
|
+
transactionMeta2.txParams
|
|
2350
|
+
);
|
|
2351
|
+
_chunkVH47Q6TSjs.validateTxParams.call(void 0, transactionMeta2.txParams);
|
|
2352
|
+
updatedTransactionParams = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn).call(this, transactionMeta2);
|
|
2353
|
+
if (skipHistory !== true) {
|
|
2354
|
+
transactionMeta2 = _chunkQP75SWIQjs.updateTransactionHistory.call(void 0,
|
|
2355
|
+
transactionMeta2,
|
|
2356
|
+
note ?? "Transaction updated"
|
|
2357
|
+
);
|
|
2358
|
+
}
|
|
2359
|
+
state.transactions[index] = transactionMeta2;
|
|
2346
2360
|
});
|
|
2361
|
+
const transactionMeta = this.getTransaction(
|
|
2362
|
+
transactionId
|
|
2363
|
+
);
|
|
2347
2364
|
if (updatedTransactionParams.length > 0) {
|
|
2348
|
-
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn).call(this,
|
|
2365
|
+
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn).call(this, transactionMeta, updatedTransactionParams);
|
|
2349
2366
|
}
|
|
2350
2367
|
};
|
|
2351
2368
|
_checkIfTransactionParamsUpdated = new WeakSet();
|
|
@@ -2379,7 +2396,7 @@ onTransactionParamsUpdated_fn = function(transactionMeta, updatedParams) {
|
|
|
2379
2396
|
};
|
|
2380
2397
|
_updateSimulationData = new WeakSet();
|
|
2381
2398
|
updateSimulationData_fn = async function(transactionMeta) {
|
|
2382
|
-
const { id, chainId, txParams } = transactionMeta;
|
|
2399
|
+
const { id: transactionId, chainId, txParams } = transactionMeta;
|
|
2383
2400
|
const { from, to, value, data } = txParams;
|
|
2384
2401
|
let simulationData = {
|
|
2385
2402
|
error: {
|
|
@@ -2389,8 +2406,10 @@ updateSimulationData_fn = async function(transactionMeta) {
|
|
|
2389
2406
|
tokenBalanceChanges: []
|
|
2390
2407
|
};
|
|
2391
2408
|
if (_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _isSimulationEnabled).call(this)) {
|
|
2392
|
-
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, {
|
|
2393
|
-
|
|
2409
|
+
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, skipHistory: true }, (txMeta) => {
|
|
2410
|
+
txMeta.simulationData = void 0;
|
|
2411
|
+
});
|
|
2412
|
+
simulationData = await _chunkJAYYMCBQjs.getSimulationData.call(void 0, {
|
|
2394
2413
|
chainId,
|
|
2395
2414
|
from,
|
|
2396
2415
|
to,
|
|
@@ -2398,20 +2417,41 @@ updateSimulationData_fn = async function(transactionMeta) {
|
|
|
2398
2417
|
data
|
|
2399
2418
|
});
|
|
2400
2419
|
}
|
|
2401
|
-
const finalTransactionMeta = this.getTransaction(
|
|
2420
|
+
const finalTransactionMeta = this.getTransaction(transactionId);
|
|
2402
2421
|
if (!finalTransactionMeta) {
|
|
2403
2422
|
_chunkS6VGOPUYjs.projectLogger.call(void 0,
|
|
2404
2423
|
"Cannot update simulation data as transaction not found",
|
|
2405
|
-
|
|
2424
|
+
transactionId,
|
|
2406
2425
|
simulationData
|
|
2407
2426
|
);
|
|
2408
2427
|
return;
|
|
2409
2428
|
}
|
|
2410
|
-
this.
|
|
2411
|
-
|
|
2412
|
-
"TransactionController#updateSimulationData - Update simulation data"
|
|
2413
|
-
)
|
|
2414
|
-
|
|
2429
|
+
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, {
|
|
2430
|
+
transactionId,
|
|
2431
|
+
note: "TransactionController#updateSimulationData - Update simulation data"
|
|
2432
|
+
}, (txMeta) => {
|
|
2433
|
+
txMeta.simulationData = simulationData;
|
|
2434
|
+
});
|
|
2435
|
+
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Updated simulation data", transactionId, simulationData);
|
|
2436
|
+
};
|
|
2437
|
+
_onGasFeePollerTransactionUpdate = new WeakSet();
|
|
2438
|
+
onGasFeePollerTransactionUpdate_fn = function({
|
|
2439
|
+
transactionId,
|
|
2440
|
+
gasFeeEstimates,
|
|
2441
|
+
gasFeeEstimatesLoaded,
|
|
2442
|
+
layer1GasFee
|
|
2443
|
+
}) {
|
|
2444
|
+
_chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, skipHistory: true }, (txMeta) => {
|
|
2445
|
+
if (gasFeeEstimates) {
|
|
2446
|
+
txMeta.gasFeeEstimates = gasFeeEstimates;
|
|
2447
|
+
}
|
|
2448
|
+
if (gasFeeEstimatesLoaded !== void 0) {
|
|
2449
|
+
txMeta.gasFeeEstimatesLoaded = gasFeeEstimatesLoaded;
|
|
2450
|
+
}
|
|
2451
|
+
if (layer1GasFee) {
|
|
2452
|
+
txMeta.layer1GasFee = layer1GasFee;
|
|
2453
|
+
}
|
|
2454
|
+
});
|
|
2415
2455
|
};
|
|
2416
2456
|
|
|
2417
2457
|
|
|
@@ -2421,4 +2461,4 @@ updateSimulationData_fn = async function(transactionMeta) {
|
|
|
2421
2461
|
|
|
2422
2462
|
|
|
2423
2463
|
exports.HARDFORK = HARDFORK; exports.CANCEL_RATE = CANCEL_RATE; exports.SPEED_UP_RATE = SPEED_UP_RATE; exports.ApprovalState = ApprovalState; exports.TransactionController = TransactionController;
|
|
2424
|
-
//# sourceMappingURL=chunk-
|
|
2464
|
+
//# sourceMappingURL=chunk-DMMUAJKY.js.map
|