I try to construct a transaction with Node (11.4.0), ethereumjs-tx (1.3.7) and web3 (1.0.0-beta.55) and Infura. Infura gives me '0x35b' for the nonce, then I create the tx:

amount = 0.001;
nonce = '0x35b';
txParams = {
    to: "0x130f6562d441D25A812865527761EE7246AF0297", //receiver,
    value: web3.utils.toHex( web3.utils.toWei(amount, 'ether') ),
    gas: 21000,
    gasPrice: 20 * 1000000000, // converts the gwei price to wei
    nonce: nonce,
    chainId: 3  // Ropsten

Then I create the tx:

const EthereumTx = require('ethereumjs-tx');
let tx = new EthereumTx(txParams);

The tx seems to be invalid:


prints 'false', and if I try to send the tx to Infura (method: eth_sendRawTransaction) I get:

(intermediate value) is not iterable

Any idea what my problem is ?

  • How do you sign the transaction? – Ismael Jul 1 '19 at 18:44
  • I have a feeling console.log(tx) might help you a lot here. – goodvibration Jul 2 '19 at 10:16

Your Answer

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

Browse other questions tagged or ask your own question.