I want to add two instructions to a single transaction and only show one popup to user then he/she can approve ONLY ONE transaction. Tried with '@solana/web3.js' Transaction but it didn't worked as expected. Below shows the code that I implemented. Thank you! enter image description here

  • 1
    Can you edit this question to include the code in a code block instead of a screenshot please?
    – Callum M
    Sep 20, 2022 at 20:22
  • Can you describe all of the details about what didn't work as you expected, along with all relevant error messages and unexpected behaviours? Dec 20, 2022 at 19:45

1 Answer 1


It looks like you're using some deprecated anchor methods. Try using the "method builder" approach, where the last statement is .instruction().

There are some examples of this syntax on the Anchor repository: https://github.com/coral-xyz/anchor/blob/master/examples/tutorial/basic-1/tests/basic-1.js.

Not the answer you're looking for? Browse other questions tagged or ask your own question.