index.rs 1.3 KB

123456789101112131415161718192021
  1. use axum::{response::IntoResponse, Json};
  2. /// This is the index page for the REST service. It lists all the available endpoints.
  3. ///
  4. /// TODO: Dynamically generate this list if possible.
  5. pub async fn index() -> impl IntoResponse {
  6. Json([
  7. "/live",
  8. "/ready",
  9. "/api/price_feed_ids",
  10. "/api/latest_price_feeds?ids[]=<price_feed_id>&ids[]=<price_feed_id_2>&..(&verbose=true)(&binary=true)",
  11. "/api/latest_vaas?ids[]=<price_feed_id>&ids[]=<price_feed_id_2>&...",
  12. "/api/get_price_feed?id=<price_feed_id>&publish_time=<publish_time_in_unix_timestamp>(&verbose=true)(&binary=true)",
  13. "/api/get_vaa?id=<price_feed_id>&publish_time=<publish_time_in_unix_timestamp>",
  14. "/api/get_vaa_ccip?data=<0x<price_feed_id_32_bytes>+<publish_time_unix_timestamp_be_8_bytes>>",
  15. "/v2/updates/price/latest?ids[]=<price_feed_id>&ids[]=<price_feed_id_2>&..(&encoding=hex|base64)(&parsed=false)",
  16. "/v2/updates/price/stream?ids[]=<price_feed_id>&ids[]=<price_feed_id_2>&..(&encoding=hex|base64)(&parsed=false)(&allow_unordered=false)(&benchmarks_only=false)",
  17. "/v2/updates/price/<timestamp>?ids[]=<price_feed_id>&ids[]=<price_feed_id_2>&..(&encoding=hex|base64)(&parsed=false)",
  18. "/v2/price_feeds?(query=btc)(&asset_type=crypto|equity|fx|metal|rates)",
  19. ])
  20. }