I want to send transactions asynchronously (in parallel) with Taquito. For payments, this works well with a counter (see also https://github.com/ecadlabs/taquito/compare/allow-to-explicitly-set-counter#diff-e58e08dcf2494864df78d3ffeed46f44R137), however, it seems that for contract methods setting a counter has no effect. Can anyone confirm / disagree? Since payments are also somehow contract methods, I was quite surprised that it did not work.


I am not sure about what you mean with "counter"? The Github link you provided is for a different branch of Taquito and as of today, I couldn't find in the official documentation any "counter" property in the parameters object for transactions.
Payments are not contract methods because implicit accounts don't have methods and contracts receiving payments behave like implicit accounts (so no method involved).
If you want to send multiple transactions in parallel, what about using "Promise.all"? For example:

const promise1 = await contract.methods.transfer(params1).send();
const promise2 = await contract.methods.transfer(params2).send();
const [op1, op2] = await Promise.all([promise1, promise2]);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.