Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
112 views

anchor_lang::AccountDeserialize

How to implement correctly try_deserialize and try_deserialize_unchecked for this Example struct? I've been trying, but failing miserably. #[derive(Clone)] pub struct ExampleProgram; declare_id!(&...
beliveN DAOist.dev's user avatar
2 votes
1 answer
434 views

How to deserialized Anchor accounts in Rust

In JS/TS I can decode an account from bytes using the coder: const program = new Program(IDL, new PublicKey(""), anchorProvider) const decoded = program.coder.accounts.decode("...
lameren's user avatar
  • 173
6 votes
2 answers
2k views

What's the best way to deserialize Anchor Account Data from AccountInfo?

I have struct MyAccount that I want to deserialize from a list of ctx.remaining_accounts. What's the best way of doing this? Currently I'm using the following format, copied from jet protocol v2's ...
ngundotra's user avatar
  • 528