Skip to content

Conversation

@Vinayapr23
Copy link
Contributor

Description

Implements instruction parsing for Solana native programs. This PR adds a new "Parse Instructions" command to the Transaction module that decodes and displays transaction instructions in a human-readable format.

Related Issue

Partially closes #44

Fixes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Tests (adding or updating tests)

Before Submitting

  • I have searched for duplicate issues/PRs
  • I have discussed this change in an issue (required for new features)
  • My changes are based on the latest master branch

Code Quality

  • I have run make all-checks and all checks pass
  • I have added/updated tests if applicable
  • I have updated documentation if needed
  • My code follows the project's coding standards

@Vinayapr23
Copy link
Contributor Author

@Nagaprasadvr currently added System program , Token program , Assosiated Token Program program , Memo program
Lmk

@BretasArthur1 BretasArthur1 self-requested a review January 8, 2026 22:33
@Nagaprasadvr
Copy link
Collaborator

i think this can go inside FetchTransaction and we ask the user whether to parse ixs or not

looks good

can u attach some pictures showing parsing , try to get a tx which covers most of the ixs also maybe a sep one for memo

@Vinayapr23
Copy link
Contributor Author

Vinayapr23 commented Jan 9, 2026

i think this can go inside FetchTransaction and we ask the user whether to parse ixs or not

looks good

can u attach some pictures showing parsing , try to get a tx which covers most of the ixs also maybe a sep one for memo

So how should the flow look like
After the transaction is fetched we ask the user if he wants to fetch the instructions?

Yes ill attach the screenshot

@Nagaprasadvr
Copy link
Collaborator

i think this can go inside FetchTransaction and we ask the user whether to parse ixs or not
looks good
can u attach some pictures showing parsing , try to get a tx which covers most of the ixs also maybe a sep one for memo

So how should the flow look like After the transaction is fetched we ask the user if he wants to fetch the instructions?

Yes ill attach the screenshot

it should be after asking for signature step

@Vinayapr23
Copy link
Contributor Author

i think this can go inside FetchTransaction and we ask the user whether to parse ixs or not
looks good
can u attach some pictures showing parsing , try to get a tx which covers most of the ixs also maybe a sep one for memo

So how should the flow look like After the transaction is fetched we ask the user if he wants to fetch the instructions?
Yes ill attach the screenshot

it should be after asking for signature step

Okey as an optional feature

@Vinayapr23
Copy link
Contributor Author

Vinayapr23 commented Jan 9, 2026

@Nagaprasadvr here are the screenshots

SOL transfer and Memo
Screenshot 2026-01-09 at 11 33 39 AM

Create Mint
Screenshot 2026-01-09 at 11 49 04 AM

Transfer with compute budget setting
Screenshot 2026-01-09 at 11 50 07 AM

Creating assosiated token account
Screenshot 2026-01-09 at 11 52 19 AM

Creating assosiated token account and transfer spl token
Screenshot 2026-01-09 at 12 18 04 PM

@Nagaprasadvr
Copy link
Collaborator

Maybe we can display it in a different way so it's easy to understand the whole tx flow , ig we can ditch the table and use something else for this let me think about this

@Vinayapr23
Copy link
Contributor Author

Maybe we can display it in a different way so it's easy to understand the whole tx flow , ig we can ditch the table and use something else for this let me think about this

Yeah feels a bit cluttered
Lmk what you think

@BretasArthur1
Copy link
Collaborator

Hey @Vinayapr23 what we could do as well is to get known programs name and put a mask on them. Like if program_id starts with "Tokenkeg..." we display Token Program instead of the address... wdyt @Nagaprasadvr ?

@Vinayapr23
Copy link
Contributor Author

Hey @Vinayapr23 what we could do as well is to get known programs name and put a mask on them. Like if program_id starts with "Tokenkeg..." we display Token Program instead of the address... wdyt @Nagaprasadvr ?

Hey @BretasArthur1 I think iam already doing that I believe
Can you check my attached screenshots in the comments above

@Nagaprasadvr
Copy link
Collaborator

Nagaprasadvr commented Jan 12, 2026

hey @Vinayapr23
image
something like this

a tree like structure showing ixs , cpi , accounts etc

use ptree rust lib

just build this tree structure and then we can iterate on showing data specific to each ix

@Vinayapr23
Copy link
Contributor Author

hey @Vinayapr23 image something like this

a tree like structure showing ixs , cpi , accounts etc

use ptree rust lib

just build this tree structure and then we can iterate on showing data specific to each ix

Okey Ill utilise this and rework

@BretasArthur1
Copy link
Collaborator

nice

@Vinayapr23
Copy link
Contributor Author

hey @Vinayapr23 image something like this
a tree like structure showing ixs , cpi , accounts etc
use ptree rust lib
just build this tree structure and then we can iterate on showing data specific to each ix

Okey Ill utilise this and rework

Will work on this
Was a bit busy due to regular work and other stuff

@Nagaprasadvr Nagaprasadvr marked this pull request as draft January 18, 2026 14:45
@Vinayapr23 Vinayapr23 force-pushed the feat/instruction-parsing-for-native-solana-programs branch 2 times, most recently from 0cdda90 to fd0c57e Compare January 21, 2026 07:46
@Vinayapr23 Vinayapr23 force-pushed the feat/instruction-parsing-for-native-solana-programs branch from fd0c57e to 5960e3e Compare January 21, 2026 07:57
@Vinayapr23
Copy link
Contributor Author

@Nagaprasadvr changed to specified format using ptree

Screenshot 2026-01-21 at 2 43 31 PM Screenshot 2026-01-21 at 2 43 07 PM

@Vinayapr23 Vinayapr23 marked this pull request as ready for review January 21, 2026 09:22
Copy link
Collaborator

@Nagaprasadvr Nagaprasadvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks clean , few comments and gtg

@Nagaprasadvr
Copy link
Collaborator

can u please attach how does a custom ix look like ( maybe a swap ix )

@Nagaprasadvr
Copy link
Collaborator

how do we handle CPI ?

@Vinayapr23
Copy link
Contributor Author

Vinayapr23 commented Jan 22, 2026

Screenshot 2026-01-22 at 6 15 48 PM

Raydium swap

can u please attach how does a custom ix look like ( maybe a swap ix )

It will go through the partially decoded instruction currently in code which extracts generic information
For this to work I think we need custom IDL parsing which we agreed would happen after this PR
I have it located in WIP PR and needs work on that side

@Vinayapr23
Copy link
Contributor Author

how do we handle CPI ?

Ill check this and address the rest of the comments and let you know
Thanks

@Nagaprasadvr
Copy link
Collaborator

can u please attach how does a custom ix look like ( maybe a swap ix )

I havent checked this since swap can only be done in main net But it will go through the partially decoded instruction currently in code which extracts generic information For this to work I think we need custom IDL parsing which we agreed would happen after this PR I have it located in WIP PR and needs work on that side

u can look at explorer and get a swap tx signature

@Vinayapr23
Copy link
Contributor Author

Vinayapr23 commented Jan 22, 2026

can u please attach how does a custom ix look like ( maybe a swap ix )

I havent checked this since swap can only be done in main net But it will go through the partially decoded instruction currently in code which extracts generic information For this to work I think we need custom IDL parsing which we agreed would happen after this PR I have it located in WIP PR and needs work on that side

u can look at explorer and get a swap tx signature

yeah i did

Raydium swap

831xYPSaXdXekKBqK9bxdgjEdgsrTk7PurLmv44MeYZ13b1iTKUbmr7LBAWJ28YmTvGo1Cv4Qnvwfz4VH4PNqHg

Screenshot 2026-01-22 at 6 15 48 PM

It will go through the partially decoded instruction currently in code which extracts generic information
For this to work I think we need custom IDL parsing which we agreed would happen after this PR
I have it located in WIP PR and needs work on that side

@Nagaprasadvr
Copy link
Collaborator

@Vinayapr23 let me know when u reolve these comments or u need any help

@Vinayapr23
Copy link
Contributor Author

@Vinayapr23 let me know when u reolve these comments or u need any help

Sure ser ill resolve it soon

@Vinayapr23
Copy link
Contributor Author

Vinayapr23 commented Feb 4, 2026

how do we handle CPI ?

@Nagaprasadvr Not handling CPI now only top level instructions
CPI will be an issue during custom programs right?
Here we have only done standard programs
Shouldnt' I add it in custom program PR and rather not here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Instruction parsing

3 participants