- Hi, I’m getting error code:
"Error: Returned error: insufficient funds for gas * price + value Do this also happen to someone else? "
I do not understand why I’m getting this error, but I have enough funds, https://ropsten.etherscan.io/address/0x624f5945d20dcf3e4244e10c14011e9169d55331
- I think these options can be:
1- I have to unlock the account in Infura (If so, I would not know how to do it)
2- That Infura does not support the sendSignedTransaction method, in the Infura API I see that it only supports sendRawTransaction (I do not know if that’s the problem)
3- Any suggestions?
- My code:
…
web3.eth.getTransactionCount(JonAddress, (err, txCount) => {
// Build the transaction
const txObj = {
nonce: web3.utils.toHex(txCount),
to: AngelAddress,
value: web3.utils.toHex(web3.utils.toWei(‘1’, ‘gwei’)),
gasLimit: web3.utils.toHex(25000),
gasPrice: web3.utils.toHex(web3.utils.toWei(‘10’, ‘wei’))
}
// console.log(txObj)
// Sing the transaction
let tx = new Tx(txObj)
tx.sign(JonKey)
// Broadcast the transaction
web3.eth.sendSignedTransaction(row, (err, txHash) => {
if(!err) {
console.log('txHash: ', txHash)
}else{
console.error(err)
}
})
})
Thanks!