Created
April 15, 2022 18:04
-
-
Save mgild/95d116b2944ffb4543b26f70e8968ba5 to your computer and use it in GitHub Desktop.
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
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