Calling web3.eth.accounts.signTransaction(tx, privkey) result in this error. Versions prior to beta.47 work fine.
Calling web3.eth.accounts.signTransaction() should return a signed tx.
const Web3 = require('web3')
const WEB3_HOST = 'https://mainnet.infura.io/...'
const web3 = new Web3(WEB3_HOST)
var tx = {
gas: 100000,
gasPrice: 4000000000
}
signed_tx = web3.eth.accounts.signTransaction(tx, PRIVATEKEY)
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'sign' of undefined
at Proxy._callee$ (/.../node_modules/web3-eth-accounts/dist/web3-eth-accounts.cjs.js:396:47)
at tryCatch (/.../node_modules/regenerator-runtime/runtime.js:62:40)
at Generator.invoke [as _invoke] (/.../node_modules/regenerator-runtime/runtime.js:288:22)
at Generator.prototype.(anonymous function) [as next] (/.../node_modules/regenerator-runtime/runtime.js:114:21)
at asyncGeneratorStep (/.../node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (.../node_modules/@babel/runtime/helpers/asyncToGenerator.js:25:9)
at process._tickCallback (internal/process/next_tick.js:68:7)
Same for me.
Thanks for creating this issue! I will fix and release it asap.
I'm still getting this error in ^1.0.0-beta.48.
@lekevicius I've been downgrading to find a version that works. Down to version 1.0.0-beta.20 at the moment and no success. Did you find a version that works?
Same problem here
The fix seems to not yet be merged into the latest release (beta.48).
Would be nice if it were easier to figure out which release actually contains (or is gonna contain) the fix for a bug which was closed, otherwise those hitting the same bug and finding the issue are left behind confused.
This fix will get released this week or at least at the beginning of next week.
@mtsalenc I downgraded to 1.0.0-beta.46 and it works well.
@DiyLecko That version worked, thanks.
Most helpful comment
I'm still getting this error in ^1.0.0-beta.48.