I have a parity poa network running and when I try to make batch requests I get the error:
Error: JSONRPC method should be specified for params: "undefined"!
at Object.Jsonrpc.toPayload (/Users/aaron/workspace/nw_test/node_modules/web3-core-requestmanager/src/jsonrpc.js:42:15)
at /Users/aaron/workspace/nw_test/node_modules/web3-core-requestmanager/src/jsonrpc.js:84:24
at Array.map (<anonymous>)
at Object.Jsonrpc.toBatchPayload (/Users/aaron/workspace/nw_test/node_modules/web3-core-requestmanager/src/jsonrpc.js:83:21)
at RequestManager.sendBatch (/Users/aaron/workspace/nw_test/node_modules/web3-core-requestmanager/src/index.js:163:27)
at Batch.execute (/Users/aaron/workspace/nw_test/node_modules/web3-core-requestmanager/src/batch.js:50:25)
at decryptedAccount.signTransaction.then.signedTx (/Users/aaron/workspace/nw_test/makeTx.js:46:26)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
My code is:
const batch = new web3.BatchRequest();
return decryptedAccount.signTransaction(rawTransaction)
.then(signedTx => {
batch.add(web3.eth.sendSignedTransaction(signedTx.rawTransaction));
batch.execute();
})
.catch(console.error);
web3 version: 1.0.0-beta.36
node version: 8.9.3
The problem is that you're using the batch request the wrong way.
Try it with:
batch.add(web3.eth.sendSignedTransaction.request(signedTx.rawTransaction);
Most helpful comment
The problem is that you're using the batch request the wrong way.
Try it with: