Quantcast
Channel: Recent Questions - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 8180

Deserializing Anchor Account Data

$
0
0

The IDL from anchor is this

 {"name": "GlobalVotes","type": {"kind": "struct","fields": [      {"name": "tremp","type": "u32"      },      {"name": "boden","type": "u32"      }    ]  }},

And when I run

anchor account vote_info.GlobalVotes 7uGibYhUzB8mrLvHqR6uSZotmnuSQTFtMfrTcDDD5Sq3

it returns the appropriate information deserialized from the account. However, I am trying to pull this account info from outside of the anchor environment (in a react front end app) and when I try to use Borsh I cannot deserialize the data correctly/at all. How do I deserialize using the Anchor IDL/ fill in the appropriate schema for something like borsh and deserialize the account data from the client side outside of anchor environment?


Viewing all articles
Browse latest Browse all 8180

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>