smartcontractkit/chainlink-solana

Get single data of a off-chain data feed for @chainlink/solana-sdk

iansamz opened this issue · 2 comments

How does a one the latest round data similar to EVM chain get latest data
If non is available, show an example for how to get this from data.onRound listener

You could wrap the onRound listener into a promise, we do that in the tests:

let resolve;
let promise = new Promise<Round>((r) => (resolve = r));
let num;
num = cl.onRound(CHAINLINK_STORE_PROGRAM_ID, (round) => {
resolve(round);
cl.removeListener(num);
});
let got = await promise;

closing stale issue