Last active
April 18, 2024 23:20
-
-
Save mgild/de63b8414a7ef2bbc31931b0b13d54f4 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 coder = new BorshAccountsCoder(program.idl); | |
const oracles = await queue.fetchOracleKeys(); | |
const oracleAccounts = await utils.rpc.getMultipleAccounts( | |
program.provider.connection, | |
oracles | |
); | |
const oracleDatas = oracleAccounts | |
.map((x: any) => coder.decode("OracleAccountData", x.account.data)); | |
// TODO: now filter out all oracles that keys are not currently verified and keys expire in more than an hour | |
// Then choose a random one after the filter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment