I am trying to use the library “ethereumjs-tx” but it does not work. I get this error message: “TypeError: Tx is not a constructor” on the code “const tx = new Tx(txObject)”.
Here is my code:
const Tx = require(‘ethereumjs-tx’)
const txObject = {
nonce: web3.utils.toHex(txCount),
to: account2,
value: web3.utils.toHex(web3.utils.toWei('0.3', 'ether')),
gasLimit: web3.utils.toHex(21000),
gasPrice: web3.utils.toHex(web3.utils.toWei('10', 'gwei'))
}
const tx = new Tx(txObject)
Thank you for your help
Take care
Pierre