-
Notifications
You must be signed in to change notification settings - Fork 46
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
[frontend] Try to fix API #339
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
aa9b8ff
Test
guibescos 8c1578f
Go
guibescos f05e349
Try another one
guibescos 8d1ea59
Try this
guibescos 5479659
Clean it
guibescos 3212cdb
try again
guibescos 0f967a7
Test
guibescos b6076fe
EDge test
guibescos 42e80ef
Another one
guibescos 3d7410e
Another one
guibescos 21f503b
Go
guibescos 79fdb9a
Update import
guibescos 28b04df
Continue
guibescos 989b87d
Finish refactor
guibescos 13c4591
Refactor complete
guibescos 8902782
Increase max duration
guibescos 1e063de
CMC works
guibescos a98ba9f
CMC works
guibescos f1f186c
Cleanup
guibescos 9ac11dd
Increase timeout
guibescos 26aa610
Logs
guibescos 85ed14c
Revert "Logs"
guibescos aeb122a
Revert some stuff
guibescos d073768
Do it
guibescos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes' | ||
import { PublicKey } from '@solana/web3.js' | ||
import axios from 'axios' | ||
|
||
// The JSON payload is too big when using the @solana/web3.js getProgramAccounts | ||
// We get around this by using the base64+ztsd encoding instead of base64 that @solana/web3.js uses | ||
export async function getAllStakeAccounts(url: string): Promise<PublicKey[]> { | ||
const response = await axios({ | ||
method: 'post', | ||
url: url, | ||
data: { | ||
jsonrpc: '2.0', | ||
id: 1, | ||
method: 'getProgramAccounts', | ||
params: [ | ||
'pytS9TjG1qyAZypk7n8rw8gfW9sUaqqYyMhJQ4E7JCQ', | ||
{ | ||
encoding: 'base64+zstd', | ||
filters: [ | ||
{ | ||
memcmp: { | ||
offset: 0, | ||
bytes: bs58.encode(Buffer.from('55c3f14f7cc04f0b', 'hex')), // Positions account discriminator | ||
}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}) | ||
return response.data.result.map((x: any) => new PublicKey(x.pubkey)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
is there a way to paginate the response ? that could be a good fix.