From 7b5553bb94be8c00521381e7f53967bcb5510f56 Mon Sep 17 00:00:00 2001 From: saurabh Date: Fri, 1 Dec 2023 18:46:21 +0530 Subject: [PATCH 1/2] updated return object of getFee --- src/index.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index d2e9ed1..676f0dc 100644 --- a/src/index.js +++ b/src/index.js @@ -508,11 +508,20 @@ class KeyringController extends EventEmitter { async getFees(velasTx, web3) { const { from, to, value, data, manualLimit } = velasTx const gasLimit = manualLimit ? manualLimit : await web3.eth.estimateGas({ to, from, value, data }) - const gasPrice = await web3.eth.getGasPrice(); - return { - gasLimit: gasLimit, - gasPrice: parseInt(gasPrice) + const gasPrice = parseInt(await web3.eth.getGasPrice()); + const fees = { + "slow":{ + "gasPrice": parseInt(gasPrice) + }, + "standard":{ + "gasPrice": gasPrice + parseInt(gasPrice * 0.05) + }, + "fast":{ + "gasPrice": gasPrice + parseInt(gasPrice * 0.1) + }, + baseFee: 0 } + return { gasLimit: gasLimit, fees: fees} } } From d52056e775d007610c667246fc08ab58c9b6734e Mon Sep 17 00:00:00 2001 From: saurabh Date: Fri, 1 Dec 2023 18:59:23 +0530 Subject: [PATCH 2/2] changed param name --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 676f0dc..ce5b032 100644 --- a/src/index.js +++ b/src/index.js @@ -505,8 +505,8 @@ class KeyringController extends EventEmitter { return { transactionDetails: receipt.transactionHash } } - async getFees(velasTx, web3) { - const { from, to, value, data, manualLimit } = velasTx + async getFees(arbitrumTx, web3) { + const { from, to, value, data, manualLimit } = arbitrumTx const gasLimit = manualLimit ? manualLimit : await web3.eth.estimateGas({ to, from, value, data }) const gasPrice = parseInt(await web3.eth.getGasPrice()); const fees = {