-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Test * Go * Try another one * Try this * Clean it * try again * Test * EDge test * Another one * Another one * Go * Update import * Continue * Finish refactor * Refactor complete * Increase max duration * CMC works * CMC works * Cleanup * Increase timeout * Logs * Revert "Logs" This reverts commit 26aa610. * Revert some stuff * Do it
- Loading branch information
Showing
10 changed files
with
335 additions
and
273 deletions.
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.
e4e8851
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.
Successfully deployed to the following URLs:
staking-devnet – ./
governance-nu.vercel.app
staking-devnet-pyth-web.vercel.app
staking-devnet-git-main-pyth-web.vercel.app
e4e8851
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.
Successfully deployed to the following URLs:
staking – ./
staking-pyth-web.vercel.app
staking-git-main-pyth-web.vercel.app
staking.pyth.network
staking-rho-nine.vercel.app