Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
iansamz opened this issue Jun 29, 2022 · 1 comment
Open

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

iansamz opened this issue Jun 29, 2022 · 1 comment

Comments

@iansamz
Copy link

iansamz commented Jun 29, 2022

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

@archseer
Copy link
Collaborator

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants