@metamask/transaction-controller 27.0.0 → 28.0.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 +15 -15
- package/dist/TransactionController.mjs +14 -14
- package/dist/{chunk-7HNSDVVO.mjs → chunk-2XFBWPHD.mjs} +2 -2
- package/dist/{chunk-5WFLNKCL.js → chunk-2XKEAKQG.js} +11 -5
- package/dist/chunk-2XKEAKQG.js.map +1 -0
- package/dist/{chunk-C3UHJPYJ.js → chunk-3JEUO765.js} +6 -6
- package/dist/{chunk-V5X6MZHN.js → chunk-3VF7ZGRV.js} +126 -63
- package/dist/chunk-3VF7ZGRV.js.map +1 -0
- package/dist/{chunk-DTMKGTYC.mjs → chunk-4VLQV2GA.mjs} +48 -2
- package/dist/chunk-4VLQV2GA.mjs.map +1 -0
- package/dist/{chunk-JW6P2G5A.mjs → chunk-53IYIDVS.mjs} +2 -2
- package/dist/{chunk-GRQB2ARK.js → chunk-AO3AE3L7.js} +3 -3
- package/dist/{chunk-I7VD6IET.js → chunk-CPYXP2OC.js} +3 -3
- package/dist/{chunk-KKCD5UMP.mjs → chunk-CWWZQZVR.mjs} +2 -2
- package/dist/{chunk-RIYIJTEU.mjs → chunk-DOX6H5UJ.mjs} +2 -2
- package/dist/{chunk-HLG525BC.mjs → chunk-DRSMLO7B.mjs} +2 -2
- package/dist/{chunk-QG2WVQE3.js → chunk-ETMW527M.js} +9 -9
- package/dist/{chunk-VP2DBWOT.js → chunk-F247MMTE.js} +3 -3
- package/dist/{chunk-H7O3Y7EQ.mjs → chunk-H6NWVGHL.mjs} +85 -48
- package/dist/chunk-H6NWVGHL.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-UUSYJGGQ.js → chunk-L337FYVS.js} +3 -3
- package/dist/{chunk-A4P4B3OF.mjs → chunk-L7ZKSKEI.mjs} +125 -62
- package/dist/chunk-L7ZKSKEI.mjs.map +1 -0
- package/dist/{chunk-WIZVJM2B.js → chunk-LQS2M5QR.js} +48 -2
- package/dist/chunk-LQS2M5QR.js.map +1 -0
- package/dist/{chunk-6V2LR6JL.js → chunk-LYD4TEKH.js} +5 -5
- package/dist/{chunk-W3CS5GRD.mjs → chunk-NOHEXQ7Y.mjs} +11 -5
- package/dist/chunk-NOHEXQ7Y.mjs.map +1 -0
- package/dist/{chunk-TZEAWUXE.mjs → chunk-P74YLPJO.mjs} +2 -2
- package/dist/{chunk-TJXPMOA6.mjs → chunk-RBF6CW7D.mjs} +2 -2
- package/dist/{chunk-FTB6MCSH.mjs → chunk-RXRJSBSF.mjs} +2 -2
- package/dist/{chunk-RU6NJIUD.mjs → chunk-TKWTUPCQ.mjs} +3 -3
- package/dist/{chunk-XZILQVNW.js → chunk-UBXRAA6G.js} +3 -3
- package/dist/{chunk-HUVOOFOM.js → chunk-V6UIRCOF.js} +43 -33
- package/dist/chunk-V6UIRCOF.js.map +1 -0
- package/dist/{chunk-QTQSCTQA.js → chunk-WLCFETHR.js} +10 -10
- package/dist/{chunk-YS23EOJX.js → chunk-X5WPBDI5.js} +100 -63
- package/dist/chunk-X5WPBDI5.js.map +1 -0
- package/dist/constants.js +6 -2
- package/dist/constants.mjs +5 -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 +3 -3
- package/dist/gas-flows/OptimismLayer1GasFeeFlow.mjs +2 -2
- 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 +15 -15
- package/dist/index.mjs +14 -14
- 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 +22 -0
- package/dist/types/constants.d.ts.map +1 -1
- 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/types/utils/simulation.d.ts +7 -0
- package/dist/types/utils/simulation.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 +5 -2
- package/dist/utils/simulation.mjs +4 -1
- 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-5WFLNKCL.js.map +0 -1
- package/dist/chunk-A4P4B3OF.mjs.map +0 -1
- package/dist/chunk-DTMKGTYC.mjs.map +0 -1
- package/dist/chunk-H7O3Y7EQ.mjs.map +0 -1
- package/dist/chunk-HUVOOFOM.js.map +0 -1
- package/dist/chunk-V5X6MZHN.js.map +0 -1
- package/dist/chunk-W3CS5GRD.mjs.map +0 -1
- package/dist/chunk-WIZVJM2B.js.map +0 -1
- package/dist/chunk-YS23EOJX.js.map +0 -1
- /package/dist/{chunk-7HNSDVVO.mjs.map → chunk-2XFBWPHD.mjs.map} +0 -0
- /package/dist/{chunk-C3UHJPYJ.js.map → chunk-3JEUO765.js.map} +0 -0
- /package/dist/{chunk-JW6P2G5A.mjs.map → chunk-53IYIDVS.mjs.map} +0 -0
- /package/dist/{chunk-GRQB2ARK.js.map → chunk-AO3AE3L7.js.map} +0 -0
- /package/dist/{chunk-I7VD6IET.js.map → chunk-CPYXP2OC.js.map} +0 -0
- /package/dist/{chunk-KKCD5UMP.mjs.map → chunk-CWWZQZVR.mjs.map} +0 -0
- /package/dist/{chunk-RIYIJTEU.mjs.map → chunk-DOX6H5UJ.mjs.map} +0 -0
- /package/dist/{chunk-HLG525BC.mjs.map → chunk-DRSMLO7B.mjs.map} +0 -0
- /package/dist/{chunk-QG2WVQE3.js.map → chunk-ETMW527M.js.map} +0 -0
- /package/dist/{chunk-VP2DBWOT.js.map → chunk-F247MMTE.js.map} +0 -0
- /package/dist/{chunk-UUSYJGGQ.js.map → chunk-L337FYVS.js.map} +0 -0
- /package/dist/{chunk-6V2LR6JL.js.map → chunk-LYD4TEKH.js.map} +0 -0
- /package/dist/{chunk-TZEAWUXE.mjs.map → chunk-P74YLPJO.mjs.map} +0 -0
- /package/dist/{chunk-TJXPMOA6.mjs.map → chunk-RBF6CW7D.mjs.map} +0 -0
- /package/dist/{chunk-FTB6MCSH.mjs.map → chunk-RXRJSBSF.mjs.map} +0 -0
- /package/dist/{chunk-RU6NJIUD.mjs.map → chunk-TKWTUPCQ.mjs.map} +0 -0
- /package/dist/{chunk-XZILQVNW.js.map → chunk-UBXRAA6G.js.map} +0 -0
- /package/dist/{chunk-QTQSCTQA.js.map → chunk-WLCFETHR.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHAIN_IDS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4VLQV2GA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
projectLogger
|
|
6
6
|
} from "./chunk-UQQWZT6C.mjs";
|
|
@@ -129,4 +129,4 @@ buildTransactionCommon_fn = function(transactionMeta) {
|
|
|
129
129
|
export {
|
|
130
130
|
OptimismLayer1GasFeeFlow
|
|
131
131
|
};
|
|
132
|
-
//# sourceMappingURL=chunk-
|
|
132
|
+
//# sourceMappingURL=chunk-53IYIDVS.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLQS2M5QRjs = require('./chunk-LQS2M5QR.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -97,7 +97,7 @@ async function getGas(request) {
|
|
|
97
97
|
log("Using original estimate as custom network");
|
|
98
98
|
return [estimatedGas, simulationFails];
|
|
99
99
|
}
|
|
100
|
-
const bufferMultiplier =
|
|
100
|
+
const bufferMultiplier = _chunkLQS2M5QRjs.GAS_BUFFER_CHAIN_OVERRIDES[chainId] ?? DEFAULT_GAS_MULTIPLIER;
|
|
101
101
|
const bufferedGas = addGasBuffer(
|
|
102
102
|
estimatedGas,
|
|
103
103
|
blockGasLimit,
|
|
@@ -134,4 +134,4 @@ async function getLatestBlock(ethQuery) {
|
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
exports.log = log; exports.FIXED_GAS = FIXED_GAS; exports.DEFAULT_GAS_MULTIPLIER = DEFAULT_GAS_MULTIPLIER; exports.updateGas = updateGas; exports.estimateGas = estimateGas; exports.addGasBuffer = addGasBuffer;
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
137
|
+
//# sourceMappingURL=chunk-AO3AE3L7.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk3JEUO765js = require('./chunk-3JEUO765.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -275,7 +275,7 @@ startTrackingByNetworkClientId_fn = function(networkClientId) {
|
|
|
275
275
|
} = _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _getNetworkClientById).call(this, networkClientId);
|
|
276
276
|
let etherscanRemoteTransactionSource = _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _etherscanRemoteTransactionSourcesMap).get(chainId);
|
|
277
277
|
if (!etherscanRemoteTransactionSource) {
|
|
278
|
-
etherscanRemoteTransactionSource = new (0,
|
|
278
|
+
etherscanRemoteTransactionSource = new (0, _chunk3JEUO765js.EtherscanRemoteTransactionSource)({
|
|
279
279
|
includeTokenTransfers: _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _incomingTransactionOptions).includeTokenTransfers
|
|
280
280
|
});
|
|
281
281
|
_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _etherscanRemoteTransactionSourcesMap).set(
|
|
@@ -332,4 +332,4 @@ getNetworkClient_fn = function({
|
|
|
332
332
|
|
|
333
333
|
|
|
334
334
|
exports.MultichainTrackingHelper = MultichainTrackingHelper;
|
|
335
|
-
//# sourceMappingURL=chunk-
|
|
335
|
+
//# sourceMappingURL=chunk-CPYXP2OC.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
gweiDecimalToWeiHex
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-P74YLPJO.mjs";
|
|
4
4
|
import {
|
|
5
5
|
projectLogger
|
|
6
6
|
} from "./chunk-UQQWZT6C.mjs";
|
|
@@ -87,4 +87,4 @@ getLegacyLevel_fn = function(gasFeeEstimates, level) {
|
|
|
87
87
|
export {
|
|
88
88
|
DefaultGasFeeFlow
|
|
89
89
|
};
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-CWWZQZVR.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ETHERSCAN_SUPPORTED_NETWORKS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4VLQV2GA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
incomingTransactionsLogger
|
|
6
6
|
} from "./chunk-UQQWZT6C.mjs";
|
|
@@ -82,4 +82,4 @@ export {
|
|
|
82
82
|
fetchEtherscanTokenTransactions,
|
|
83
83
|
getEtherscanApiHost
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-DOX6H5UJ.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GAS_BUFFER_CHAIN_OVERRIDES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4VLQV2GA.mjs";
|
|
4
4
|
import {
|
|
5
5
|
projectLogger
|
|
6
6
|
} from "./chunk-UQQWZT6C.mjs";
|
|
@@ -134,4 +134,4 @@ export {
|
|
|
134
134
|
estimateGas,
|
|
135
135
|
addGasBuffer
|
|
136
136
|
};
|
|
137
|
-
//# sourceMappingURL=chunk-
|
|
137
|
+
//# sourceMappingURL=chunk-DRSMLO7B.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLQS2M5QRjs = require('./chunk-LQS2M5QR.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -18,13 +18,13 @@ var _utils = require('@metamask/utils');
|
|
|
18
18
|
var _bnjs = require('bn.js'); var _bnjs2 = _interopRequireDefault(_bnjs);
|
|
19
19
|
var _lodash = require('lodash');
|
|
20
20
|
var OPTIMISM_STACK_CHAIN_IDS = [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
_chunkLQS2M5QRjs.CHAIN_IDS.OPTIMISM,
|
|
22
|
+
_chunkLQS2M5QRjs.CHAIN_IDS.OPTIMISM_TESTNET,
|
|
23
|
+
_chunkLQS2M5QRjs.CHAIN_IDS.BASE,
|
|
24
|
+
_chunkLQS2M5QRjs.CHAIN_IDS.BASE_TESTNET,
|
|
25
|
+
_chunkLQS2M5QRjs.CHAIN_IDS.OPBNB,
|
|
26
|
+
_chunkLQS2M5QRjs.CHAIN_IDS.OPBNB_TESTNET,
|
|
27
|
+
_chunkLQS2M5QRjs.CHAIN_IDS.ZORA
|
|
28
28
|
];
|
|
29
29
|
var log = _utils.createModuleLogger.call(void 0, _chunkS6VGOPUYjs.projectLogger, "optimisim-layer1-gas-fee-flow");
|
|
30
30
|
var OPTIMISM_GAS_PRICE_ORACLE_ABI = [
|
|
@@ -129,4 +129,4 @@ buildTransactionCommon_fn = function(transactionMeta) {
|
|
|
129
129
|
|
|
130
130
|
|
|
131
131
|
exports.OptimismLayer1GasFeeFlow = OptimismLayer1GasFeeFlow;
|
|
132
|
-
//# sourceMappingURL=chunk-
|
|
132
|
+
//# sourceMappingURL=chunk-ETMW527M.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkLQS2M5QRjs = require('./chunk-LQS2M5QR.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -70,7 +70,7 @@ function getEtherscanApiUrl(chainId, urlParams) {
|
|
|
70
70
|
return url;
|
|
71
71
|
}
|
|
72
72
|
function getEtherscanApiHost(chainId) {
|
|
73
|
-
const networkInfo =
|
|
73
|
+
const networkInfo = _chunkLQS2M5QRjs.ETHERSCAN_SUPPORTED_NETWORKS[chainId];
|
|
74
74
|
if (!networkInfo) {
|
|
75
75
|
throw new Error(`Etherscan does not support chain with ID: ${chainId}`);
|
|
76
76
|
}
|
|
@@ -82,4 +82,4 @@ function getEtherscanApiHost(chainId) {
|
|
|
82
82
|
|
|
83
83
|
|
|
84
84
|
exports.fetchEtherscanTransactions = fetchEtherscanTransactions; exports.fetchEtherscanTokenTransactions = fetchEtherscanTokenTransactions; exports.getEtherscanApiHost = getEtherscanApiHost;
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-F247MMTE.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
addGasBuffer,
|
|
10
10
|
estimateGas,
|
|
11
11
|
updateGas
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-DRSMLO7B.mjs";
|
|
13
13
|
import {
|
|
14
14
|
addInitialHistorySnapshot,
|
|
15
15
|
updateTransactionHistory
|
|
@@ -20,26 +20,26 @@ import {
|
|
|
20
20
|
} from "./chunk-NHRBO3LU.mjs";
|
|
21
21
|
import {
|
|
22
22
|
getSimulationData
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-L7ZKSKEI.mjs";
|
|
24
24
|
import {
|
|
25
25
|
OptimismLayer1GasFeeFlow
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-53IYIDVS.mjs";
|
|
27
27
|
import {
|
|
28
28
|
GasFeePoller
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-HHK4QSNF.mjs";
|
|
30
30
|
import {
|
|
31
31
|
getTransactionLayer1GasFee,
|
|
32
32
|
updateTransactionLayer1GasFee
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-NOHEXQ7Y.mjs";
|
|
34
34
|
import {
|
|
35
35
|
IncomingTransactionHelper
|
|
36
36
|
} from "./chunk-Y7ENNK7L.mjs";
|
|
37
37
|
import {
|
|
38
38
|
MultichainTrackingHelper
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-RXRJSBSF.mjs";
|
|
40
40
|
import {
|
|
41
41
|
EtherscanRemoteTransactionSource
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-TKWTUPCQ.mjs";
|
|
43
43
|
import {
|
|
44
44
|
PendingTransactionTracker
|
|
45
45
|
} from "./chunk-5YES3V2R.mjs";
|
|
@@ -48,17 +48,17 @@ import {
|
|
|
48
48
|
} from "./chunk-FRKQ3Z2L.mjs";
|
|
49
49
|
import {
|
|
50
50
|
LineaGasFeeFlow
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-2XFBWPHD.mjs";
|
|
52
52
|
import {
|
|
53
53
|
DefaultGasFeeFlow
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-CWWZQZVR.mjs";
|
|
55
55
|
import {
|
|
56
56
|
updateGasFees
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-P74YLPJO.mjs";
|
|
58
58
|
import {
|
|
59
59
|
updatePostTransactionBalance,
|
|
60
60
|
updateSwapsTransaction
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-RBF6CW7D.mjs";
|
|
62
62
|
import {
|
|
63
63
|
getIncreasedPriceFromExisting,
|
|
64
64
|
isEIP1559Transaction,
|
|
@@ -134,7 +134,7 @@ function getDefaultTransactionControllerState() {
|
|
|
134
134
|
lastFetchedBlockNumbers: {}
|
|
135
135
|
};
|
|
136
136
|
}
|
|
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;
|
|
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, _onGasFeePollerTransactionUpdate, onGasFeePollerTransactionUpdate_fn;
|
|
138
138
|
var TransactionController = class extends BaseController {
|
|
139
139
|
/**
|
|
140
140
|
* Constructs a TransactionController.
|
|
@@ -217,6 +217,7 @@ var TransactionController = class extends BaseController {
|
|
|
217
217
|
__privateAdd(this, _checkIfTransactionParamsUpdated);
|
|
218
218
|
__privateAdd(this, _onTransactionParamsUpdated);
|
|
219
219
|
__privateAdd(this, _updateSimulationData);
|
|
220
|
+
__privateAdd(this, _onGasFeePollerTransactionUpdate);
|
|
220
221
|
__privateAdd(this, _internalEvents, new EventEmitter());
|
|
221
222
|
this.inProcessOfSigning = /* @__PURE__ */ new Set();
|
|
222
223
|
this.mutex = new Mutex();
|
|
@@ -323,7 +324,7 @@ var TransactionController = class extends BaseController {
|
|
|
323
324
|
});
|
|
324
325
|
gasFeePoller.hub.on(
|
|
325
326
|
"transaction-updated",
|
|
326
|
-
|
|
327
|
+
__privateMethod(this, _onGasFeePollerTransactionUpdate, onGasFeePollerTransactionUpdate_fn).bind(this)
|
|
327
328
|
);
|
|
328
329
|
this.messagingSystem.subscribe(
|
|
329
330
|
"TransactionController:stateChange",
|
|
@@ -857,10 +858,8 @@ var TransactionController = class extends BaseController {
|
|
|
857
858
|
* @param note - A note or update reason to include in the transaction history.
|
|
858
859
|
*/
|
|
859
860
|
updateTransaction(transactionMeta, note) {
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
skipHistory: this.isHistoryDisabled
|
|
863
|
-
});
|
|
861
|
+
const { id: transactionId } = transactionMeta;
|
|
862
|
+
__privateMethod(this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, note, skipHistory: this.isHistoryDisabled }, () => ({ ...transactionMeta }));
|
|
864
863
|
}
|
|
865
864
|
/**
|
|
866
865
|
* Update the security alert response for a transaction.
|
|
@@ -1367,18 +1366,23 @@ var TransactionController = class extends BaseController {
|
|
|
1367
1366
|
return filteredTransactions;
|
|
1368
1367
|
}
|
|
1369
1368
|
/**
|
|
1370
|
-
*
|
|
1369
|
+
* Determine the layer 1 gas fee for the given transaction parameters.
|
|
1371
1370
|
*
|
|
1372
|
-
* @param
|
|
1373
|
-
* @param
|
|
1374
|
-
* @param
|
|
1371
|
+
* @param request - The request object.
|
|
1372
|
+
* @param request.transactionParams - The transaction parameters to estimate the layer 1 gas fee for.
|
|
1373
|
+
* @param request.chainId - The ID of the chain where the transaction will be executed.
|
|
1374
|
+
* @param request.networkClientId - The ID of a specific network client to process the transaction.
|
|
1375
1375
|
*/
|
|
1376
|
-
async getLayer1GasFee(
|
|
1376
|
+
async getLayer1GasFee({
|
|
1377
|
+
transactionParams,
|
|
1378
|
+
chainId,
|
|
1379
|
+
networkClientId
|
|
1380
|
+
}) {
|
|
1377
1381
|
const provider = __privateGet(this, _multichainTrackingHelper).getProvider({
|
|
1378
1382
|
networkClientId,
|
|
1379
1383
|
chainId
|
|
1380
1384
|
});
|
|
1381
|
-
|
|
1385
|
+
return await getTransactionLayer1GasFee({
|
|
1382
1386
|
layer1GasFeeFlows: this.layer1GasFeeFlows,
|
|
1383
1387
|
provider,
|
|
1384
1388
|
transactionMeta: {
|
|
@@ -1386,7 +1390,6 @@ var TransactionController = class extends BaseController {
|
|
|
1386
1390
|
chainId
|
|
1387
1391
|
}
|
|
1388
1392
|
});
|
|
1389
|
-
return layer1GasFee;
|
|
1390
1393
|
}
|
|
1391
1394
|
async signExternalTransaction(chainId, transactionParams) {
|
|
1392
1395
|
if (!this.sign) {
|
|
@@ -2327,25 +2330,36 @@ getLayer1GasFeeFlows_fn = function() {
|
|
|
2327
2330
|
return [new OptimismLayer1GasFeeFlow()];
|
|
2328
2331
|
};
|
|
2329
2332
|
_updateTransactionInternal = new WeakSet();
|
|
2330
|
-
updateTransactionInternal_fn = function(
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
const updatedTransactionParams = __privateMethod(this, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn).call(this, normalizedTransaction);
|
|
2337
|
-
const transactionWithUpdatedHistory = skipHistory === true ? normalizedTransaction : updateTransactionHistory(
|
|
2338
|
-
normalizedTransaction,
|
|
2339
|
-
note ?? "Transaction updated"
|
|
2340
|
-
);
|
|
2333
|
+
updateTransactionInternal_fn = function({
|
|
2334
|
+
transactionId,
|
|
2335
|
+
note,
|
|
2336
|
+
skipHistory
|
|
2337
|
+
}, callback) {
|
|
2338
|
+
let updatedTransactionParams = [];
|
|
2341
2339
|
this.update((state) => {
|
|
2342
2340
|
const index = state.transactions.findIndex(
|
|
2343
|
-
({ id }) =>
|
|
2341
|
+
({ id }) => id === transactionId
|
|
2344
2342
|
);
|
|
2345
|
-
state.transactions[index]
|
|
2343
|
+
let transactionMeta2 = state.transactions[index];
|
|
2344
|
+
transactionMeta2 = callback(transactionMeta2) ?? transactionMeta2;
|
|
2345
|
+
transactionMeta2.txParams = normalizeTransactionParams(
|
|
2346
|
+
transactionMeta2.txParams
|
|
2347
|
+
);
|
|
2348
|
+
validateTxParams(transactionMeta2.txParams);
|
|
2349
|
+
updatedTransactionParams = __privateMethod(this, _checkIfTransactionParamsUpdated, checkIfTransactionParamsUpdated_fn).call(this, transactionMeta2);
|
|
2350
|
+
if (skipHistory !== true) {
|
|
2351
|
+
transactionMeta2 = updateTransactionHistory(
|
|
2352
|
+
transactionMeta2,
|
|
2353
|
+
note ?? "Transaction updated"
|
|
2354
|
+
);
|
|
2355
|
+
}
|
|
2356
|
+
state.transactions[index] = transactionMeta2;
|
|
2346
2357
|
});
|
|
2358
|
+
const transactionMeta = this.getTransaction(
|
|
2359
|
+
transactionId
|
|
2360
|
+
);
|
|
2347
2361
|
if (updatedTransactionParams.length > 0) {
|
|
2348
|
-
__privateMethod(this, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn).call(this,
|
|
2362
|
+
__privateMethod(this, _onTransactionParamsUpdated, onTransactionParamsUpdated_fn).call(this, transactionMeta, updatedTransactionParams);
|
|
2349
2363
|
}
|
|
2350
2364
|
};
|
|
2351
2365
|
_checkIfTransactionParamsUpdated = new WeakSet();
|
|
@@ -2379,7 +2393,7 @@ onTransactionParamsUpdated_fn = function(transactionMeta, updatedParams) {
|
|
|
2379
2393
|
};
|
|
2380
2394
|
_updateSimulationData = new WeakSet();
|
|
2381
2395
|
updateSimulationData_fn = async function(transactionMeta) {
|
|
2382
|
-
const { id, chainId, txParams } = transactionMeta;
|
|
2396
|
+
const { id: transactionId, chainId, txParams } = transactionMeta;
|
|
2383
2397
|
const { from, to, value, data } = txParams;
|
|
2384
2398
|
let simulationData = {
|
|
2385
2399
|
error: {
|
|
@@ -2389,7 +2403,9 @@ updateSimulationData_fn = async function(transactionMeta) {
|
|
|
2389
2403
|
tokenBalanceChanges: []
|
|
2390
2404
|
};
|
|
2391
2405
|
if (__privateGet(this, _isSimulationEnabled).call(this)) {
|
|
2392
|
-
__privateMethod(this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, {
|
|
2406
|
+
__privateMethod(this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, skipHistory: true }, (txMeta) => {
|
|
2407
|
+
txMeta.simulationData = void 0;
|
|
2408
|
+
});
|
|
2393
2409
|
simulationData = await getSimulationData({
|
|
2394
2410
|
chainId,
|
|
2395
2411
|
from,
|
|
@@ -2398,20 +2414,41 @@ updateSimulationData_fn = async function(transactionMeta) {
|
|
|
2398
2414
|
data
|
|
2399
2415
|
});
|
|
2400
2416
|
}
|
|
2401
|
-
const finalTransactionMeta = this.getTransaction(
|
|
2417
|
+
const finalTransactionMeta = this.getTransaction(transactionId);
|
|
2402
2418
|
if (!finalTransactionMeta) {
|
|
2403
2419
|
projectLogger(
|
|
2404
2420
|
"Cannot update simulation data as transaction not found",
|
|
2405
|
-
|
|
2421
|
+
transactionId,
|
|
2406
2422
|
simulationData
|
|
2407
2423
|
);
|
|
2408
2424
|
return;
|
|
2409
2425
|
}
|
|
2410
|
-
this.
|
|
2411
|
-
|
|
2412
|
-
"TransactionController#updateSimulationData - Update simulation data"
|
|
2413
|
-
)
|
|
2414
|
-
|
|
2426
|
+
__privateMethod(this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, {
|
|
2427
|
+
transactionId,
|
|
2428
|
+
note: "TransactionController#updateSimulationData - Update simulation data"
|
|
2429
|
+
}, (txMeta) => {
|
|
2430
|
+
txMeta.simulationData = simulationData;
|
|
2431
|
+
});
|
|
2432
|
+
projectLogger("Updated simulation data", transactionId, simulationData);
|
|
2433
|
+
};
|
|
2434
|
+
_onGasFeePollerTransactionUpdate = new WeakSet();
|
|
2435
|
+
onGasFeePollerTransactionUpdate_fn = function({
|
|
2436
|
+
transactionId,
|
|
2437
|
+
gasFeeEstimates,
|
|
2438
|
+
gasFeeEstimatesLoaded,
|
|
2439
|
+
layer1GasFee
|
|
2440
|
+
}) {
|
|
2441
|
+
__privateMethod(this, _updateTransactionInternal, updateTransactionInternal_fn).call(this, { transactionId, skipHistory: true }, (txMeta) => {
|
|
2442
|
+
if (gasFeeEstimates) {
|
|
2443
|
+
txMeta.gasFeeEstimates = gasFeeEstimates;
|
|
2444
|
+
}
|
|
2445
|
+
if (gasFeeEstimatesLoaded !== void 0) {
|
|
2446
|
+
txMeta.gasFeeEstimatesLoaded = gasFeeEstimatesLoaded;
|
|
2447
|
+
}
|
|
2448
|
+
if (layer1GasFee) {
|
|
2449
|
+
txMeta.layer1GasFee = layer1GasFee;
|
|
2450
|
+
}
|
|
2451
|
+
});
|
|
2415
2452
|
};
|
|
2416
2453
|
|
|
2417
2454
|
export {
|
|
@@ -2421,4 +2458,4 @@ export {
|
|
|
2421
2458
|
ApprovalState,
|
|
2422
2459
|
TransactionController
|
|
2423
2460
|
};
|
|
2424
|
-
//# sourceMappingURL=chunk-
|
|
2461
|
+
//# sourceMappingURL=chunk-H6NWVGHL.mjs.map
|