-
Notifications
You must be signed in to change notification settings - Fork 247
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
Provide an example, a test, and docs for decodeInstruction() #172
Comments
Earlier process (moved out of main issue description) I think I should be able to pass a solana Instruction from the rpc directly to the exported serum function decodeInstruction() I tried with raw TransactionInstruction from getConfirmedTransaction... both give an error with this stack:
it seems that instructions.decode is passing along the whole (untyped) message and later decode is expecting it to have a further details of the issue:
So rather than passing the whole instruction one needs to pass the instruction.data in as a Uint8Array of raw bytes. In this codesandbox i'm using basex-encoder.decodeToBuffer() to convert the PartiallyDecodedInstruction.data (which is base58 encoded) and then passing that to the serum decodeInstruction() fx, which returns this:
|
I am trying to decode serum order info directly from the blockchain history (rpc results) this issue will document the process of figuring out how, and offer a PR to improve the internal documentation.
The text was updated successfully, but these errors were encountered: