fix: fee for sweeps
This commit is contained in:
parent
50d25ef66a
commit
3405514d98
1 changed files with 1 additions and 2 deletions
|
|
@ -221,10 +221,9 @@ function generateTx (_toAddress, wallet, amount, includesFee, cryptoCode, txId)
|
||||||
|
|
||||||
const maxPriorityFeePerGas = new BN(web3.utils.toWei('1.0', 'gwei')) // web3 default value
|
const maxPriorityFeePerGas = new BN(web3.utils.toWei('1.0', 'gwei')) // web3 default value
|
||||||
const maxFeePerGas = baseFeePerGas.times(2).plus(maxPriorityFeePerGas)
|
const maxFeePerGas = baseFeePerGas.times(2).plus(maxPriorityFeePerGas)
|
||||||
const newGasPrice = BN.minimum(maxFeePerGas, baseFeePerGas.plus(maxPriorityFeePerGas))
|
|
||||||
|
|
||||||
const toSend = includesFee
|
const toSend = includesFee
|
||||||
? new BN(amount).minus(newGasPrice.times(gas))
|
? new BN(amount).minus(maxFeePerGas.times(gas))
|
||||||
: amount
|
: amount
|
||||||
|
|
||||||
const rawTx = {
|
const rawTx = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue