-
Notifications
You must be signed in to change notification settings - Fork 35
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
add fuel example #386
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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(); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to use HermesClient
There was a problem hiding this 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.
No description provided.