We are attempting to add 8 instructions to a transaction and send it, but we are encountering an error indicating that it is too long to be processed. We are trying to perform a swap operation that involves two transactions. We would like to combine these into a single transaction. How can we achieve this?
Thank you for your assistance.
const legacyTransaction = new Transaction({
blockhash: recentBlockhashForSwap.blockhash,
lastValidBlockHeight: recentBlockhashForSwap.lastValidBlockHeight,
feePayer: publicKey,
});
legacyTransaction.add(...txs[0]);
legacyTransaction.instructions.push(...txs[1]);
We also tried with VersionedTransaction
but we got unsuccessful in this one as well.