I implement transaction with the signature of a trezor. But I get an error that there are not enough funds, although ethereum is on both wallets.
const trezorTransaction = async (value) => { window.web3 = new Web3(new Web3.providers .HttpProvider('https://kovan.infura.io/v3/adde26ec7b994797923aae6cdea28a63')); const addressN = "m/44'/60'/0'/0"; const nonce = '00'; const gasPrice = (new BigNumber(web3.toWei('20', 'gwei'))).toString(16); const gasLimit = (new BigNumber(21000)).toString(16); const from = '0x5A224c68c74d989AAb41467AFC57794D0eCA8964'; const to = '0x5a938517b029c256e6f2f18d99558f01a0208cb2'; const currentValue = web3.toHex(web3.toWei(value, 'ether')); const trezorSignParams = { path: addressN, transaction: { from, to, value: currentValue, chainId: 42, nonce, gasLimit, gasPrice, }, }; const signedTr = await TrezorConnect.ethereumSignTransaction(trezorSignParams); const Tx = EthereumTx; const rawTx = { nonce: '0x00', gasPrice: addHexPrefix(gasPrice), gasLimit: addHexPrefix(gasLimit), to: walletPath, from, value: currentValue, ...signedTr.payload, }; const tx = new Tx(rawTx); const serializedTx = tx.serialize(); web3.eth.sendRawTransaction(`0x${serializedTx.toString('hex')}`, (err, hash) => { if (err) { console.log(err); } if (!err) { console.log(hash); } }); }; Mistake:
"Insufficient funds. The account you tried to send transaction from does not have enough funds. Required 1000420000000000000 and got: 0."