You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This depends on the kind of object you're trying to decode but here's a general idea of what to do to try and decode the data:
First and foremost decode the data from base64 into a byte[] a Span<byte> or whatever your preferred type for this is going to be, you can check some examples of this being done in the Serum code here (note: this code is still under development and subject to changes)
Afterwards, it depends on the type of account you're trying to decode, certain accounts will have a certain data layout, i.e. Serum Market accounts have a certain layout (Serum Market account layouts), and they have to be decoded according to that layout, by using offsets and reading the desired data type for the account type/layout at the specific offset, as you can see by the static Deserialize method on the Market class here.
To add more context to this, the latest v0.3.1 release features additions of utility methods that can be used to make encoding and decoding of program and account data much easier, the implementations of SPL and Native programs inside Solnet.Programs have already been refactored to use these methods, while the refactoring of Solnet.Serum to use these same methods is underway. You can check those methods here:
Seems that I cant find an example for that. I'm using base64.
The text was updated successfully, but these errors were encountered: