michaelhly / solana-py

Solana Python SDK
https://michaelhly.github.io/solana-py
MIT License
979 stars 252 forks source link

How to decode instruction data #417

Closed jessiahr closed 5 months ago

jessiahr commented 5 months ago

I am trying to figure out how to get the decoded instruction data for system programs, I found this comment on an old issue but it appears there was a change and that code path was removed.

My use case is to filter for transactions that are using the token program initialize mint and I believe I need the decoded instruction to see what the type is?

Is there an example somewhere of how to decode a UICompiledInstruction for something like this?

michaelhly commented 5 months ago

See https://kevinheavey.github.io/solders/api_reference/instruction.html#solders.instruction.CompiledInstruction.from_bytes