Harsh
Harsh

Reputation: 67

How to make multiple transaction in web3js

I know web3.eth.sendSignedTransaction() of web3js which is used to send transaction and in return gives us transaction hash. But when I want to make multiple transaction in a loop. It gives me errors like

1 - Transaction known
2 - duplicate transaction
3 - error

So how can I make multiple transaction for sending tokens which can run in loop. The main problem causing this issue is nounce(transaction count of last mined transaction). The transaction is not mined and we give them multiple transaction hence we get same nounce results in getting all these errors. But there is some way for sending multiple transaction. Because when I do the same task in myetherwallet or metamask, it can send multiple transaction.

Upvotes: 2

Views: 5170

Answers (1)

user94559
user94559

Reputation: 60153

Just increment the nonce with each transaction you send.

Upvotes: 1

Related Questions