Skip to content

Commit

Permalink
Merge pull request #26 from getsafle/feature-update-returnParam-getfee
Browse files Browse the repository at this point in the history
updated return object of getFee
  • Loading branch information
sshubhamagg authored Dec 1, 2023
2 parents 7639266 + d52056e commit 28480cf
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,14 +505,23 @@ 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 = 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}
}
}

Expand Down

0 comments on commit 28480cf

Please sign in to comment.