@@ -1427,12 +1427,12 @@ export default class BlockchainServiceBase {
14271427 /**
14281428 * Apply buffer percentage to a gas price
14291429 * @param {BigInt } gasPrice - Gas price in wei
1430- * @param {number } bufferPercent - Buffer percentage to add
1430+ * @param {number } gasPriceBufferPercent - Buffer percentage to add
14311431 * @returns {BigInt } Gas price with buffer applied
14321432 */
1433- applyGasPriceBuffer ( gasPrice , bufferPercent ) {
1434- if ( ! bufferPercent ) return gasPrice ;
1435- return ( gasPrice * BigInt ( 100 + Number ( bufferPercent ) ) ) / 100n ;
1433+ applyGasPriceBuffer ( gasPrice , gasPriceBufferPercent ) {
1434+ if ( ! gasPriceBufferPercent ) return gasPrice ;
1435+ return ( gasPrice * BigInt ( 100 + Number ( gasPriceBufferPercent ) ) ) / 100n ;
14361436 }
14371437
14381438 /**
@@ -1443,14 +1443,14 @@ export default class BlockchainServiceBase {
14431443 * @returns {Promise<BigInt> } Estimated gas price in wei
14441444 */
14451445 async estimateGasPriceFromFeeHistory ( blockchain ) {
1446- const { bufferPercent } = blockchain ;
1446+ const { gasPriceBufferPercent } = blockchain ;
14471447 const feeHistory = await this . getFeeHistory ( blockchain , FEE_HISTORY_BLOCK_COUNT ) ;
14481448
14491449 // Fallback to network gas price if feeHistory not supported or empty
14501450 if ( ! feeHistory . supported ) {
14511451 return this . applyGasPriceBuffer (
14521452 BigInt ( await this . getNetworkGasPrice ( blockchain ) ) ,
1453- bufferPercent ,
1453+ gasPriceBufferPercent ,
14541454 ) ;
14551455 }
14561456
@@ -1460,15 +1460,15 @@ export default class BlockchainServiceBase {
14601460 if ( baseFees . length === 0 || priorityFees . length === 0 ) {
14611461 return this . applyGasPriceBuffer (
14621462 BigInt ( await this . getNetworkGasPrice ( blockchain ) ) ,
1463- bufferPercent ,
1463+ gasPriceBufferPercent ,
14641464 ) ;
14651465 }
14661466
14671467 // Find max base fee and priority fee from recent blocks
14681468 const maxBaseFee = baseFees . reduce ( ( max , bf ) => ( bf > max ? bf : max ) , 0n ) ;
14691469 const maxPriorityFee = priorityFees . reduce ( ( max , pf ) => ( pf > max ? pf : max ) , 0n ) ;
14701470
1471- return this . applyGasPriceBuffer ( maxBaseFee + maxPriorityFee , bufferPercent ) ;
1471+ return this . applyGasPriceBuffer ( maxBaseFee + maxPriorityFee , gasPriceBufferPercent ) ;
14721472 }
14731473
14741474 /**
0 commit comments