Complete the code to create a batch of transactions using the correct method.
const batch = new web3.[1]();The BatchRequest class is used to create a batch of requests in web3.js.
Complete the code to add a transaction call to the batch.
batch.[1](contract.methods.transfer(toAddress, amount), callback);send which executes immediately instead of adding to batch.push which is not a method of batch.The add method is used to add a request to the batch.
Fix the error in the code to execute the batch of transactions.
batch.[1]();send which is for single transactions.run or process which do not exist.The execute method runs all requests in the batch.
Fill both blanks to create a batch and add a call to get the balance.
const batch = new web3.[1](); batch.[2](contract.methods.balanceOf(userAddress), callback);
send instead of add to add calls.First, create a BatchRequest object, then add the balanceOf call to the batch.
Fill all three blanks to create a batch, add two calls, and execute the batch.
const batch = new web3.[1](); batch.[2](contract.methods.approve(spender, amount), callback); batch.[3](contract.methods.allowance(owner, spender), callback); batch.execute();
send instead of add to add calls.Create a BatchRequest, then add each call to the batch before executing.
