Closed koalateectrl closed 2 years ago
For decoding account data, you will need to know how program serialized it.
You can take a look at how I do in decoding token account.
or you can use raw rpc client and give jsonParsed
as the encoding.
It will decode some build-in account data for you (like token account, vote account ...)
When I call a method, for example GetAccountInfo and I receive a response, the response unmarshals fields such as lamports, owner, executable etc in human-readable form, but the Data field comes in a byte array.
What is the best/easiest way for me to convert this byte array into a human readable form (such as JSON), specifically if I don't know the specific fields that will be returned?