From 263169ac9d610b2c04447ec362f94f233a9fba2a Mon Sep 17 00:00:00 2001 From: SDargarh Date: Fri, 1 Dec 2023 18:39:57 +0530 Subject: [PATCH] updated getFees conversion --- src/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/index.js b/src/index.js index 37df5ad..faf43ca 100644 --- a/src/index.js +++ b/src/index.js @@ -536,21 +536,21 @@ class KeyringController extends EventEmitter { let fees = { "slow" : { - "maxPriorityFeePerGas" : parseInt(web3.utils.toWei(response.data.safeLow.maxPriorityFee.toString(), 'gwei')), - "maxFeePerGas" : parseInt(web3.utils.toWei(response.data.safeLow.maxFee.toString(), 'gwei')), + "maxPriorityFeePerGas" : parseInt(response.data.safeLow.maxPriorityFee * Math.pow(10, 9)), + "maxFeePerGas" : parseInt(response.data.safeLow.maxFee * Math.pow(10, 9)), }, "standard" : { - "maxPriorityFeePerGas" : parseInt(web3.utils.toWei(response.data.standard.maxPriorityFee.toString(), 'gwei')), - "maxFeePerGas" : parseInt(web3.utils.toWei(response.data.standard.maxFee.toString(), 'gwei')), + "maxPriorityFeePerGas" : parseInt(response.data.standard.maxPriorityFee * Math.pow(10, 9)), + "maxFeePerGas" : parseInt(response.data.standard.maxFee * Math.pow(10, 9)), }, "fast" : { - "maxPriorityFeePerGas" : parseInt(web3.utils.toWei(response.data.fast.maxPriorityFee.toString(), 'gwei')), - "maxFeePerGas" : parseInt(web3.utils.toWei(response.data.fast.maxFee.toString(), 'gwei')), + "maxPriorityFeePerGas" : parseInt(response.data.fast.maxPriorityFee * Math.pow(10, 9)), + "maxFeePerGas" : parseInt(response.data.fast.maxFee * Math.pow(10, 9)), }, - "baseFee" : parseInt(web3.utils.toWei(response.data.estimatedBaseFee.toString(), 'gwei')), + "baseFee" : parseInt(response.data.estimatedBaseFee * Math.pow(10, 9)), }; return {