Skip to content

Market Account Info Deserialization #115

Answered by pawel-betdex
bkw1491 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey. You are definitely on the right track.

Is there some kind of schema? If so, what order are the properties in? Am I correct in saying I need to know the order for Borsh serialization?

Yes. The Rust code of the account is the schema. It dictates types, sizes and order in which everything is serialised/deserialised. Here is the one for the market. You can find others in the same folder. I would probably ignore TypeScript client (or treat it as a guide only) as source of truth as not all types map 1-1 with Rust. Here's some useful code for the data type sizes that we use to initiate accounts.

"The first 8 bytes are reserved for a unique account discriminator, self-described by the fir…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bkw1491
Comment options

Answer selected by bkw1491
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants