Closed ff781 closed 3 weeks ago
Here's what solana-py uses, though be warned I suspect there could be some edge case where this is incorrect:
def _decompile_instructions(msg: SoldersMessage) -> List[Instruction]: account_keys = msg.account_keys decompiled_instructions: List[Instruction] = [] for compiled_ix in msg.instructions: program_id = account_keys[compiled_ix.program_id_index] account_metas = [ AccountMeta( account_keys[idx], is_signer=msg.is_signer(idx), is_writable=msg.is_writable(idx), ) for idx in compiled_ix.accounts ] decompiled_instructions.append(Instruction(program_id, compiled_ix.data, account_metas)) return decompiled_instructions
Here's what solana-py uses, though be warned I suspect there could be some edge case where this is incorrect: