@metamask-previews/transaction-controller 35.1.0-preview-2ca9038 → 35.1.0-preview-a90bc717
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.js +8 -8
- package/dist/TransactionController.mjs +7 -7
- package/dist/{chunk-2EU6346V.js → chunk-3Y7RHK6L.js} +3 -3
- package/dist/{chunk-QKS2F7VG.js → chunk-4H5MCBPU.js} +66 -40
- package/dist/chunk-4H5MCBPU.js.map +1 -0
- package/dist/{chunk-AYTU4HU5.js → chunk-4IUBMIDQ.js} +1 -1
- package/dist/{chunk-AYTU4HU5.js.map → chunk-4IUBMIDQ.js.map} +1 -1
- package/dist/{chunk-SFFTNB2X.mjs → chunk-5MYXN7TL.mjs} +2 -2
- package/dist/{chunk-H2KZOK3J.mjs → chunk-EPCF4BU3.mjs} +3 -3
- package/dist/{chunk-UHG2LLVV.mjs → chunk-EUJSTRE7.mjs} +3 -3
- package/dist/{chunk-VXNPVIYL.mjs → chunk-EXQCUTGP.mjs} +2 -2
- package/dist/{chunk-QTKXIDGE.js → chunk-OBYKCUWH.js} +9 -9
- package/dist/{chunk-ARZHJFVG.js → chunk-OSRJHVMI.js} +6 -6
- package/dist/{chunk-C3WC4OJ3.js → chunk-PI5XNTNC.js} +3 -3
- package/dist/{chunk-76FONEDA.js → chunk-SZRRNVKK.js} +4 -4
- package/dist/{chunk-JXXTNVU4.mjs → chunk-TWU3E2S2.mjs} +2 -2
- package/dist/{chunk-5JWPMHSZ.mjs → chunk-Z62VAKCW.mjs} +63 -37
- package/dist/chunk-Z62VAKCW.mjs.map +1 -0
- package/dist/{chunk-6SJYXSF3.mjs → chunk-ZAL2JFL6.mjs} +1 -1
- package/dist/{chunk-6SJYXSF3.mjs.map → chunk-ZAL2JFL6.mjs.map} +1 -1
- package/dist/errors.js +1 -1
- package/dist/errors.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/TestGasFeeFlow.js +1 -1
- package/dist/gas-flows/TestGasFeeFlow.mjs +1 -1
- package/dist/helpers/EtherscanRemoteTransactionSource.js +1 -1
- package/dist/helpers/EtherscanRemoteTransactionSource.mjs +1 -1
- package/dist/helpers/GasFeePoller.js +4 -4
- package/dist/helpers/GasFeePoller.mjs +3 -3
- package/dist/helpers/MultichainTrackingHelper.js +1 -1
- package/dist/helpers/MultichainTrackingHelper.mjs +1 -1
- package/dist/helpers/PendingTransactionTracker.js +1 -1
- package/dist/helpers/PendingTransactionTracker.mjs +1 -1
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/TransactionController.d.ts +8 -3
- package/dist/types/TransactionController.d.ts.map +1 -1
- package/dist/types/types.d.ts +28 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types.js +2 -2
- package/dist/types.mjs +1 -1
- package/dist/utils/external-transactions.js +1 -1
- package/dist/utils/external-transactions.mjs +1 -1
- package/dist/utils/gas-fees.js +4 -4
- package/dist/utils/gas-fees.mjs +3 -3
- package/dist/utils/gas-flow.js +3 -3
- package/dist/utils/gas-flow.mjs +2 -2
- package/dist/utils/simulation-api.js +1 -1
- package/dist/utils/simulation-api.mjs +1 -1
- package/dist/utils/simulation.js +1 -1
- package/dist/utils/simulation.mjs +1 -1
- package/dist/utils/swaps.js +1 -1
- package/dist/utils/swaps.mjs +1 -1
- package/dist/utils/transaction-type.js +1 -1
- package/dist/utils/transaction-type.mjs +1 -1
- package/dist/utils/utils.js +1 -1
- package/dist/utils/utils.mjs +1 -1
- package/dist/utils/validation.js +1 -1
- package/dist/utils/validation.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-5JWPMHSZ.mjs.map +0 -1
- package/dist/chunk-QKS2F7VG.js.map +0 -1
- /package/dist/{chunk-2EU6346V.js.map → chunk-3Y7RHK6L.js.map} +0 -0
- /package/dist/{chunk-SFFTNB2X.mjs.map → chunk-5MYXN7TL.mjs.map} +0 -0
- /package/dist/{chunk-H2KZOK3J.mjs.map → chunk-EPCF4BU3.mjs.map} +0 -0
- /package/dist/{chunk-UHG2LLVV.mjs.map → chunk-EUJSTRE7.mjs.map} +0 -0
- /package/dist/{chunk-VXNPVIYL.mjs.map → chunk-EXQCUTGP.mjs.map} +0 -0
- /package/dist/{chunk-QTKXIDGE.js.map → chunk-OBYKCUWH.js.map} +0 -0
- /package/dist/{chunk-ARZHJFVG.js.map → chunk-OSRJHVMI.js.map} +0 -0
- /package/dist/{chunk-C3WC4OJ3.js.map → chunk-PI5XNTNC.js.map} +0 -0
- /package/dist/{chunk-76FONEDA.js.map → chunk-SZRRNVKK.js.map} +0 -0
- /package/dist/{chunk-JXXTNVU4.mjs.map → chunk-TWU3E2S2.mjs.map} +0 -0
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunk4H5MCBPUjs = require('./chunk-4H5MCBPU.js');
|
|
8
8
|
require('./chunk-PRUNMTRD.js');
|
|
9
9
|
require('./chunk-NNCUD3QF.js');
|
|
10
10
|
require('./chunk-KT6UAKBB.js');
|
|
@@ -18,22 +18,22 @@ require('./chunk-NYKRCWBG.js');
|
|
|
18
18
|
require('./chunk-WR5F34OW.js');
|
|
19
19
|
require('./chunk-YVCX6Z75.js');
|
|
20
20
|
require('./chunk-TJMQEH57.js');
|
|
21
|
-
require('./chunk-
|
|
21
|
+
require('./chunk-3Y7RHK6L.js');
|
|
22
22
|
require('./chunk-2XKEAKQG.js');
|
|
23
23
|
require('./chunk-RHDPOIS4.js');
|
|
24
24
|
require('./chunk-6OLJWLKK.js');
|
|
25
25
|
require('./chunk-7NMV2NPM.js');
|
|
26
26
|
require('./chunk-XVYXRCRL.js');
|
|
27
27
|
require('./chunk-HMOSP33F.js');
|
|
28
|
-
require('./chunk-
|
|
29
|
-
require('./chunk-
|
|
30
|
-
require('./chunk-
|
|
28
|
+
require('./chunk-OSRJHVMI.js');
|
|
29
|
+
require('./chunk-OBYKCUWH.js');
|
|
30
|
+
require('./chunk-PI5XNTNC.js');
|
|
31
31
|
require('./chunk-QH2H4W3N.js');
|
|
32
32
|
require('./chunk-OZ6UB42C.js');
|
|
33
|
-
require('./chunk-
|
|
33
|
+
require('./chunk-SZRRNVKK.js');
|
|
34
34
|
require('./chunk-UGN7PBON.js');
|
|
35
35
|
require('./chunk-S6VGOPUY.js');
|
|
36
|
-
require('./chunk-
|
|
36
|
+
require('./chunk-4IUBMIDQ.js');
|
|
37
37
|
require('./chunk-Z4BLTVTB.js');
|
|
38
38
|
|
|
39
39
|
|
|
@@ -41,5 +41,5 @@ require('./chunk-Z4BLTVTB.js');
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
exports.ApprovalState =
|
|
44
|
+
exports.ApprovalState = _chunk4H5MCBPUjs.ApprovalState; exports.CANCEL_RATE = _chunk4H5MCBPUjs.CANCEL_RATE; exports.HARDFORK = _chunk4H5MCBPUjs.HARDFORK; exports.SPEED_UP_RATE = _chunk4H5MCBPUjs.SPEED_UP_RATE; exports.TransactionController = _chunk4H5MCBPUjs.TransactionController;
|
|
45
45
|
//# sourceMappingURL=TransactionController.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
HARDFORK,
|
|
5
5
|
SPEED_UP_RATE,
|
|
6
6
|
TransactionController
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-Z62VAKCW.mjs";
|
|
8
8
|
import "./chunk-6DDVVUJC.mjs";
|
|
9
9
|
import "./chunk-3AVRGHUO.mjs";
|
|
10
10
|
import "./chunk-K4KOSAGM.mjs";
|
|
@@ -18,22 +18,22 @@ import "./chunk-VEVVBHP3.mjs";
|
|
|
18
18
|
import "./chunk-Z4GV3YQQ.mjs";
|
|
19
19
|
import "./chunk-FG74Z3F5.mjs";
|
|
20
20
|
import "./chunk-FMRLPVFZ.mjs";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-5MYXN7TL.mjs";
|
|
22
22
|
import "./chunk-NOHEXQ7Y.mjs";
|
|
23
23
|
import "./chunk-3ZV5YEUV.mjs";
|
|
24
24
|
import "./chunk-4V4XIPCI.mjs";
|
|
25
25
|
import "./chunk-EKJXGERC.mjs";
|
|
26
26
|
import "./chunk-EGQCE3FK.mjs";
|
|
27
27
|
import "./chunk-HQSNKCXI.mjs";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-EUJSTRE7.mjs";
|
|
29
|
+
import "./chunk-EPCF4BU3.mjs";
|
|
30
|
+
import "./chunk-EXQCUTGP.mjs";
|
|
31
31
|
import "./chunk-GNAL5HC2.mjs";
|
|
32
32
|
import "./chunk-Q56I5ONX.mjs";
|
|
33
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-TWU3E2S2.mjs";
|
|
34
34
|
import "./chunk-O6ZZVIFH.mjs";
|
|
35
35
|
import "./chunk-UQQWZT6C.mjs";
|
|
36
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-ZAL2JFL6.mjs";
|
|
37
37
|
import "./chunk-XUI43LEZ.mjs";
|
|
38
38
|
export {
|
|
39
39
|
ApprovalState,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunk2XKEAKQGjs = require('./chunk-2XKEAKQG.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkSZRRNVKKjs = require('./chunk-SZRRNVKK.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -148,7 +148,7 @@ _updateTransactionGasFeeEstimates = new WeakSet();
|
|
|
148
148
|
updateTransactionGasFeeEstimates_fn = async function(transactionMeta, gasFeeControllerData) {
|
|
149
149
|
const { chainId, networkClientId } = transactionMeta;
|
|
150
150
|
const ethQuery = new (0, _ethquery2.default)(_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _getProvider).call(this, chainId, networkClientId));
|
|
151
|
-
const gasFeeFlow =
|
|
151
|
+
const gasFeeFlow = _chunkSZRRNVKKjs.getGasFeeFlow.call(void 0, transactionMeta, _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _gasFeeFlows));
|
|
152
152
|
if (gasFeeFlow) {
|
|
153
153
|
log(
|
|
154
154
|
"Found gas fee flow",
|
|
@@ -225,4 +225,4 @@ getGasFeeControllerData_fn = async function(transactions) {
|
|
|
225
225
|
|
|
226
226
|
|
|
227
227
|
exports.GasFeePoller = GasFeePoller;
|
|
228
|
-
//# sourceMappingURL=chunk-
|
|
228
|
+
//# sourceMappingURL=chunk-3Y7RHK6L.js.map
|
|
@@ -38,7 +38,7 @@ var _chunkWR5F34OWjs = require('./chunk-WR5F34OW.js');
|
|
|
38
38
|
var _chunkTJMQEH57js = require('./chunk-TJMQEH57.js');
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
var
|
|
41
|
+
var _chunk3Y7RHK6Ljs = require('./chunk-3Y7RHK6L.js');
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
|
|
@@ -54,13 +54,13 @@ var _chunk6OLJWLKKjs = require('./chunk-6OLJWLKK.js');
|
|
|
54
54
|
var _chunk7NMV2NPMjs = require('./chunk-7NMV2NPM.js');
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var
|
|
57
|
+
var _chunkOSRJHVMIjs = require('./chunk-OSRJHVMI.js');
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
var
|
|
60
|
+
var _chunkOBYKCUWHjs = require('./chunk-OBYKCUWH.js');
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
var
|
|
63
|
+
var _chunkPI5XNTNCjs = require('./chunk-PI5XNTNC.js');
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
|
|
@@ -79,7 +79,7 @@ var _chunkQH2H4W3Njs = require('./chunk-QH2H4W3N.js');
|
|
|
79
79
|
var _chunkOZ6UB42Cjs = require('./chunk-OZ6UB42C.js');
|
|
80
80
|
|
|
81
81
|
|
|
82
|
-
var
|
|
82
|
+
var _chunkSZRRNVKKjs = require('./chunk-SZRRNVKK.js');
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -143,7 +143,7 @@ function getDefaultTransactionControllerState() {
|
|
|
143
143
|
lastFetchedBlockNumbers: {}
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
|
-
var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _transactionHistoryLimit, _isSimulationEnabled, _testGasFeeFlows, _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, _getNetworkClientId, getNetworkClientId_fn, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn, _getGlobalChainId, getGlobalChainId_fn, _isCustomNetwork, isCustomNetwork_fn, _getSelectedAccount, getSelectedAccount_fn;
|
|
146
|
+
var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _trace, _transactionHistoryLimit, _isSimulationEnabled, _testGasFeeFlows, _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, _getNetworkClientId, getNetworkClientId_fn, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn, _getGlobalChainId, getGlobalChainId_fn, _isCustomNetwork, isCustomNetwork_fn, _getSelectedAccount, getSelectedAccount_fn;
|
|
147
147
|
var TransactionController = class extends _basecontroller.BaseController {
|
|
148
148
|
/**
|
|
149
149
|
* Constructs a TransactionController.
|
|
@@ -172,6 +172,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
172
172
|
* @param options.sign - Function used to sign transactions.
|
|
173
173
|
* @param options.state - Initial state to set on this controller.
|
|
174
174
|
* @param options.testGasFeeFlows - Whether to use the test gas fee flow.
|
|
175
|
+
* @param options.trace - Callback to generate trace information.
|
|
175
176
|
* @param options.transactionHistoryLimit - Transaction history limit.
|
|
176
177
|
* @param options.hooks - The controller hooks.
|
|
177
178
|
*/
|
|
@@ -199,6 +200,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
199
200
|
sign,
|
|
200
201
|
state,
|
|
201
202
|
testGasFeeFlows,
|
|
203
|
+
trace,
|
|
202
204
|
transactionHistoryLimit = 40,
|
|
203
205
|
hooks
|
|
204
206
|
}) {
|
|
@@ -238,6 +240,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
238
240
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _incomingTransactionOptions, void 0);
|
|
239
241
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _pendingTransactionOptions, void 0);
|
|
240
242
|
this.signAbortCallbacks = /* @__PURE__ */ new Map();
|
|
243
|
+
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _trace, void 0);
|
|
241
244
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _transactionHistoryLimit, void 0);
|
|
242
245
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _isSimulationEnabled, void 0);
|
|
243
246
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _testGasFeeFlows, void 0);
|
|
@@ -265,6 +268,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
265
268
|
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _transactionHistoryLimit, transactionHistoryLimit);
|
|
266
269
|
this.sign = sign;
|
|
267
270
|
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _testGasFeeFlows, testGasFeeFlows === true);
|
|
271
|
+
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _trace, trace ?? ((_request, fn) => fn?.()));
|
|
268
272
|
this.afterSign = hooks?.afterSign ?? (() => true);
|
|
269
273
|
this.beforeApproveOnInit = hooks?.beforeApproveOnInit ?? (() => true);
|
|
270
274
|
this.beforeCheckPendingTransaction = hooks?.beforeCheckPendingTransaction ?? /* istanbul ignore next */
|
|
@@ -321,7 +325,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
321
325
|
});
|
|
322
326
|
this.gasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGasFeeFlows, getGasFeeFlows_fn).call(this);
|
|
323
327
|
this.layer1GasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn).call(this);
|
|
324
|
-
const gasFeePoller = new (0,
|
|
328
|
+
const gasFeePoller = new (0, _chunk3Y7RHK6Ljs.GasFeePoller)({
|
|
325
329
|
findNetworkClientIdByChainId,
|
|
326
330
|
gasFeeFlows: this.gasFeeFlows,
|
|
327
331
|
getGasFeeControllerEstimates: this.getGasFeeEstimates,
|
|
@@ -439,6 +443,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
439
443
|
* @param opts.swaps.hasApproveTx - Whether the transaction has an approval transaction.
|
|
440
444
|
* @param opts.swaps.meta - Metadata for swap transaction.
|
|
441
445
|
* @param opts.networkClientId - The id of the network client for this transaction.
|
|
446
|
+
* @param opts.traceContext - The parent context for any new traces.
|
|
442
447
|
* @returns Object containing a promise resolving to the transaction hash if approved.
|
|
443
448
|
*/
|
|
444
449
|
async addTransaction(txParams, {
|
|
@@ -450,6 +455,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
450
455
|
securityAlertResponse,
|
|
451
456
|
sendFlowHistory,
|
|
452
457
|
swaps = {},
|
|
458
|
+
traceContext,
|
|
453
459
|
type,
|
|
454
460
|
networkClientId: requestNetworkClientId
|
|
455
461
|
} = {}) {
|
|
@@ -501,7 +507,9 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
501
507
|
type: transactionType,
|
|
502
508
|
networkClientId
|
|
503
509
|
};
|
|
504
|
-
await this.updateGasProperties(addedTransactionMeta
|
|
510
|
+
await _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _trace).call(this, { name: "Estimate Gas Properties", parentContext: traceContext }, (context) => this.updateGasProperties(addedTransactionMeta, {
|
|
511
|
+
traceContext: context
|
|
512
|
+
}));
|
|
505
513
|
if (!existingTransactionMeta) {
|
|
506
514
|
if (method && this.securityProviderRequest) {
|
|
507
515
|
const securityProviderResponse = await this.securityProviderRequest(
|
|
@@ -541,7 +549,8 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
541
549
|
result: this.processApproval(addedTransactionMeta, {
|
|
542
550
|
isExisting: Boolean(existingTransactionMeta),
|
|
543
551
|
requireApproval,
|
|
544
|
-
actionId
|
|
552
|
+
actionId,
|
|
553
|
+
traceContext
|
|
545
554
|
}),
|
|
546
555
|
transactionMeta: addedTransactionMeta
|
|
547
556
|
};
|
|
@@ -1396,7 +1405,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1396
1405
|
chainId,
|
|
1397
1406
|
networkClientId
|
|
1398
1407
|
};
|
|
1399
|
-
const gasFeeFlow =
|
|
1408
|
+
const gasFeeFlow = _chunkSZRRNVKKjs.getGasFeeFlow.call(void 0,
|
|
1400
1409
|
transactionMeta,
|
|
1401
1410
|
this.gasFeeFlows
|
|
1402
1411
|
);
|
|
@@ -1499,7 +1508,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1499
1508
|
]);
|
|
1500
1509
|
});
|
|
1501
1510
|
}
|
|
1502
|
-
async updateGasProperties(transactionMeta) {
|
|
1511
|
+
async updateGasProperties(transactionMeta, { traceContext } = {}) {
|
|
1503
1512
|
const isEIP1559Compatible = await this.getEIP1559Compatibility(transactionMeta.networkClientId) && transactionMeta.txParams.type !== "0x0" /* legacy */;
|
|
1504
1513
|
const { networkClientId, chainId } = transactionMeta;
|
|
1505
1514
|
const isCustomNetwork = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _isCustomNetwork, isCustomNetwork_fn).call(this, networkClientId);
|
|
@@ -1511,25 +1520,27 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1511
1520
|
networkClientId,
|
|
1512
1521
|
chainId
|
|
1513
1522
|
});
|
|
1514
|
-
await
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1523
|
+
await _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _trace).call(this, { name: "Update Gas", parentContext: traceContext }, async () => {
|
|
1524
|
+
await _chunkV72C4MCRjs.updateGas.call(void 0, {
|
|
1525
|
+
ethQuery,
|
|
1526
|
+
chainId,
|
|
1527
|
+
isCustomNetwork,
|
|
1528
|
+
txMeta: transactionMeta
|
|
1529
|
+
});
|
|
1519
1530
|
});
|
|
1520
|
-
await
|
|
1531
|
+
await _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _trace).call(this, { name: "Update Gas Fees", parentContext: traceContext }, async () => await _chunkPI5XNTNCjs.updateGasFees.call(void 0, {
|
|
1521
1532
|
eip1559: isEIP1559Compatible,
|
|
1522
1533
|
ethQuery,
|
|
1523
1534
|
gasFeeFlows: this.gasFeeFlows,
|
|
1524
1535
|
getGasFeeEstimates: this.getGasFeeEstimates,
|
|
1525
1536
|
getSavedGasFees: this.getSavedGasFees.bind(this),
|
|
1526
1537
|
txMeta: transactionMeta
|
|
1527
|
-
});
|
|
1528
|
-
await _chunk2XKEAKQGjs.updateTransactionLayer1GasFee.call(void 0, {
|
|
1538
|
+
}));
|
|
1539
|
+
await _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _trace).call(this, { name: "Update Layer 1 Gas Fees", parentContext: traceContext }, async () => await _chunk2XKEAKQGjs.updateTransactionLayer1GasFee.call(void 0, {
|
|
1529
1540
|
layer1GasFeeFlows: this.layer1GasFeeFlows,
|
|
1530
1541
|
provider,
|
|
1531
1542
|
transactionMeta
|
|
1532
|
-
});
|
|
1543
|
+
}));
|
|
1533
1544
|
}
|
|
1534
1545
|
onBootCleanup() {
|
|
1535
1546
|
this.submitApprovedTransactions();
|
|
@@ -1553,7 +1564,8 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1553
1564
|
isExisting = false,
|
|
1554
1565
|
requireApproval,
|
|
1555
1566
|
shouldShowRequest = true,
|
|
1556
|
-
actionId
|
|
1567
|
+
actionId,
|
|
1568
|
+
traceContext
|
|
1557
1569
|
}) {
|
|
1558
1570
|
const transactionId = transactionMeta.id;
|
|
1559
1571
|
let resultCallbacks;
|
|
@@ -1562,9 +1574,10 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1562
1574
|
if (meta && !isExisting && !isCompleted) {
|
|
1563
1575
|
try {
|
|
1564
1576
|
if (requireApproval !== false) {
|
|
1565
|
-
const acceptResult = await this.requestApproval(transactionMeta, {
|
|
1566
|
-
shouldShowRequest
|
|
1567
|
-
|
|
1577
|
+
const acceptResult = await _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _trace).call(this, { name: "Await Approval", parentContext: traceContext }, (context) => this.requestApproval(transactionMeta, {
|
|
1578
|
+
shouldShowRequest,
|
|
1579
|
+
traceContext: context
|
|
1580
|
+
}));
|
|
1568
1581
|
resultCallbacks = acceptResult.resultCallbacks;
|
|
1569
1582
|
const approvalValue = acceptResult.value;
|
|
1570
1583
|
const updatedTransaction = approvalValue?.txMeta;
|
|
@@ -1581,7 +1594,10 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1581
1594
|
}
|
|
1582
1595
|
const { isCompleted: isTxCompleted } = this.isTransactionCompleted(transactionId);
|
|
1583
1596
|
if (!isTxCompleted) {
|
|
1584
|
-
const approvalResult = await this.approveTransaction(
|
|
1597
|
+
const approvalResult = await this.approveTransaction(
|
|
1598
|
+
transactionId,
|
|
1599
|
+
traceContext
|
|
1600
|
+
);
|
|
1585
1601
|
if (approvalResult === "skipped-via-before-publish-hook" /* SkippedViaBeforePublishHook */ && resultCallbacks) {
|
|
1586
1602
|
resultCallbacks.success();
|
|
1587
1603
|
}
|
|
@@ -1635,8 +1651,9 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1635
1651
|
* A `<tx.id>:finished` hub event is fired after success or failure.
|
|
1636
1652
|
*
|
|
1637
1653
|
* @param transactionId - The ID of the transaction to approve.
|
|
1654
|
+
* @param traceContext - The parent context for any new traces.
|
|
1638
1655
|
*/
|
|
1639
|
-
async approveTransaction(transactionId) {
|
|
1656
|
+
async approveTransaction(transactionId, traceContext) {
|
|
1640
1657
|
const cleanupTasks = new Array();
|
|
1641
1658
|
cleanupTasks.push(await this.mutex.acquire());
|
|
1642
1659
|
let transactionMeta = this.getTransactionOrThrow(transactionId);
|
|
@@ -1684,10 +1701,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1684
1701
|
};
|
|
1685
1702
|
});
|
|
1686
1703
|
this.onTransactionStatusChange(transactionMeta);
|
|
1687
|
-
const rawTx = await this.signTransaction(
|
|
1688
|
-
transactionMeta,
|
|
1689
|
-
transactionMeta.txParams
|
|
1690
|
-
);
|
|
1704
|
+
const rawTx = await _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _trace).call(this, { name: "Sign", parentContext: traceContext }, () => this.signTransaction(transactionMeta, transactionMeta.txParams));
|
|
1691
1705
|
if (!this.beforePublish(transactionMeta)) {
|
|
1692
1706
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Skipping publishing transaction based on hook");
|
|
1693
1707
|
this.messagingSystem.publish(
|
|
@@ -1712,13 +1726,16 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1712
1726
|
]);
|
|
1713
1727
|
}
|
|
1714
1728
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Publishing transaction", transactionMeta.txParams);
|
|
1715
|
-
let
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1729
|
+
let hash;
|
|
1730
|
+
await _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _trace).call(this, { name: "Publish", parentContext: traceContext }, async () => {
|
|
1731
|
+
({ transactionHash: hash } = await this.publish(
|
|
1732
|
+
transactionMeta,
|
|
1733
|
+
rawTx
|
|
1734
|
+
));
|
|
1735
|
+
if (hash === void 0) {
|
|
1736
|
+
hash = await this.publishTransaction(ethQuery, rawTx);
|
|
1737
|
+
}
|
|
1738
|
+
});
|
|
1722
1739
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Publish successful", hash);
|
|
1723
1740
|
transactionMeta = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, {
|
|
1724
1741
|
transactionId,
|
|
@@ -1849,11 +1866,19 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1849
1866
|
"submitted" /* submitted */
|
|
1850
1867
|
].includes(status);
|
|
1851
1868
|
}
|
|
1852
|
-
async requestApproval(txMeta, {
|
|
1869
|
+
async requestApproval(txMeta, {
|
|
1870
|
+
shouldShowRequest,
|
|
1871
|
+
traceContext
|
|
1872
|
+
}) {
|
|
1853
1873
|
const id = this.getApprovalId(txMeta);
|
|
1854
1874
|
const { origin } = txMeta;
|
|
1855
1875
|
const type = _controllerutils.ApprovalType.Transaction;
|
|
1856
1876
|
const requestData = { txId: txMeta.id };
|
|
1877
|
+
await _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _trace).call(this, {
|
|
1878
|
+
name: "Notification Display",
|
|
1879
|
+
id,
|
|
1880
|
+
parentContext: traceContext
|
|
1881
|
+
});
|
|
1857
1882
|
return await this.messagingSystem.call(
|
|
1858
1883
|
"ApprovalController:addRequest",
|
|
1859
1884
|
{
|
|
@@ -2234,6 +2259,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
2234
2259
|
_internalEvents = new WeakMap();
|
|
2235
2260
|
_incomingTransactionOptions = new WeakMap();
|
|
2236
2261
|
_pendingTransactionOptions = new WeakMap();
|
|
2262
|
+
_trace = new WeakMap();
|
|
2237
2263
|
_transactionHistoryLimit = new WeakMap();
|
|
2238
2264
|
_isSimulationEnabled = new WeakMap();
|
|
2239
2265
|
_testGasFeeFlows = new WeakMap();
|
|
@@ -2380,7 +2406,7 @@ getGasFeeFlows_fn = function() {
|
|
|
2380
2406
|
if (_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _testGasFeeFlows)) {
|
|
2381
2407
|
return [new (0, _chunkTJMQEH57js.TestGasFeeFlow)()];
|
|
2382
2408
|
}
|
|
2383
|
-
return [new (0,
|
|
2409
|
+
return [new (0, _chunkOSRJHVMIjs.LineaGasFeeFlow)(), new (0, _chunkOBYKCUWHjs.DefaultGasFeeFlow)()];
|
|
2384
2410
|
};
|
|
2385
2411
|
_getLayer1GasFeeFlows = new WeakSet();
|
|
2386
2412
|
getLayer1GasFeeFlows_fn = function() {
|
|
@@ -2563,4 +2589,4 @@ getSelectedAccount_fn = function() {
|
|
|
2563
2589
|
|
|
2564
2590
|
|
|
2565
2591
|
exports.HARDFORK = HARDFORK; exports.CANCEL_RATE = CANCEL_RATE; exports.SPEED_UP_RATE = SPEED_UP_RATE; exports.ApprovalState = ApprovalState; exports.TransactionController = TransactionController;
|
|
2566
|
-
//# sourceMappingURL=chunk-
|
|
2592
|
+
//# sourceMappingURL=chunk-4H5MCBPU.js.map
|