2

I am trying to submit a transaction via web3 and getting the following error: Error: Returned error: insufficient funds for gas * price + value.

Here is my code:

console.dir(txParams);
const tx = await this.web3.eth.accounts.signTransaction(
       txParams,
       this.hdKey.derive(payment.address.bip32Path)._privateKey
);
this.web3.eth.sendSignedTransaction(tx.rawTransaction);

the console statement outputs the following:

{ from: '0xc9d71816ffe465bb682302808f6169ee2B704468', to: '0x556586125be6e8c3ace675da4fdcb04369ed999d', gas: '0x5208',
gasPrice: '0x4a817c800', value: '0x10457c59124000' }

The account I am trying to has the requisite ether. What could be wrong?

0

I had a similar problem. I was able to resolve it by changing the format of my private key. The upgraded version of Web3 accepts the key in "0x" format.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.