-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rebase UX/tokens-rebase on top of Anchor decode changes #164
Conversation
- Configure log level with env var - Don't log all account data on cache miss Signed-off-by: Nathan LeClaire <[email protected]>
* make lint do typechecking * fix all the typescript errors
…159) Co-authored-by: Blusk <[email protected]>
Signed-off-by: Sven Dowideit <[email protected]>
yup, gotta do some poking. |
I think I'll look into this tomorrow - thanks - will use it as a basis for figuring out where we overlap |
@@ -51,20 +58,21 @@ export async function getAccount( | |||
|
|||
const solConn = new sol.Connection(netToURL(net)); | |||
const key = new sol.PublicKey(pubKey); | |||
const solAccount = await solConn.getAccountInfo(key); | |||
// const solAccount = await solConn.getAccountInfo(key); | |||
const solAccount = await solConn.getParsedAccountInfo(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm, i'll have to see how this plays with the new getMultipleAccountInfo
method ... that RPC endpoint accepts a jsonparsed arg, so theoretically I see now reason why it wouldn't get parsed, but there's no getParsedMultipleAccountInfo
in web3.js :|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/solana-labs/solana-web3.js/blob/master/src/connection.ts#L2862
hardcode to base64
and not any option for jsonParsed
, gah WHY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sigh, yea, I can get parsed result from getMultipleAccountsInfo
, but it blows up on some type of struct validation they do after it returns.
To get a parsed version of getMultipleAccounts
, I'm afraid we might have to duplicate the underlying web3.js code (cringe). Which seems relatively doable by calling those underlying methods like _buildArgs
fwiw. Though I can't say exactly what makes the result unsafe and if that's a type safety or a security safety concern.
Alternatively -- since for now I think we mostly want to have decoded accounts for AccountView
, i.e., one at a time -- we could change the 'legacy' getAccount
interval in AccountView
to be a slower poll that calls getParsedAccountInfo
for the specific account that's being highlighted -- that would unblock this for now
I did kinda want to display token information within a smaller embedded view in accounts list though :|
I'm gonna make an issue to track this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, i did it my way :) but i need to figure out how to make the update of accounts being viewed make sense its like a shared state cache :/ |
Since #123 and #152 fiddle heavily with
AccountView
and displaying decoded account data, it's best to reconcile them now. This PR rolls main and #154 into #152. You may want to open a third PR just in case because I squashed all of your commits into one in this one to avoid rebase hell.#154 will need to be merged into main for this one as well.
Description of actual changes:
useWallet
(for mint creation, etc) anduseAnchorWallet
for decoding inAccountView
renderAccountData
Pretty stoked about these developments cause it's starting to make peering into the accounts tons more usable . LFG 🚀