Skip to content

Conversation

@cctdaniel
Copy link
Contributor

@cctdaniel cctdaniel commented Jan 12, 2024

implement new v2 endpoint for /updates/price/latest which is a merge of the existing endpoints as follow:

  • /api/latest_price_feeds?ids[]=<price_feed_id>&ids[]=<price_feed_id_2>&..(&verbose=true)(&binary=true)
  • /api/latest_vaas?ids[]=<price_feed_id>&ids[]=<price_feed_id_2>&...

the proposed v2 endpoint is as follow:

  • /v2/updates/price/latest?ids[]=<price_feed_id>&ids[]=<price_feed_id_2>&..(&encoding=hex|base64)(&parsed=false)

encoding defaults to hex and parsed defaults to true as per design guideline

this PR serves at an initial stab at the endpoint, will follow up with a separate PR for the tests

@vercel
Copy link

vercel bot commented Jan 12, 2024

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

2 Ignored Deployments
Name Status Preview Comments Updated (UTC)
example-oracle-amm ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2024 11:42am
xc-admin-frontend ⬜️ Ignored (Inspect) Visit Preview Jan 19, 2024 11:42am

@cctdaniel cctdaniel marked this pull request as draft January 12, 2024 03:54
@cctdaniel cctdaniel marked this pull request as ready for review January 12, 2024 13:38
#[schema(value_type = Option<u64>, example=85480034)]
pub slot: Option<Slot>,
#[schema(value_type = Option<i64>, example=doc_examples::timestamp_example)]
pub proof_available_time: Option<UnixTimestamp>,
Copy link
Collaborator

Choose a reason for hiding this comment

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

for the future: can we make this a ms-resolution timestamp?

Copy link
Collaborator

@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. I left a comment on changing the proof_available_timestamp to have millisecond resolution which can be done in subsequent PRs.

@cctdaniel cctdaniel merged commit 69e4fee into main Jan 19, 2024
@cctdaniel cctdaniel deleted the hermes-v2-price-updates-latest branch January 19, 2024 11:53
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.

3 participants