blocto / solana-go-sdk

Solana Golang SDK
https://blocto.github.io/solana-go-sdk/
MIT License
373 stars 96 forks source link

sending multiple transactions as ACID transactions #62

Closed scottywm closed 2 years ago

scottywm commented 2 years ago

Hello again :)

I was just wondering, is there a way to do ACID transaction with your library?

For example, if I was to send tether tokens to addresses A and B from address C, could I do an ACID transaction to ensure that the tokens get sent to both address A and B otherwise the transaction would roll back if the one didn't succeed?

You guys should start billing me for all your time in answering all my questions ;)

thanks heaps

yihau commented 2 years ago

Transferring tokens is an instruction. You can pack them (transfer token to A and B) into the same transaction. If one of them fails, the whole transaction will fail as well.