1

I am using @taquito/taquito.

To transfer tezos tokens from one address to another is am using below function.

Tezos.contract.transfer({
              to: toAddress,
              amount: amountToSend,
            });

I need to do continuous transaction. I am getting the error "counter is already used. need to increase the counter from my next transaction". I don't want to batch the transaction. I need to make individual transactions with waiting for previous transaction to complete.

I tried increasing the counter manually like

Tezos.contract.transfer({
              to: toAddress,
              amount: amountToSend,
              counter
            });

But it is not working. How can I increase the counter in taquito?

0

You can make one transaction per block from an account.

This means you need to wait for your operation to complete before sending your next operation.

If you wait for op.confirmation(1) to resolve, you can then make a new transaction. Taquito will get the latest counter from the chain, so you don't need to set it manually.

| improve this answer | |
  • For simple payments (tezos.contract.transfer), a random counter (taken from a large space of numbers) does the job. For contracts, I think you have no other option than continuously switching accounts (new InMemory signer) when you want to send multiple transactions in a block. – Quantenspringer Aug 17 at 11:06

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.