Skip to content

Guide: Swap Transaction #61

Answered by Shpota
itsmelodewyk asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @itsmelodewyk

Thank you for opening this discussion. I am sorry you were confused with the APIs.

TransferInstruction is meant to transfer SOL from one account to another, generally you cannot use it for other purposes. If you want to include an arbitrary bytes to a transaction you can use BaseInstruction. This means you would need to prepare the binary data needed for the instruction yourself.

However, quickly looking at the API that you shared, I see that they create a transaction for you which you later need to sign. Keep in mind, transactions and instructions are two completely different entities. Every transaction includes one or more instructions.

Unfortunately, deserialising tran…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by itsmelodewyk
Comment options

You must be logged in to vote
1 reply
@dovudo
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants