Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for decoding instructions to the client gen #150

Open
nhruo123 opened this issue Nov 21, 2024 · 0 comments
Open

Add support for decoding instructions to the client gen #150

nhruo123 opened this issue Nov 21, 2024 · 0 comments

Comments

@nhruo123
Copy link

nhruo123 commented Nov 21, 2024

I have a use case in which I need to decode a stream of bytes and an array of accounts into the generated args and accounts of an instruction.

I would like to have the following additions to the client gen:

  1. Export the identifier of each instruction.
  2. Add a decode_<instruction_name> function that accepts bytes and Sequence[Pubkey] and returns a tuple of <instruction_name>Args and <instruction_name>Accounts (or better yet a class that wraps both the args and accounts to a single type).
  3. A general decode function that accepts bytes and Sequence[Pubkey] and calls a decode_X based on the identifier at the start of the byte array that returns the value of the decode function.
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

No branches or pull requests

1 participant