@requestnetwork/utils
Advanced tools
Comparing version 0.39.1-next.1985 to 0.39.1-next.1986
@@ -11,5 +11,7 @@ import { BigNumber } from 'ethers'; | ||
*/ | ||
declare function normalizeGasFees({ logger, gasPriceMin, suggestFees, }: { | ||
declare function normalizeGasFees({ logger, gasPriceMin, gasPriceMax, gasPriceMultiplier, suggestFees, }: { | ||
logger: LogTypes.ILogger; | ||
gasPriceMin?: BigNumber; | ||
gasPriceMax?: BigNumber; | ||
gasPriceMultiplier?: number; | ||
suggestFees: () => Promise<FeeTypes.SuggestedFees>; | ||
@@ -16,0 +18,0 @@ }): Promise<FeeTypes.EstimatedGasFees>; |
@@ -15,3 +15,3 @@ "use strict"; | ||
*/ | ||
function normalizeGasFees({ logger, gasPriceMin, suggestFees, }) { | ||
function normalizeGasFees({ logger, gasPriceMin, gasPriceMax, gasPriceMultiplier, suggestFees, }) { | ||
return tslib_1.__awaiter(this, void 0, void 0, function* () { | ||
@@ -22,3 +22,9 @@ try { | ||
const maxPriorityFeePerGas = (0, index_1.maxBigNumber)(suggestedFee.maxPriorityFee, gasPriceMin || ethers_1.constants.Zero); | ||
const maxFeePerGas = baseFee.add(maxPriorityFeePerGas); | ||
const maxFeePerGasInit = baseFee | ||
.add(maxPriorityFeePerGas) | ||
.mul(gasPriceMultiplier || 100) | ||
.div(100); | ||
const maxFeePerGas = gasPriceMax | ||
? (0, index_1.minBigNumber)(maxFeePerGasInit, gasPriceMax) | ||
: maxFeePerGasInit; | ||
if (maxPriorityFeePerGas.eq(0) || maxFeePerGas.eq(0)) { | ||
@@ -25,0 +31,0 @@ logger.warn(`normalizeGasFees: maxPriorityFeePerGas or maxFeePerGas too low (maxPriorityFeePerGas: ${maxPriorityFeePerGas.toString()} / maxFeePerGas: ${maxFeePerGas.toString()})`); |
{ | ||
"name": "@requestnetwork/utils", | ||
"version": "0.39.1-next.1985+8d0b3686", | ||
"version": "0.39.1-next.1986+98997ed1", | ||
"publishConfig": { | ||
@@ -43,3 +43,3 @@ "access": "public" | ||
"dependencies": { | ||
"@requestnetwork/types": "0.39.1-next.1985+8d0b3686", | ||
"@requestnetwork/types": "0.39.1-next.1986+98997ed1", | ||
"@toruslabs/eccrypto": "4.0.0", | ||
@@ -60,3 +60,3 @@ "ethers": "5.5.1", | ||
}, | ||
"gitHead": "8d0b36867496ccc643c7caab1cb945d123ee0101" | ||
"gitHead": "98997ed16aee7d09184c98bc88c337745d2aa928" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
184693
1837