Skip to content

Instantly share code, notes, and snippets.

@mgild
Created April 15, 2022 18:04
Show Gist options
  • Save mgild/95d116b2944ffb4543b26f70e8968ba5 to your computer and use it in GitHub Desktop.
Save mgild/95d116b2944ffb4543b26f70e8968ba5 to your computer and use it in GitHub Desktop.
const queueKeypair = keypairFromFile(
"~/switchboard_accounts_v2/queues/queue_permissionless.json"
);
const accountInfos = await program.provider.connection.getProgramAccounts(
new PublicKey(PID),
{ filters: [{ dataSize: 3851 }] }
);
const accounts: Array<PublicKey> = [];
for (const info of accountInfos) {
try {
const ag = sbv2.AggregatorAccount.decode(program, info.account);
if (ag.queuePubkey.equals(queueKeypair.publicKey)) {
accounts.push(info.pubkey);
}
} catch (e) {}
}
for (const x of accounts) {
const aggregatorAccount = new sbv2.AggregatorAccount({
program,
publicKey: x,
});
console.log(`"${x.toBase58()}",`);
const jobs = await aggregatorAccount.loadJobs();
const jobsString = JSON.stringify(jobs);
console.log(jobsString);
if (jobsString.toUpperCase().includes("ORCA")) {
console.log(`FOUND`);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment