AnswerBun.com

Typechain and Batch Requests

Ethereum Asked by slider on December 2, 2020

I’m trying to send a batch request of transactions to my contract from web3. Using Typechain, my contract’s methods are of type NonPayableTransactionObject<void>, which doesn’t appear to support typing for that pesky .request method required of batch.add(). For example…

let batch = new web3.eth.BatchRequest();
for (let id of tokenIDs) {
    batch.add(myContract.methods.myMethod(id).send.request({ from: defaultAccount })   
}
batch.execute();

This produces Property 'request' does not exist on type '(tx?: NonPayableTx | undefined) => PromiEvent<TransactionReceipt>'.ts(2339).

Is there another way of sending transactions to a contract via Batch Request using Typescript/Typechain?

Add your own answers!

Related Questions

Verifying Signatures from other ECC Curves with ecRecover

1  Asked on August 26, 2021 by notoriousj

 

Geth Providing error on its directory path

1  Asked on March 2, 2021 by sahitya-kumar-suman

       

What storage is assigned to mappings in solidity?

1  Asked on February 27, 2021 by trevor-lee-oakley

   

Metamask not allowing any transaction by code

1  Asked on February 26, 2021 by shoaib-iqbal

 

The blockchain trilemma

1  Asked on February 26, 2021

   

History of Ethereum

1  Asked on February 22, 2021 by phil-boltt

 

Transferring an ERC-20 using web3js 1.0.0

1  Asked on February 21, 2021 by john-murphy

       

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir