fix: eth fee unit convertion
This commit is contained in:
parent
65a1f2f77f
commit
3195ce71d7
1 changed files with 3 additions and 3 deletions
|
|
@ -137,14 +137,14 @@ function generateTx (_toAddress, wallet, amount, includesFee, cryptoCode) {
|
||||||
? amount.minus(gasPrice.times(gas))
|
? amount.minus(gasPrice.times(gas))
|
||||||
: amount
|
: amount
|
||||||
|
|
||||||
const maxPriorityFeePerGas = new BN(2.5) // web3 default value
|
const maxPriorityFeePerGas = new BN(web3.utils.toWei('2.5', 'gwei')) // web3 default value
|
||||||
const maxFeePerGas = new BN(2).times(baseFeePerGas).plus(maxPriorityFeePerGas)
|
const maxFeePerGas = new BN(2).times(baseFeePerGas).plus(maxPriorityFeePerGas)
|
||||||
|
|
||||||
const rawTx = {
|
const rawTx = {
|
||||||
chainId: 1,
|
chainId: 1,
|
||||||
nonce: txCount,
|
nonce: txCount,
|
||||||
maxPriorityFeePerGas: web3.utils.toHex(web3.utils.toWei(maxPriorityFeePerGas.toString(), 'gwei')),
|
maxPriorityFeePerGas: web3.utils.toHex(maxPriorityFeePerGas),
|
||||||
maxFeePerGas: web3.utils.toHex(web3.utils.toWei(maxFeePerGas.toString(), 'gwei')),
|
maxFeePerGas: web3.utils.toHex(maxFeePerGas),
|
||||||
gasLimit: hex(gas),
|
gasLimit: hex(gas),
|
||||||
to: toAddress,
|
to: toAddress,
|
||||||
from: fromAddress,
|
from: fromAddress,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue