Guidance creating transaction

I need to broadcast two transaction at the same time, from what I understood to create a transaction I need to get the nonce that is used in the transaction header.
I’m getting the nonce using getNextAccountNonce rpc. Is it possible to create two atomic transaction?

If this is not possible, is there a way to create a Transfer transaction that sends funds to two addresses?

What do you mean by two “atomic” transactions?

It is not possible to send a transfer to two addresses directly. You’d need to do it via a smart contract.

However you can send multiple transactions without waiting for them to finish. You would get the nonce for the account (using getNextAccountNonce) and then

  • send transaction with the provided nonce
  • increase nonce
  • send another transaction with the updated nonce.
1 Like