-
Notifications
You must be signed in to change notification settings - Fork 855
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
getProgramAccounts field withContext is not exposed #1285
Comments
Separate functions are one of the most regrettable things about this library. With Typescript, you can modulate the return type of a function depending on its inputs. Take a look how we're doing this in the new web3.js library. solana-web3.js/packages/rpc-core/src/rpc-methods/getAccountInfo.ts Lines 77 to 116 in 21cfcdd
|
## Summary This was missing. When supplied, the RPC wraps the result in a context object. Fixes #1285. ## Test Plan ``` pnpm test:live-with-test-validator pnpm test:unit:node ```
## Summary This was missing. When supplied, the RPC wraps the result in a context object. Fixes #1285. ## Test Plan ``` pnpm test:live-with-test-validator pnpm test:unit:node ```
## Summary This was missing. When supplied, the RPC wraps the result in a context object. Fixes #1285. ## Test Plan ``` pnpm test:live-with-test-validator pnpm test:unit:node ```
🎉 This issue has been resolved in version 1.77.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up. |
Motivation
It seems that a field
withContext
available ingetProgramAccounts
http method is not exposed viasolana-web3.js
.Example use case
I am working on a synchronization mechanism between http request and websocket data.
The synchronization mechanism will use
slot
as a revision field, will first connect to websocket, save all updates and simultaneously send a request. The request response should also returnslot
so that only newer updates from websocket are then applied.Details
According to getProgramAccounts documentation, there is a
withContext
field available which will make the response containcontext
.Such field is however not exposed by
solana-web3js
.Similarly to the pair
I would expect the same for
getProgramAccounts
and (does not exist)getProgramAccountsAndContext
.Or adding the
withContext
boolean to the function signature. As the result type depends on this value a separate function is imo better.The text was updated successfully, but these errors were encountered: