@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
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [28.1.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Support retrieval of layer 1 gas fees on Scroll networks ([#4155](https://github.com/MetaMask/core/pull/4155))
|
|
15
|
+
|
|
16
|
+
## [28.0.0]
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- **BREAKING:** Change `getLayer1GasFee` arguments to a request object ([#4149](https://github.com/MetaMask/core/pull/4149))
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Fix automatic update of layer 1 gas fee after interval ([#4149](https://github.com/MetaMask/core/pull/4149))
|
|
25
|
+
|
|
10
26
|
## [27.0.1]
|
|
11
27
|
|
|
12
28
|
### Fixed
|
|
@@ -764,7 +780,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
764
780
|
|
|
765
781
|
All changes listed after this point were applied to this package following the monorepo conversion.
|
|
766
782
|
|
|
767
|
-
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@
|
|
783
|
+
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@28.1.0...HEAD
|
|
784
|
+
[28.1.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@28.0.0...@metamask/transaction-controller@28.1.0
|
|
785
|
+
[28.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@27.0.1...@metamask/transaction-controller@28.0.0
|
|
768
786
|
[27.0.1]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@27.0.0...@metamask/transaction-controller@27.0.1
|
|
769
787
|
[27.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@26.0.0...@metamask/transaction-controller@27.0.0
|
|
770
788
|
[26.0.0]: https://github.com/MetaMask/core/compare/@metamask/transaction-controller@25.3.0...@metamask/transaction-controller@26.0.0
|
|
@@ -4,31 +4,33 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkDMMUAJKYjs = require('./chunk-DMMUAJKY.js');
|
|
8
|
+
require('./chunk-JAYYMCBQ.js');
|
|
9
|
+
require('./chunk-KT6UAKBB.js');
|
|
8
10
|
require('./chunk-SD6CWFDF.js');
|
|
9
11
|
require('./chunk-VH47Q6TS.js');
|
|
10
|
-
require('./chunk-
|
|
12
|
+
require('./chunk-7LXE4KHV.js');
|
|
13
|
+
require('./chunk-V72C4MCR.js');
|
|
11
14
|
require('./chunk-QP75SWIQ.js');
|
|
12
15
|
require('./chunk-ZNZEJDOE.js');
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
15
|
-
require('./chunk-
|
|
16
|
-
require('./chunk-
|
|
17
|
-
require('./chunk-
|
|
16
|
+
require('./chunk-NYKRCWBG.js');
|
|
17
|
+
require('./chunk-WR5F34OW.js');
|
|
18
|
+
require('./chunk-YVCX6Z75.js');
|
|
19
|
+
require('./chunk-V6UIRCOF.js');
|
|
20
|
+
require('./chunk-2XKEAKQG.js');
|
|
18
21
|
require('./chunk-DTDTOMTB.js');
|
|
19
|
-
require('./chunk-
|
|
20
|
-
require('./chunk-
|
|
22
|
+
require('./chunk-5XQ2KRYL.js');
|
|
23
|
+
require('./chunk-EQT25RSP.js');
|
|
24
|
+
require('./chunk-FDUCRHYT.js');
|
|
21
25
|
require('./chunk-5KMU2IAT.js');
|
|
22
|
-
require('./chunk-F247MMTE.js');
|
|
23
|
-
require('./chunk-7LXE4KHV.js');
|
|
24
26
|
require('./chunk-HMOSP33F.js');
|
|
25
|
-
require('./chunk-
|
|
26
|
-
require('./chunk-
|
|
27
|
-
require('./chunk-
|
|
28
|
-
require('./chunk-
|
|
27
|
+
require('./chunk-LNX4JTOL.js');
|
|
28
|
+
require('./chunk-4RJXBKSR.js');
|
|
29
|
+
require('./chunk-EQNKFFTM.js');
|
|
30
|
+
require('./chunk-C2LNDHP4.js');
|
|
29
31
|
require('./chunk-UGFBA4GV.js');
|
|
30
32
|
require('./chunk-UH7FNVKS.js');
|
|
31
|
-
require('./chunk-
|
|
33
|
+
require('./chunk-UGN7PBON.js');
|
|
32
34
|
require('./chunk-S6VGOPUY.js');
|
|
33
35
|
require('./chunk-FK7AP6SH.js');
|
|
34
36
|
require('./chunk-Z4BLTVTB.js');
|
|
@@ -38,5 +40,5 @@ require('./chunk-Z4BLTVTB.js');
|
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
|
|
41
|
-
exports.ApprovalState =
|
|
43
|
+
exports.ApprovalState = _chunkDMMUAJKYjs.ApprovalState; exports.CANCEL_RATE = _chunkDMMUAJKYjs.CANCEL_RATE; exports.HARDFORK = _chunkDMMUAJKYjs.HARDFORK; exports.SPEED_UP_RATE = _chunkDMMUAJKYjs.SPEED_UP_RATE; exports.TransactionController = _chunkDMMUAJKYjs.TransactionController;
|
|
42
44
|
//# sourceMappingURL=TransactionController.js.map
|
|
@@ -4,31 +4,33 @@ import {
|
|
|
4
4
|
HARDFORK,
|
|
5
5
|
SPEED_UP_RATE,
|
|
6
6
|
TransactionController
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MG7HTD3H.mjs";
|
|
8
|
+
import "./chunk-IZVRGO3P.mjs";
|
|
9
|
+
import "./chunk-K4KOSAGM.mjs";
|
|
8
10
|
import "./chunk-KG4UW4K4.mjs";
|
|
9
11
|
import "./chunk-NM6OYEPP.mjs";
|
|
10
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-FRKQ3Z2L.mjs";
|
|
13
|
+
import "./chunk-5G6OHAXI.mjs";
|
|
11
14
|
import "./chunk-XGRAHX6T.mjs";
|
|
12
15
|
import "./chunk-NHRBO3LU.mjs";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
17
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-VEVVBHP3.mjs";
|
|
17
|
+
import "./chunk-Z4GV3YQQ.mjs";
|
|
18
|
+
import "./chunk-FG74Z3F5.mjs";
|
|
19
|
+
import "./chunk-HHK4QSNF.mjs";
|
|
20
|
+
import "./chunk-NOHEXQ7Y.mjs";
|
|
18
21
|
import "./chunk-Y7ENNK7L.mjs";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-F6E3TTR3.mjs";
|
|
23
|
+
import "./chunk-CPMTUMMZ.mjs";
|
|
24
|
+
import "./chunk-QZLPYOGC.mjs";
|
|
21
25
|
import "./chunk-5YES3V2R.mjs";
|
|
22
|
-
import "./chunk-DOX6H5UJ.mjs";
|
|
23
|
-
import "./chunk-FRKQ3Z2L.mjs";
|
|
24
26
|
import "./chunk-HQSNKCXI.mjs";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-NCRWKI6Y.mjs";
|
|
28
|
+
import "./chunk-NPEXNXSY.mjs";
|
|
29
|
+
import "./chunk-LDXTSESK.mjs";
|
|
30
|
+
import "./chunk-ZGUNOEUQ.mjs";
|
|
29
31
|
import "./chunk-J56A7UCK.mjs";
|
|
30
32
|
import "./chunk-TWND5SFD.mjs";
|
|
31
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-O6ZZVIFH.mjs";
|
|
32
34
|
import "./chunk-UQQWZT6C.mjs";
|
|
33
35
|
import "./chunk-YEJJKWT2.mjs";
|
|
34
36
|
import "./chunk-XUI43LEZ.mjs";
|
|
@@ -7,10 +7,12 @@ var _utils = require('@metamask/utils');
|
|
|
7
7
|
var log = _utils.createModuleLogger.call(void 0, _chunkS6VGOPUYjs.projectLogger, "layer-1-gas-fee-flow");
|
|
8
8
|
async function updateTransactionLayer1GasFee(request) {
|
|
9
9
|
const layer1GasFee = await getTransactionLayer1GasFee(request);
|
|
10
|
-
if (layer1GasFee) {
|
|
11
|
-
|
|
12
|
-
transactionMeta.layer1GasFee = layer1GasFee;
|
|
10
|
+
if (!layer1GasFee) {
|
|
11
|
+
return;
|
|
13
12
|
}
|
|
13
|
+
const { transactionMeta } = request;
|
|
14
|
+
transactionMeta.layer1GasFee = layer1GasFee;
|
|
15
|
+
log("Updated layer 1 gas fee", layer1GasFee, transactionMeta.id);
|
|
14
16
|
}
|
|
15
17
|
function getLayer1GasFeeFlow(transactionMeta, layer1GasFeeFlows) {
|
|
16
18
|
return layer1GasFeeFlows.find(
|
|
@@ -27,9 +29,13 @@ async function getTransactionLayer1GasFee({
|
|
|
27
29
|
layer1GasFeeFlows
|
|
28
30
|
);
|
|
29
31
|
if (!layer1GasFeeFlow) {
|
|
30
|
-
log("Layer 1 gas fee flow not found", transactionMeta.id);
|
|
31
32
|
return void 0;
|
|
32
33
|
}
|
|
34
|
+
log(
|
|
35
|
+
"Found layer 1 gas fee flow",
|
|
36
|
+
layer1GasFeeFlow.constructor.name,
|
|
37
|
+
transactionMeta.id
|
|
38
|
+
);
|
|
33
39
|
try {
|
|
34
40
|
const { layer1Fee } = await layer1GasFeeFlow.getLayer1Fee({
|
|
35
41
|
provider,
|
|
@@ -46,4 +52,4 @@ async function getTransactionLayer1GasFee({
|
|
|
46
52
|
|
|
47
53
|
|
|
48
54
|
exports.updateTransactionLayer1GasFee = updateTransactionLayer1GasFee; exports.getTransactionLayer1GasFee = getTransactionLayer1GasFee;
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
55
|
+
//# sourceMappingURL=chunk-2XKEAKQG.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/layer1-gas-fee-flow.ts"],"names":[],"mappings":";;;;;AACA,SAAS,0BAAoC;AAK7C,IAAM,MAAM,mBAAmB,eAAe,sBAAsB;AAepE,eAAsB,8BACpB,SACA;AACA,QAAM,eAAe,MAAM,2BAA2B,OAAO;AAE7D,MAAI,CAAC,cAAc;AACjB;AAAA,EACF;AAEA,QAAM,EAAE,gBAAgB,IAAI;AAE5B,kBAAgB,eAAe;AAE/B,MAAI,2BAA2B,cAAc,gBAAgB,EAAE;AACjE;AAQA,SAAS,oBACP,iBACA,mBAC8B;AAC9B,SAAO,kBAAkB;AAAA,IAAK,CAAC,qBAC7B,iBAAiB,mBAAmB,eAAe;AAAA,EACrD;AACF;AASA,eAAsB,2BAA2B;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AACF,GAAwD;AACtD,QAAM,mBAAmB;AAAA,IACvB;AAAA,IACA;AAAA,EACF;AAEA,MAAI,CAAC,kBAAkB;AACrB,WAAO;AAAA,EACT;AAEA;AAAA,IACE;AAAA,IACA,iBAAiB,YAAY;AAAA,IAC7B,gBAAgB;AAAA,EAClB;AAEA,MAAI;AACF,UAAM,EAAE,UAAU,IAAI,MAAM,iBAAiB,aAAa;AAAA,MACxD;AAAA,MACA;AAAA,IACF,CAAC;AACD,WAAO;AAAA,EACT,SAAS,OAAO;AACd,QAAI,iCAAiC,gBAAgB,IAAI,KAAK;AAC9D,WAAO;AAAA,EACT;AACF","sourcesContent":["import type { Provider } from '@metamask/network-controller';\nimport { createModuleLogger, type Hex } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type { Layer1GasFeeFlow, TransactionMeta } from '../types';\n\nconst log = createModuleLogger(projectLogger, 'layer-1-gas-fee-flow');\n\nexport type UpdateLayer1GasFeeRequest = {\n layer1GasFeeFlows: Layer1GasFeeFlow[];\n provider: Provider;\n transactionMeta: TransactionMeta;\n};\n\n/**\n * Updates the given transactionMeta with the layer 1 gas fee.\n * @param request - The request to use when getting the layer 1 gas fee.\n * @param request.provider - Provider used to create a new underlying EthQuery instance\n * @param request.transactionMeta - The transaction to get the layer 1 gas fee for.\n * @param request.layer1GasFeeFlows - The layer 1 gas fee flows to search.\n */\nexport async function updateTransactionLayer1GasFee(\n request: UpdateLayer1GasFeeRequest,\n) {\n const layer1GasFee = await getTransactionLayer1GasFee(request);\n\n if (!layer1GasFee) {\n return;\n }\n\n const { transactionMeta } = request;\n\n transactionMeta.layer1GasFee = layer1GasFee;\n\n log('Updated layer 1 gas fee', layer1GasFee, transactionMeta.id);\n}\n\n/**\n * Get the layer 1 gas fee flow for a transaction.\n * @param transactionMeta - The transaction to get the layer 1 gas fee flow for.\n * @param layer1GasFeeFlows - The layer 1 gas fee flows to search.\n * @returns The layer 1 gas fee flow for the transaction, or undefined if none match.\n */\nfunction getLayer1GasFeeFlow(\n transactionMeta: TransactionMeta,\n layer1GasFeeFlows: Layer1GasFeeFlow[],\n): Layer1GasFeeFlow | undefined {\n return layer1GasFeeFlows.find((layer1GasFeeFlow) =>\n layer1GasFeeFlow.matchesTransaction(transactionMeta),\n );\n}\n\n/**\n * Get the layer 1 gas fee for a transaction and return the layer1Fee.\n * @param request - The request to use when getting the layer 1 gas fee.\n * @param request.layer1GasFeeFlows - The layer 1 gas fee flows to search.\n * @param request.provider - The provider to use to get the layer 1 gas fee.\n * @param request.transactionMeta - The transaction to get the layer 1 gas fee for.\n */\nexport async function getTransactionLayer1GasFee({\n layer1GasFeeFlows,\n provider,\n transactionMeta,\n}: UpdateLayer1GasFeeRequest): Promise<Hex | undefined> {\n const layer1GasFeeFlow = getLayer1GasFeeFlow(\n transactionMeta,\n layer1GasFeeFlows,\n );\n\n if (!layer1GasFeeFlow) {\n return undefined;\n }\n\n log(\n 'Found layer 1 gas fee flow',\n layer1GasFeeFlow.constructor.name,\n transactionMeta.id,\n );\n\n try {\n const { layer1Fee } = await layer1GasFeeFlow.getLayer1Fee({\n provider,\n transactionMeta,\n });\n return layer1Fee;\n } catch (error) {\n log('Failed to get layer 1 gas fee', transactionMeta.id, error);\n return undefined;\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkEQNKFFTMjs = require('./chunk-EQNKFFTM.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -64,10 +64,10 @@ getEstimateLevel_fn = function({
|
|
|
64
64
|
};
|
|
65
65
|
_getFeeMarketLevel = new WeakSet();
|
|
66
66
|
getFeeMarketLevel_fn = function(gasFeeEstimates, level) {
|
|
67
|
-
const maxFeePerGas =
|
|
67
|
+
const maxFeePerGas = _chunkEQNKFFTMjs.gweiDecimalToWeiHex.call(void 0,
|
|
68
68
|
gasFeeEstimates[level].suggestedMaxFeePerGas
|
|
69
69
|
);
|
|
70
|
-
const maxPriorityFeePerGas =
|
|
70
|
+
const maxPriorityFeePerGas = _chunkEQNKFFTMjs.gweiDecimalToWeiHex.call(void 0,
|
|
71
71
|
gasFeeEstimates[level].suggestedMaxPriorityFeePerGas
|
|
72
72
|
);
|
|
73
73
|
return {
|
|
@@ -77,7 +77,7 @@ getFeeMarketLevel_fn = function(gasFeeEstimates, level) {
|
|
|
77
77
|
};
|
|
78
78
|
_getLegacyLevel = new WeakSet();
|
|
79
79
|
getLegacyLevel_fn = function(gasFeeEstimates, level) {
|
|
80
|
-
const gasPrice =
|
|
80
|
+
const gasPrice = _chunkEQNKFFTMjs.gweiDecimalToWeiHex.call(void 0, gasFeeEstimates[level]);
|
|
81
81
|
return {
|
|
82
82
|
maxFeePerGas: gasPrice,
|
|
83
83
|
maxPriorityFeePerGas: gasPrice
|
|
@@ -87,4 +87,4 @@ getLegacyLevel_fn = function(gasFeeEstimates, level) {
|
|
|
87
87
|
|
|
88
88
|
|
|
89
89
|
exports.DefaultGasFeeFlow = DefaultGasFeeFlow;
|
|
90
|
-
//# sourceMappingURL=chunk-
|
|
90
|
+
//# sourceMappingURL=chunk-4RJXBKSR.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GAS_BUFFER_CHAIN_OVERRIDES
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-O6ZZVIFH.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-5G6OHAXI.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 _chunkEQT25RSPjs = require('./chunk-EQT25RSP.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, _chunkEQT25RSPjs.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-5XQ2KRYL.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var _chunkUGFBA4GVjs = require('./chunk-UGFBA4GV.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkUGN7PBONjs = require('./chunk-UGN7PBON.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -57,15 +57,15 @@ var ZKSYNC_ERA_SWAPS_TOKEN_OBJECT = {
|
|
|
57
57
|
...ETH_SWAPS_TOKEN_OBJECT
|
|
58
58
|
};
|
|
59
59
|
var SWAPS_CHAINID_DEFAULT_TOKEN_MAP = {
|
|
60
|
-
[
|
|
60
|
+
[_chunkUGN7PBONjs.CHAIN_IDS.MAINNET]: ETH_SWAPS_TOKEN_OBJECT,
|
|
61
61
|
[SWAPS_TESTNET_CHAIN_ID]: TEST_ETH_SWAPS_TOKEN_OBJECT,
|
|
62
|
-
[
|
|
63
|
-
[
|
|
64
|
-
[
|
|
65
|
-
[
|
|
66
|
-
[
|
|
67
|
-
[
|
|
68
|
-
[
|
|
62
|
+
[_chunkUGN7PBONjs.CHAIN_IDS.BSC]: BNB_SWAPS_TOKEN_OBJECT,
|
|
63
|
+
[_chunkUGN7PBONjs.CHAIN_IDS.POLYGON]: MATIC_SWAPS_TOKEN_OBJECT,
|
|
64
|
+
[_chunkUGN7PBONjs.CHAIN_IDS.GOERLI]: GOERLI_SWAPS_TOKEN_OBJECT,
|
|
65
|
+
[_chunkUGN7PBONjs.CHAIN_IDS.AVALANCHE]: AVAX_SWAPS_TOKEN_OBJECT,
|
|
66
|
+
[_chunkUGN7PBONjs.CHAIN_IDS.OPTIMISM]: OPTIMISM_SWAPS_TOKEN_OBJECT,
|
|
67
|
+
[_chunkUGN7PBONjs.CHAIN_IDS.ARBITRUM]: ARBITRUM_SWAPS_TOKEN_OBJECT,
|
|
68
|
+
[_chunkUGN7PBONjs.CHAIN_IDS.ZKSYNC_ERA]: ZKSYNC_ERA_SWAPS_TOKEN_OBJECT
|
|
69
69
|
};
|
|
70
70
|
var SWAP_TRANSACTION_TYPES = [
|
|
71
71
|
"swap" /* swap */,
|
|
@@ -208,4 +208,4 @@ function sleep(ms) {
|
|
|
208
208
|
|
|
209
209
|
|
|
210
210
|
exports.UPDATE_POST_TX_BALANCE_TIMEOUT = UPDATE_POST_TX_BALANCE_TIMEOUT; exports.UPDATE_POST_TX_BALANCE_ATTEMPTS = UPDATE_POST_TX_BALANCE_ATTEMPTS; exports.DEFAULT_TOKEN_ADDRESS = DEFAULT_TOKEN_ADDRESS; exports.SWAPS_CHAINID_DEFAULT_TOKEN_MAP = SWAPS_CHAINID_DEFAULT_TOKEN_MAP; exports.SWAP_TRANSACTION_TYPES = SWAP_TRANSACTION_TYPES; exports.updateSwapsTransaction = updateSwapsTransaction; exports.updatePostTransactionBalance = updatePostTransactionBalance;
|
|
211
|
-
//# sourceMappingURL=chunk-
|
|
211
|
+
//# sourceMappingURL=chunk-C2LNDHP4.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
fetchEtherscanTokenTransactions,
|
|
3
3
|
fetchEtherscanTransactions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QZLPYOGC.mjs";
|
|
5
5
|
import {
|
|
6
6
|
ETHERSCAN_SUPPORTED_NETWORKS
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-O6ZZVIFH.mjs";
|
|
8
8
|
import {
|
|
9
9
|
incomingTransactionsLogger
|
|
10
10
|
} from "./chunk-UQQWZT6C.mjs";
|
|
@@ -167,4 +167,4 @@ normalizeTransactionBase_fn = function(txMeta, currentChainId) {
|
|
|
167
167
|
export {
|
|
168
168
|
EtherscanRemoteTransactionSource
|
|
169
169
|
};
|
|
170
|
-
//# sourceMappingURL=chunk-
|
|
170
|
+
//# sourceMappingURL=chunk-CPMTUMMZ.mjs.map
|