Skip to content

add fuel example #386

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

Merged
merged 2 commits into from
Jul 31, 2024
Merged

add fuel example #386

merged 2 commits into from
Jul 31, 2024

Conversation

cctdaniel
Copy link
Contributor

No description provided.

Copy link

vercel bot commented Jul 31, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 31, 2024 8:14am

Comment on lines 137 to 150
const fetchPriceUpdateData = async () => {
const response = await fetch(
HERMES_V2_LATEST_PRICE_UPDATES_ENDPOINT + PRICE_FEED_ID
);
if (!response.ok) {
throw new Error("Failed to fetch price");
}
const data = await response.json();
const binaryData = data.binary.data[0];
const buffer = Buffer.from(binaryData, "hex");
return buffer;
};

const updateData = await fetchPriceUpdateData();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you not using the hermes client here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could but this was just more straightforward

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to use HermesClient

Copy link
Contributor

@ali-behjati ali-behjati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Please address my inline comment before merging.

@cctdaniel cctdaniel merged commit 003ecc2 into main Jul 31, 2024
4 checks passed
@cctdaniel cctdaniel deleted the fuel-example branch July 31, 2024 08:19
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

Successfully merging this pull request may close these issues.

2 participants