4

I get the parsed transaction from Solana (getParsedTransaction) and I would like to specifically parse the instructions and their corresponding innerInstructions. How can I know that my innerInstruction[0] belongs to this or that instruction? Directly from the transaction, without any new RPC request. I can't find any index or simple information telling me that the innerInstruction is linked to such and such instruction. I hope I am clear in my question!

Thank you!

1 Answer 1

4

ParsedInnerInstruction.index should correspond to the index of the outer instruction that houses the inner instruction.

So if parsedTransaction.meta.innerInstructions[0].index is say 1, then it means the outer instruction is parsedTransaction.transaction.message.instructions[1] is the parent.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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