@metamask-previews/transaction-controller 28.1.0-preview-aedc5103 → 28.1.0-preview-cb17e99
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 +10 -11
- package/dist/TransactionController.mjs +9 -10
- package/dist/chunk-4RJXBKSR.js +90 -0
- package/dist/chunk-4RJXBKSR.js.map +1 -0
- package/dist/{chunk-5CE44QEX.js → chunk-DMMUAJKY.js} +37 -123
- package/dist/chunk-DMMUAJKY.js.map +1 -0
- package/dist/{chunk-KNYSD4JP.js → chunk-EQNKFFTM.js} +5 -21
- package/dist/chunk-EQNKFFTM.js.map +1 -0
- package/dist/{chunk-5C3CSQAD.js → chunk-FK7AP6SH.js} +5 -12
- package/dist/chunk-FK7AP6SH.js.map +1 -0
- package/dist/{chunk-SL3GHHKG.mjs → chunk-HHK4QSNF.mjs} +12 -47
- package/dist/chunk-HHK4QSNF.mjs.map +1 -0
- package/dist/{chunk-4M7FHI4S.mjs → chunk-LDXTSESK.mjs} +4 -20
- package/dist/chunk-LDXTSESK.mjs.map +1 -0
- package/dist/{chunk-DUFOYA4D.js → chunk-LNX4JTOL.js} +7 -7
- package/dist/chunk-LNX4JTOL.js.map +1 -0
- package/dist/{chunk-IXKUJ7NL.mjs → chunk-MG7HTD3H.mjs} +34 -120
- package/dist/chunk-MG7HTD3H.mjs.map +1 -0
- package/dist/{chunk-XL3HBKDE.mjs → chunk-NCRWKI6Y.mjs} +4 -4
- package/dist/chunk-NCRWKI6Y.mjs.map +1 -0
- package/dist/chunk-NPEXNXSY.mjs +90 -0
- package/dist/chunk-NPEXNXSY.mjs.map +1 -0
- package/dist/{chunk-AGJNOOBN.mjs → chunk-TWND5SFD.mjs} +12 -17
- package/dist/chunk-TWND5SFD.mjs.map +1 -0
- package/dist/{chunk-EMDU4XLM.js → chunk-UH7FNVKS.js} +14 -19
- package/dist/chunk-UH7FNVKS.js.map +1 -0
- package/dist/{chunk-7DJO6UZA.js → chunk-V6UIRCOF.js} +13 -48
- package/dist/chunk-V6UIRCOF.js.map +1 -0
- package/dist/{chunk-N6JXPWLY.mjs → chunk-YEJJKWT2.mjs} +4 -11
- package/dist/{chunk-5C3CSQAD.js.map → chunk-YEJJKWT2.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/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 +10 -15
- package/dist/index.mjs +9 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/TransactionController.d.ts +5 -12
- package/dist/types/TransactionController.d.ts.map +1 -1
- package/dist/types/gas-flows/DefaultGasFeeFlow.d.ts.map +1 -1
- package/dist/types/helpers/GasFeePoller.d.ts +3 -5
- package/dist/types/helpers/GasFeePoller.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types.d.ts +18 -36
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/utils/gas-flow.d.ts +14 -8
- package/dist/types/utils/gas-flow.d.ts.map +1 -1
- package/dist/types.js +2 -4
- package/dist/types.mjs +1 -3
- 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-4M7FHI4S.mjs.map +0 -1
- package/dist/chunk-5CE44QEX.js.map +0 -1
- package/dist/chunk-7DJO6UZA.js.map +0 -1
- package/dist/chunk-AGJNOOBN.mjs.map +0 -1
- package/dist/chunk-DUFOYA4D.js.map +0 -1
- package/dist/chunk-EMDU4XLM.js.map +0 -1
- package/dist/chunk-FMRLPVFZ.mjs +0 -66
- package/dist/chunk-FMRLPVFZ.mjs.map +0 -1
- package/dist/chunk-IXKUJ7NL.mjs.map +0 -1
- package/dist/chunk-KNYSD4JP.js.map +0 -1
- package/dist/chunk-N6JXPWLY.mjs.map +0 -1
- package/dist/chunk-REOG6YD4.mjs +0 -112
- package/dist/chunk-REOG6YD4.mjs.map +0 -1
- package/dist/chunk-SL3GHHKG.mjs.map +0 -1
- package/dist/chunk-TJMQEH57.js +0 -66
- package/dist/chunk-TJMQEH57.js.map +0 -1
- package/dist/chunk-VJYFB7BM.js +0 -112
- package/dist/chunk-VJYFB7BM.js.map +0 -1
- package/dist/chunk-XL3HBKDE.mjs.map +0 -1
- package/dist/gas-flows/TestGasFeeFlow.js +0 -9
- package/dist/gas-flows/TestGasFeeFlow.js.map +0 -1
- package/dist/gas-flows/TestGasFeeFlow.mjs +0 -9
- package/dist/gas-flows/TestGasFeeFlow.mjs.map +0 -1
- package/dist/types/gas-flows/TestGasFeeFlow.d.ts +0 -12
- package/dist/types/gas-flows/TestGasFeeFlow.d.ts.map +0 -1
|
@@ -4,36 +4,35 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('./chunk-ZNZEJDOE.js');
|
|
7
|
+
var _chunkDMMUAJKYjs = require('./chunk-DMMUAJKY.js');
|
|
9
8
|
require('./chunk-JAYYMCBQ.js');
|
|
10
9
|
require('./chunk-KT6UAKBB.js');
|
|
11
10
|
require('./chunk-SD6CWFDF.js');
|
|
12
11
|
require('./chunk-VH47Q6TS.js');
|
|
13
|
-
require('./chunk-5KMU2IAT.js');
|
|
14
12
|
require('./chunk-7LXE4KHV.js');
|
|
15
13
|
require('./chunk-V72C4MCR.js');
|
|
16
14
|
require('./chunk-QP75SWIQ.js');
|
|
15
|
+
require('./chunk-ZNZEJDOE.js');
|
|
17
16
|
require('./chunk-NYKRCWBG.js');
|
|
18
17
|
require('./chunk-WR5F34OW.js');
|
|
19
18
|
require('./chunk-YVCX6Z75.js');
|
|
20
|
-
require('./chunk-
|
|
21
|
-
require('./chunk-7DJO6UZA.js');
|
|
19
|
+
require('./chunk-V6UIRCOF.js');
|
|
22
20
|
require('./chunk-2XKEAKQG.js');
|
|
23
21
|
require('./chunk-DTDTOMTB.js');
|
|
24
22
|
require('./chunk-5XQ2KRYL.js');
|
|
25
23
|
require('./chunk-EQT25RSP.js');
|
|
26
24
|
require('./chunk-FDUCRHYT.js');
|
|
25
|
+
require('./chunk-5KMU2IAT.js');
|
|
27
26
|
require('./chunk-HMOSP33F.js');
|
|
28
|
-
require('./chunk-
|
|
29
|
-
require('./chunk-
|
|
30
|
-
require('./chunk-
|
|
27
|
+
require('./chunk-LNX4JTOL.js');
|
|
28
|
+
require('./chunk-4RJXBKSR.js');
|
|
29
|
+
require('./chunk-EQNKFFTM.js');
|
|
31
30
|
require('./chunk-C2LNDHP4.js');
|
|
32
31
|
require('./chunk-UGFBA4GV.js');
|
|
33
|
-
require('./chunk-
|
|
32
|
+
require('./chunk-UH7FNVKS.js');
|
|
34
33
|
require('./chunk-UGN7PBON.js');
|
|
35
34
|
require('./chunk-S6VGOPUY.js');
|
|
36
|
-
require('./chunk-
|
|
35
|
+
require('./chunk-FK7AP6SH.js');
|
|
37
36
|
require('./chunk-Z4BLTVTB.js');
|
|
38
37
|
|
|
39
38
|
|
|
@@ -41,5 +40,5 @@ require('./chunk-Z4BLTVTB.js');
|
|
|
41
40
|
|
|
42
41
|
|
|
43
42
|
|
|
44
|
-
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;
|
|
45
44
|
//# sourceMappingURL=TransactionController.js.map
|
|
@@ -4,36 +4,35 @@ import {
|
|
|
4
4
|
HARDFORK,
|
|
5
5
|
SPEED_UP_RATE,
|
|
6
6
|
TransactionController
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-NHRBO3LU.mjs";
|
|
7
|
+
} from "./chunk-MG7HTD3H.mjs";
|
|
9
8
|
import "./chunk-IZVRGO3P.mjs";
|
|
10
9
|
import "./chunk-K4KOSAGM.mjs";
|
|
11
10
|
import "./chunk-KG4UW4K4.mjs";
|
|
12
11
|
import "./chunk-NM6OYEPP.mjs";
|
|
13
|
-
import "./chunk-5YES3V2R.mjs";
|
|
14
12
|
import "./chunk-FRKQ3Z2L.mjs";
|
|
15
13
|
import "./chunk-5G6OHAXI.mjs";
|
|
16
14
|
import "./chunk-XGRAHX6T.mjs";
|
|
15
|
+
import "./chunk-NHRBO3LU.mjs";
|
|
17
16
|
import "./chunk-VEVVBHP3.mjs";
|
|
18
17
|
import "./chunk-Z4GV3YQQ.mjs";
|
|
19
18
|
import "./chunk-FG74Z3F5.mjs";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-SL3GHHKG.mjs";
|
|
19
|
+
import "./chunk-HHK4QSNF.mjs";
|
|
22
20
|
import "./chunk-NOHEXQ7Y.mjs";
|
|
23
21
|
import "./chunk-Y7ENNK7L.mjs";
|
|
24
22
|
import "./chunk-F6E3TTR3.mjs";
|
|
25
23
|
import "./chunk-CPMTUMMZ.mjs";
|
|
26
24
|
import "./chunk-QZLPYOGC.mjs";
|
|
25
|
+
import "./chunk-5YES3V2R.mjs";
|
|
27
26
|
import "./chunk-HQSNKCXI.mjs";
|
|
28
|
-
import "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-NCRWKI6Y.mjs";
|
|
28
|
+
import "./chunk-NPEXNXSY.mjs";
|
|
29
|
+
import "./chunk-LDXTSESK.mjs";
|
|
31
30
|
import "./chunk-ZGUNOEUQ.mjs";
|
|
32
31
|
import "./chunk-J56A7UCK.mjs";
|
|
33
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-TWND5SFD.mjs";
|
|
34
33
|
import "./chunk-O6ZZVIFH.mjs";
|
|
35
34
|
import "./chunk-UQQWZT6C.mjs";
|
|
36
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-YEJJKWT2.mjs";
|
|
37
36
|
import "./chunk-XUI43LEZ.mjs";
|
|
38
37
|
export {
|
|
39
38
|
ApprovalState,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkEQNKFFTMjs = require('./chunk-EQNKFFTM.js');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
var _chunkFK7AP6SHjs = require('./chunk-FK7AP6SH.js');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
var _chunkZ4BLTVTBjs = require('./chunk-Z4BLTVTB.js');
|
|
14
|
+
|
|
15
|
+
// src/gas-flows/DefaultGasFeeFlow.ts
|
|
16
|
+
var _gasfeecontroller = require('@metamask/gas-fee-controller');
|
|
17
|
+
var _utils = require('@metamask/utils');
|
|
18
|
+
var log = _utils.createModuleLogger.call(void 0, _chunkS6VGOPUYjs.projectLogger, "default-gas-fee-flow");
|
|
19
|
+
var _getEstimateLevel, getEstimateLevel_fn, _getFeeMarketLevel, getFeeMarketLevel_fn, _getLegacyLevel, getLegacyLevel_fn;
|
|
20
|
+
var DefaultGasFeeFlow = class {
|
|
21
|
+
constructor() {
|
|
22
|
+
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getEstimateLevel);
|
|
23
|
+
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getFeeMarketLevel);
|
|
24
|
+
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getLegacyLevel);
|
|
25
|
+
}
|
|
26
|
+
matchesTransaction(_transactionMeta) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
async getGasFees(request) {
|
|
30
|
+
const { getGasFeeControllerEstimates, transactionMeta } = request;
|
|
31
|
+
const { networkClientId } = transactionMeta;
|
|
32
|
+
const { gasEstimateType, gasFeeEstimates } = await getGasFeeControllerEstimates({ networkClientId });
|
|
33
|
+
if (gasEstimateType === _gasfeecontroller.GAS_ESTIMATE_TYPES.FEE_MARKET) {
|
|
34
|
+
log("Using fee market estimates", gasFeeEstimates);
|
|
35
|
+
} else if (gasEstimateType === _gasfeecontroller.GAS_ESTIMATE_TYPES.LEGACY) {
|
|
36
|
+
log("Using legacy estimates", gasFeeEstimates);
|
|
37
|
+
} else {
|
|
38
|
+
throw new Error(`'No gas fee estimates available`);
|
|
39
|
+
}
|
|
40
|
+
const estimates = Object.values(_chunkFK7AP6SHjs.GasFeeEstimateLevel).reduce(
|
|
41
|
+
(result, level) => ({
|
|
42
|
+
...result,
|
|
43
|
+
[level]: _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getEstimateLevel, getEstimateLevel_fn).call(this, {
|
|
44
|
+
gasEstimateType,
|
|
45
|
+
gasFeeEstimates,
|
|
46
|
+
level
|
|
47
|
+
})
|
|
48
|
+
}),
|
|
49
|
+
{}
|
|
50
|
+
);
|
|
51
|
+
return { estimates };
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
_getEstimateLevel = new WeakSet();
|
|
55
|
+
getEstimateLevel_fn = function({
|
|
56
|
+
gasEstimateType,
|
|
57
|
+
gasFeeEstimates,
|
|
58
|
+
level
|
|
59
|
+
}) {
|
|
60
|
+
if (gasEstimateType === _gasfeecontroller.GAS_ESTIMATE_TYPES.FEE_MARKET) {
|
|
61
|
+
return _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getFeeMarketLevel, getFeeMarketLevel_fn).call(this, gasFeeEstimates, level);
|
|
62
|
+
}
|
|
63
|
+
return _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getLegacyLevel, getLegacyLevel_fn).call(this, gasFeeEstimates, level);
|
|
64
|
+
};
|
|
65
|
+
_getFeeMarketLevel = new WeakSet();
|
|
66
|
+
getFeeMarketLevel_fn = function(gasFeeEstimates, level) {
|
|
67
|
+
const maxFeePerGas = _chunkEQNKFFTMjs.gweiDecimalToWeiHex.call(void 0,
|
|
68
|
+
gasFeeEstimates[level].suggestedMaxFeePerGas
|
|
69
|
+
);
|
|
70
|
+
const maxPriorityFeePerGas = _chunkEQNKFFTMjs.gweiDecimalToWeiHex.call(void 0,
|
|
71
|
+
gasFeeEstimates[level].suggestedMaxPriorityFeePerGas
|
|
72
|
+
);
|
|
73
|
+
return {
|
|
74
|
+
maxFeePerGas,
|
|
75
|
+
maxPriorityFeePerGas
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
_getLegacyLevel = new WeakSet();
|
|
79
|
+
getLegacyLevel_fn = function(gasFeeEstimates, level) {
|
|
80
|
+
const gasPrice = _chunkEQNKFFTMjs.gweiDecimalToWeiHex.call(void 0, gasFeeEstimates[level]);
|
|
81
|
+
return {
|
|
82
|
+
maxFeePerGas: gasPrice,
|
|
83
|
+
maxPriorityFeePerGas: gasPrice
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
exports.DefaultGasFeeFlow = DefaultGasFeeFlow;
|
|
90
|
+
//# sourceMappingURL=chunk-4RJXBKSR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/gas-flows/DefaultGasFeeFlow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAIA,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AAcnC,IAAM,MAAM,mBAAmB,eAAe,sBAAsB;AAnBpE;AAoCO,IAAM,oBAAN,MAA8C;AAAA,EAA9C;AAmCL;AAcA;AAkBA;AAAA;AAAA,EAlEA,mBAAmB,kBAA4C;AAC7D,WAAO;AAAA,EACT;AAAA,EAEA,MAAM,WAAW,SAAyD;AACxE,UAAM,EAAE,8BAA8B,gBAAgB,IAAI;AAC1D,UAAM,EAAE,gBAAgB,IAAI;AAE5B,UAAM,EAAE,iBAAiB,gBAAgB,IACvC,MAAM,6BAA6B,EAAE,gBAAgB,CAAC;AAExD,QAAI,oBAAoB,mBAAmB,YAAY;AACrD,UAAI,8BAA8B,eAAe;AAAA,IACnD,WAAW,oBAAoB,mBAAmB,QAAQ;AACxD,UAAI,0BAA0B,eAAe;AAAA,IAC/C,OAAO;AACL,YAAM,IAAI,MAAM,iCAAiC;AAAA,IACnD;AAEA,UAAM,YAAY,OAAO,OAAO,mBAAmB,EAAE;AAAA,MACnD,CAAC,QAAQ,WAAW;AAAA,QAClB,GAAG;AAAA,QACH,CAAC,KAAK,GAAG,sBAAK,wCAAL,WAAuB;AAAA,UAC9B;AAAA,UACA;AAAA,UACA;AAAA,QACF;AAAA,MACF;AAAA,MACA,CAAC;AAAA,IACH;AAEA,WAAO,EAAE,UAAU;AAAA,EACrB;AA6CF;AA3CE;AAAA,sBAAiB,SAAC;AAAA,EAChB;AAAA,EACA;AAAA,EACA;AACF,GAE4D;AAC1D,MAAI,oBAAoB,mBAAmB,YAAY;AACrD,WAAO,sBAAK,0CAAL,WAAwB,iBAAiB;AAAA,EAClD;AAEA,SAAO,sBAAK,oCAAL,WAAqB,iBAAiB;AAC/C;AAEA;AAAA,uBAAkB,SAChB,iBACA,OACyB;AACzB,QAAM,eAAe;AAAA,IACnB,gBAAgB,KAAK,EAAE;AAAA,EACzB;AAEA,QAAM,uBAAuB;AAAA,IAC3B,gBAAgB,KAAK,EAAE;AAAA,EACzB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,EACF;AACF;AAEA;AAAA,oBAAe,SACb,iBACA,OACyB;AACzB,QAAM,WAAW,oBAAoB,gBAAgB,KAAK,CAAC;AAE3D,SAAO;AAAA,IACL,cAAc;AAAA,IACd,sBAAsB;AAAA,EACxB;AACF","sourcesContent":["import type {\n LegacyGasPriceEstimate,\n GasFeeEstimates as FeeMarketGasPriceEstimate,\n} from '@metamask/gas-fee-controller';\nimport { GAS_ESTIMATE_TYPES } from '@metamask/gas-fee-controller';\nimport { createModuleLogger } from '@metamask/utils';\n\nimport { projectLogger } from '../logger';\nimport type {\n GasFeeEstimates,\n GasFeeEstimatesForLevel,\n GasFeeFlow,\n GasFeeFlowRequest,\n GasFeeFlowResponse,\n TransactionMeta,\n} from '../types';\nimport { GasFeeEstimateLevel } from '../types';\nimport { gweiDecimalToWeiHex } from '../utils/gas-fees';\n\nconst log = createModuleLogger(projectLogger, 'default-gas-fee-flow');\n\ntype FeeMarketGetEstimateLevelRequest = {\n gasEstimateType: 'fee-market';\n gasFeeEstimates: FeeMarketGasPriceEstimate;\n level: GasFeeEstimateLevel;\n};\n\ntype LegacyGetEstimateLevelRequest = {\n gasEstimateType: 'legacy';\n gasFeeEstimates: LegacyGasPriceEstimate;\n level: GasFeeEstimateLevel;\n};\n\n/**\n * The standard implementation of a gas fee flow that obtains gas fee estimates using only the GasFeeController.\n */\nexport class DefaultGasFeeFlow implements GasFeeFlow {\n matchesTransaction(_transactionMeta: TransactionMeta): boolean {\n return true;\n }\n\n async getGasFees(request: GasFeeFlowRequest): Promise<GasFeeFlowResponse> {\n const { getGasFeeControllerEstimates, transactionMeta } = request;\n const { networkClientId } = transactionMeta;\n\n const { gasEstimateType, gasFeeEstimates } =\n await getGasFeeControllerEstimates({ networkClientId });\n\n if (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) {\n log('Using fee market estimates', gasFeeEstimates);\n } else if (gasEstimateType === GAS_ESTIMATE_TYPES.LEGACY) {\n log('Using legacy estimates', gasFeeEstimates);\n } else {\n throw new Error(`'No gas fee estimates available`);\n }\n\n const estimates = Object.values(GasFeeEstimateLevel).reduce(\n (result, level) => ({\n ...result,\n [level]: this.#getEstimateLevel({\n gasEstimateType,\n gasFeeEstimates,\n level,\n } as FeeMarketGetEstimateLevelRequest | LegacyGetEstimateLevelRequest),\n }),\n {} as GasFeeEstimates,\n );\n\n return { estimates };\n }\n\n #getEstimateLevel({\n gasEstimateType,\n gasFeeEstimates,\n level,\n }:\n | FeeMarketGetEstimateLevelRequest\n | LegacyGetEstimateLevelRequest): GasFeeEstimatesForLevel {\n if (gasEstimateType === GAS_ESTIMATE_TYPES.FEE_MARKET) {\n return this.#getFeeMarketLevel(gasFeeEstimates, level);\n }\n\n return this.#getLegacyLevel(gasFeeEstimates, level);\n }\n\n #getFeeMarketLevel(\n gasFeeEstimates: FeeMarketGasPriceEstimate,\n level: GasFeeEstimateLevel,\n ): GasFeeEstimatesForLevel {\n const maxFeePerGas = gweiDecimalToWeiHex(\n gasFeeEstimates[level].suggestedMaxFeePerGas,\n );\n\n const maxPriorityFeePerGas = gweiDecimalToWeiHex(\n gasFeeEstimates[level].suggestedMaxPriorityFeePerGas,\n );\n\n return {\n maxFeePerGas,\n maxPriorityFeePerGas,\n };\n }\n\n #getLegacyLevel(\n gasFeeEstimates: LegacyGasPriceEstimate,\n level: GasFeeEstimateLevel,\n ): GasFeeEstimatesForLevel {\n const gasPrice = gweiDecimalToWeiHex(gasFeeEstimates[level]);\n\n return {\n maxFeePerGas: gasPrice,\n maxPriorityFeePerGas: gasPrice,\n };\n }\n}\n"]}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var _chunkZNZEJDOEjs = require('./chunk-ZNZEJDOE.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
3
|
var _chunkJAYYMCBQjs = require('./chunk-JAYYMCBQ.js');
|
|
8
4
|
|
|
9
5
|
|
|
@@ -14,9 +10,6 @@ var _chunkSD6CWFDFjs = require('./chunk-SD6CWFDF.js');
|
|
|
14
10
|
var _chunkVH47Q6TSjs = require('./chunk-VH47Q6TS.js');
|
|
15
11
|
|
|
16
12
|
|
|
17
|
-
var _chunk5KMU2IATjs = require('./chunk-5KMU2IAT.js');
|
|
18
|
-
|
|
19
|
-
|
|
20
13
|
var _chunk7LXE4KHVjs = require('./chunk-7LXE4KHV.js');
|
|
21
14
|
|
|
22
15
|
|
|
@@ -29,16 +22,17 @@ var _chunkV72C4MCRjs = require('./chunk-V72C4MCR.js');
|
|
|
29
22
|
var _chunkQP75SWIQjs = require('./chunk-QP75SWIQ.js');
|
|
30
23
|
|
|
31
24
|
|
|
32
|
-
var _chunkNYKRCWBGjs = require('./chunk-NYKRCWBG.js');
|
|
33
25
|
|
|
26
|
+
var _chunkZNZEJDOEjs = require('./chunk-ZNZEJDOE.js');
|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
|
|
29
|
+
var _chunkNYKRCWBGjs = require('./chunk-NYKRCWBG.js');
|
|
36
30
|
|
|
37
31
|
|
|
38
|
-
var
|
|
32
|
+
var _chunkWR5F34OWjs = require('./chunk-WR5F34OW.js');
|
|
39
33
|
|
|
40
34
|
|
|
41
|
-
var
|
|
35
|
+
var _chunkV6UIRCOFjs = require('./chunk-V6UIRCOF.js');
|
|
42
36
|
|
|
43
37
|
|
|
44
38
|
|
|
@@ -54,19 +48,20 @@ var _chunk5XQ2KRYLjs = require('./chunk-5XQ2KRYL.js');
|
|
|
54
48
|
var _chunkEQT25RSPjs = require('./chunk-EQT25RSP.js');
|
|
55
49
|
|
|
56
50
|
|
|
57
|
-
var
|
|
51
|
+
var _chunk5KMU2IATjs = require('./chunk-5KMU2IAT.js');
|
|
58
52
|
|
|
59
53
|
|
|
60
|
-
var
|
|
54
|
+
var _chunkLNX4JTOLjs = require('./chunk-LNX4JTOL.js');
|
|
61
55
|
|
|
62
56
|
|
|
63
|
-
var
|
|
57
|
+
var _chunk4RJXBKSRjs = require('./chunk-4RJXBKSR.js');
|
|
64
58
|
|
|
65
59
|
|
|
60
|
+
var _chunkEQNKFFTMjs = require('./chunk-EQNKFFTM.js');
|
|
66
61
|
|
|
67
|
-
var _chunkC2LNDHP4js = require('./chunk-C2LNDHP4.js');
|
|
68
62
|
|
|
69
63
|
|
|
64
|
+
var _chunkC2LNDHP4js = require('./chunk-C2LNDHP4.js');
|
|
70
65
|
|
|
71
66
|
|
|
72
67
|
|
|
@@ -76,10 +71,9 @@ var _chunkC2LNDHP4js = require('./chunk-C2LNDHP4.js');
|
|
|
76
71
|
|
|
77
72
|
|
|
78
73
|
|
|
79
|
-
var _chunkUGFBA4GVjs = require('./chunk-UGFBA4GV.js');
|
|
80
74
|
|
|
81
75
|
|
|
82
|
-
var
|
|
76
|
+
var _chunkUGFBA4GVjs = require('./chunk-UGFBA4GV.js');
|
|
83
77
|
|
|
84
78
|
|
|
85
79
|
var _chunkS6VGOPUYjs = require('./chunk-S6VGOPUY.js');
|
|
@@ -143,7 +137,7 @@ function getDefaultTransactionControllerState() {
|
|
|
143
137
|
lastFetchedBlockNumbers: {}
|
|
144
138
|
};
|
|
145
139
|
}
|
|
146
|
-
var _internalEvents, _incomingTransactionOptions, _pendingTransactionOptions, _transactionHistoryLimit, _isSimulationEnabled,
|
|
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;
|
|
147
141
|
var TransactionController = class extends _basecontroller.BaseController {
|
|
148
142
|
/**
|
|
149
143
|
* Constructs a TransactionController.
|
|
@@ -172,7 +166,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
172
166
|
* @param options.securityProviderRequest - A function for verifying a transaction, whether it is malicious or not.
|
|
173
167
|
* @param options.sign - Function used to sign transactions.
|
|
174
168
|
* @param options.state - Initial state to set on this controller.
|
|
175
|
-
* @param options.testGasFeeFlows - Whether to use the test gas fee flow.
|
|
176
169
|
* @param options.transactionHistoryLimit - Transaction history limit.
|
|
177
170
|
* @param options.hooks - The controller hooks.
|
|
178
171
|
*/
|
|
@@ -200,7 +193,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
200
193
|
securityProviderRequest,
|
|
201
194
|
sign,
|
|
202
195
|
state,
|
|
203
|
-
testGasFeeFlows,
|
|
204
196
|
transactionHistoryLimit = 40,
|
|
205
197
|
hooks
|
|
206
198
|
}) {
|
|
@@ -229,10 +221,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
229
221
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _onTransactionParamsUpdated);
|
|
230
222
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _updateSimulationData);
|
|
231
223
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _onGasFeePollerTransactionUpdate);
|
|
232
|
-
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getNetworkClientId);
|
|
233
|
-
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getGlobalNetworkClientId);
|
|
234
|
-
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _getGlobalChainId);
|
|
235
|
-
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _isCustomNetwork);
|
|
236
224
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _internalEvents, new (0, _events.EventEmitter)());
|
|
237
225
|
this.inProcessOfSigning = /* @__PURE__ */ new Set();
|
|
238
226
|
this.mutex = new (0, _asyncmutex.Mutex)();
|
|
@@ -241,7 +229,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
241
229
|
this.signAbortCallbacks = /* @__PURE__ */ new Map();
|
|
242
230
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _transactionHistoryLimit, void 0);
|
|
243
231
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _isSimulationEnabled, void 0);
|
|
244
|
-
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _testGasFeeFlows, void 0);
|
|
245
232
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _multichainTrackingHelper, void 0);
|
|
246
233
|
_chunkZ4BLTVTBjs.__privateAdd.call(void 0, this, _checkForPendingTransactionAndStartPolling, () => {
|
|
247
234
|
this.pendingTransactionTracker.startIfPendingTransactions();
|
|
@@ -266,7 +253,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
266
253
|
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _pendingTransactionOptions, pendingTransactions);
|
|
267
254
|
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _transactionHistoryLimit, transactionHistoryLimit);
|
|
268
255
|
this.sign = sign;
|
|
269
|
-
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _testGasFeeFlows, testGasFeeFlows === true);
|
|
270
256
|
this.afterSign = hooks?.afterSign ?? (() => true);
|
|
271
257
|
this.beforeApproveOnInit = hooks?.beforeApproveOnInit ?? (() => true);
|
|
272
258
|
this.beforeCheckPendingTransaction = hooks?.beforeCheckPendingTransaction ?? /* istanbul ignore next */
|
|
@@ -278,18 +264,17 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
278
264
|
provider,
|
|
279
265
|
blockTracker
|
|
280
266
|
});
|
|
281
|
-
const findNetworkClientIdByChainId = (chainId) => {
|
|
282
|
-
return this.messagingSystem.call(
|
|
283
|
-
`NetworkController:findNetworkClientIdByChainId`,
|
|
284
|
-
chainId
|
|
285
|
-
);
|
|
286
|
-
};
|
|
287
267
|
_chunkZ4BLTVTBjs.__privateSet.call(void 0, this, _multichainTrackingHelper, new (0, _chunk5XQ2KRYLjs.MultichainTrackingHelper)({
|
|
288
268
|
isMultichainEnabled,
|
|
289
269
|
provider,
|
|
290
270
|
nonceTracker: this.nonceTracker,
|
|
291
271
|
incomingTransactionOptions: incomingTransactions,
|
|
292
|
-
findNetworkClientIdByChainId
|
|
272
|
+
findNetworkClientIdByChainId: (chainId) => {
|
|
273
|
+
return this.messagingSystem.call(
|
|
274
|
+
`NetworkController:findNetworkClientIdByChainId`,
|
|
275
|
+
chainId
|
|
276
|
+
);
|
|
277
|
+
},
|
|
293
278
|
getNetworkClientById: (networkClientId) => {
|
|
294
279
|
return this.messagingSystem.call(
|
|
295
280
|
`NetworkController:getNetworkClientById`,
|
|
@@ -323,9 +308,9 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
323
308
|
});
|
|
324
309
|
this.gasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGasFeeFlows, getGasFeeFlows_fn).call(this);
|
|
325
310
|
this.layer1GasFeeFlows = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getLayer1GasFeeFlows, getLayer1GasFeeFlows_fn).call(this);
|
|
326
|
-
const gasFeePoller = new (0,
|
|
327
|
-
|
|
328
|
-
gasFeeFlows: this.gasFeeFlows,
|
|
311
|
+
const gasFeePoller = new (0, _chunkV6UIRCOFjs.GasFeePoller)({
|
|
312
|
+
// Default gas fee polling is not yet supported by the clients
|
|
313
|
+
gasFeeFlows: this.gasFeeFlows.slice(0, -1),
|
|
329
314
|
getGasFeeControllerEstimates: this.getGasFeeEstimates,
|
|
330
315
|
getProvider: (chainId, networkClientId) => _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getProvider({
|
|
331
316
|
networkClientId,
|
|
@@ -453,16 +438,15 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
453
438
|
sendFlowHistory,
|
|
454
439
|
swaps = {},
|
|
455
440
|
type,
|
|
456
|
-
networkClientId
|
|
441
|
+
networkClientId
|
|
457
442
|
} = {}) {
|
|
458
443
|
_chunkS6VGOPUYjs.projectLogger.call(void 0, "Adding transaction", txParams);
|
|
459
444
|
txParams = _chunkUGFBA4GVjs.normalizeTransactionParams.call(void 0, txParams);
|
|
460
|
-
if (
|
|
445
|
+
if (networkClientId && !_chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).has(networkClientId)) {
|
|
461
446
|
throw new Error(
|
|
462
447
|
"The networkClientId for this transaction could not be found"
|
|
463
448
|
);
|
|
464
449
|
}
|
|
465
|
-
const networkClientId = requestNetworkClientId ?? _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn).call(this);
|
|
466
450
|
const isEIP1559Compatible = await this.getEIP1559Compatibility(
|
|
467
451
|
networkClientId
|
|
468
452
|
);
|
|
@@ -1384,37 +1368,6 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1384
1368
|
}
|
|
1385
1369
|
return filteredTransactions;
|
|
1386
1370
|
}
|
|
1387
|
-
async estimateGasFee({
|
|
1388
|
-
transactionParams,
|
|
1389
|
-
chainId,
|
|
1390
|
-
networkClientId: requestNetworkClientId
|
|
1391
|
-
}) {
|
|
1392
|
-
const networkClientId = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getNetworkClientId, getNetworkClientId_fn).call(this, {
|
|
1393
|
-
networkClientId: requestNetworkClientId,
|
|
1394
|
-
chainId
|
|
1395
|
-
});
|
|
1396
|
-
const transactionMeta = {
|
|
1397
|
-
txParams: transactionParams,
|
|
1398
|
-
chainId,
|
|
1399
|
-
networkClientId
|
|
1400
|
-
};
|
|
1401
|
-
const gasFeeFlow = _chunkEMDU4XLMjs.getGasFeeFlow.call(void 0,
|
|
1402
|
-
transactionMeta,
|
|
1403
|
-
this.gasFeeFlows
|
|
1404
|
-
);
|
|
1405
|
-
const ethQuery = _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getEthQuery({
|
|
1406
|
-
networkClientId,
|
|
1407
|
-
chainId
|
|
1408
|
-
});
|
|
1409
|
-
const gasFeeControllerData = await this.getGasFeeEstimates({
|
|
1410
|
-
networkClientId
|
|
1411
|
-
});
|
|
1412
|
-
return gasFeeFlow.getGasFees({
|
|
1413
|
-
ethQuery,
|
|
1414
|
-
gasFeeControllerData,
|
|
1415
|
-
transactionMeta
|
|
1416
|
-
});
|
|
1417
|
-
}
|
|
1418
1371
|
/**
|
|
1419
1372
|
* Determine the layer 1 gas fee for the given transaction parameters.
|
|
1420
1373
|
*
|
|
@@ -1504,7 +1457,10 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1504
1457
|
async updateGasProperties(transactionMeta) {
|
|
1505
1458
|
const isEIP1559Compatible = await this.getEIP1559Compatibility(transactionMeta.networkClientId) && transactionMeta.txParams.type !== "0x0" /* legacy */;
|
|
1506
1459
|
const { networkClientId, chainId } = transactionMeta;
|
|
1507
|
-
const isCustomNetwork =
|
|
1460
|
+
const isCustomNetwork = networkClientId ? this.messagingSystem.call(
|
|
1461
|
+
`NetworkController:getNetworkClientById`,
|
|
1462
|
+
networkClientId
|
|
1463
|
+
).configuration.type === _networkcontroller.NetworkClientType.Custom : this.getNetworkState().providerConfig.type === _controllerutils.NetworkType.rpc;
|
|
1508
1464
|
const ethQuery = _chunkZ4BLTVTBjs.__privateGet.call(void 0, this, _multichainTrackingHelper).getEthQuery({
|
|
1509
1465
|
networkClientId,
|
|
1510
1466
|
chainId
|
|
@@ -1519,7 +1475,7 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1519
1475
|
isCustomNetwork,
|
|
1520
1476
|
txMeta: transactionMeta
|
|
1521
1477
|
});
|
|
1522
|
-
await
|
|
1478
|
+
await _chunkEQNKFFTMjs.updateGasFees.call(void 0, {
|
|
1523
1479
|
eip1559: isEIP1559Compatible,
|
|
1524
1480
|
ethQuery,
|
|
1525
1481
|
gasFeeFlows: this.gasFeeFlows,
|
|
@@ -1889,15 +1845,14 @@ var TransactionController = class extends _basecontroller.BaseController {
|
|
|
1889
1845
|
return { meta: transaction, isCompleted };
|
|
1890
1846
|
}
|
|
1891
1847
|
getChainId(networkClientId) {
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1848
|
+
if (networkClientId) {
|
|
1849
|
+
return this.messagingSystem.call(
|
|
1850
|
+
`NetworkController:getNetworkClientById`,
|
|
1851
|
+
networkClientId
|
|
1852
|
+
).configuration.chainId;
|
|
1896
1853
|
}
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
networkClientId
|
|
1900
|
-
).configuration.chainId;
|
|
1854
|
+
const { providerConfig } = this.getNetworkState();
|
|
1855
|
+
return providerConfig.chainId;
|
|
1901
1856
|
}
|
|
1902
1857
|
prepareUnsignedEthTx(chainId, txParams) {
|
|
1903
1858
|
return _tx.TransactionFactory.fromTxData(txParams, {
|
|
@@ -2232,7 +2187,6 @@ _incomingTransactionOptions = new WeakMap();
|
|
|
2232
2187
|
_pendingTransactionOptions = new WeakMap();
|
|
2233
2188
|
_transactionHistoryLimit = new WeakMap();
|
|
2234
2189
|
_isSimulationEnabled = new WeakMap();
|
|
2235
|
-
_testGasFeeFlows = new WeakMap();
|
|
2236
2190
|
_multichainTrackingHelper = new WeakMap();
|
|
2237
2191
|
_createNonceTracker = new WeakSet();
|
|
2238
2192
|
createNonceTracker_fn = function({
|
|
@@ -2372,10 +2326,7 @@ getNonceTrackerPendingTransactions_fn = function(chainId, address) {
|
|
|
2372
2326
|
};
|
|
2373
2327
|
_getGasFeeFlows = new WeakSet();
|
|
2374
2328
|
getGasFeeFlows_fn = function() {
|
|
2375
|
-
|
|
2376
|
-
return [new (0, _chunkTJMQEH57js.TestGasFeeFlow)()];
|
|
2377
|
-
}
|
|
2378
|
-
return [new (0, _chunkDUFOYA4Djs.LineaGasFeeFlow)(), new (0, _chunkVJYFB7BMjs.DefaultGasFeeFlow)()];
|
|
2329
|
+
return [new (0, _chunkLNX4JTOLjs.LineaGasFeeFlow)(), new (0, _chunk4RJXBKSRjs.DefaultGasFeeFlow)()];
|
|
2379
2330
|
};
|
|
2380
2331
|
_getLayer1GasFeeFlows = new WeakSet();
|
|
2381
2332
|
getLayer1GasFeeFlows_fn = function() {
|
|
@@ -2502,43 +2453,6 @@ onGasFeePollerTransactionUpdate_fn = function({
|
|
|
2502
2453
|
}
|
|
2503
2454
|
});
|
|
2504
2455
|
};
|
|
2505
|
-
_getNetworkClientId = new WeakSet();
|
|
2506
|
-
getNetworkClientId_fn = function({
|
|
2507
|
-
networkClientId: requestNetworkClientId,
|
|
2508
|
-
chainId
|
|
2509
|
-
}) {
|
|
2510
|
-
const globalChainId = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGlobalChainId, getGlobalChainId_fn).call(this);
|
|
2511
|
-
const globalNetworkClientId = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn).call(this);
|
|
2512
|
-
if (requestNetworkClientId) {
|
|
2513
|
-
return requestNetworkClientId;
|
|
2514
|
-
}
|
|
2515
|
-
if (!chainId || chainId === globalChainId) {
|
|
2516
|
-
return globalNetworkClientId;
|
|
2517
|
-
}
|
|
2518
|
-
return this.messagingSystem.call(
|
|
2519
|
-
`NetworkController:findNetworkClientIdByChainId`,
|
|
2520
|
-
chainId
|
|
2521
|
-
);
|
|
2522
|
-
};
|
|
2523
|
-
_getGlobalNetworkClientId = new WeakSet();
|
|
2524
|
-
getGlobalNetworkClientId_fn = function() {
|
|
2525
|
-
return this.getNetworkState().selectedNetworkClientId;
|
|
2526
|
-
};
|
|
2527
|
-
_getGlobalChainId = new WeakSet();
|
|
2528
|
-
getGlobalChainId_fn = function() {
|
|
2529
|
-
return this.getNetworkState().providerConfig.chainId;
|
|
2530
|
-
};
|
|
2531
|
-
_isCustomNetwork = new WeakSet();
|
|
2532
|
-
isCustomNetwork_fn = function(networkClientId) {
|
|
2533
|
-
const globalNetworkClientId = _chunkZ4BLTVTBjs.__privateMethod.call(void 0, this, _getGlobalNetworkClientId, getGlobalNetworkClientId_fn).call(this);
|
|
2534
|
-
if (!networkClientId || networkClientId === globalNetworkClientId) {
|
|
2535
|
-
return this.getNetworkState().providerConfig.type === _controllerutils.NetworkType.rpc;
|
|
2536
|
-
}
|
|
2537
|
-
return this.messagingSystem.call(
|
|
2538
|
-
`NetworkController:getNetworkClientById`,
|
|
2539
|
-
networkClientId
|
|
2540
|
-
).configuration.type === _networkcontroller.NetworkClientType.Custom;
|
|
2541
|
-
};
|
|
2542
2456
|
|
|
2543
2457
|
|
|
2544
2458
|
|
|
@@ -2547,4 +2461,4 @@ isCustomNetwork_fn = function(networkClientId) {
|
|
|
2547
2461
|
|
|
2548
2462
|
|
|
2549
2463
|
exports.HARDFORK = HARDFORK; exports.CANCEL_RATE = CANCEL_RATE; exports.SPEED_UP_RATE = SPEED_UP_RATE; exports.ApprovalState = ApprovalState; exports.TransactionController = TransactionController;
|
|
2550
|
-
//# sourceMappingURL=chunk-
|
|
2464
|
+
//# sourceMappingURL=chunk-DMMUAJKY.js.map
|