diff --git a/apps/hermes/Cargo.lock b/apps/hermes/Cargo.lock index b7f0515cbd..6040ba2005 100644 --- a/apps/hermes/Cargo.lock +++ b/apps/hermes/Cargo.lock @@ -1796,7 +1796,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hermes" -version = "0.5.8" +version = "0.5.9" dependencies = [ "anyhow", "async-trait", diff --git a/apps/hermes/Cargo.toml b/apps/hermes/Cargo.toml index 879b535b77..be7b88d0b6 100644 --- a/apps/hermes/Cargo.toml +++ b/apps/hermes/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hermes" -version = "0.5.8" +version = "0.5.9" description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle." edition = "2021" diff --git a/apps/hermes/src/api.rs b/apps/hermes/src/api.rs index f282a1155d..0053621172 100644 --- a/apps/hermes/src/api.rs +++ b/apps/hermes/src/api.rs @@ -124,6 +124,7 @@ pub async fn run(opts: RunOptions, state: ApiState) -> Result<()> { // Initialize Axum Router. Note the type here is a `Router` due to the use of the // `with_state` method which replaces `Body` with `State` in the type signature. let app = Router::new(); + #[allow(deprecated)] let app = app .merge(SwaggerUi::new("/docs").url("/docs/openapi.json", ApiDoc::openapi())) .route("/", get(rest::index)) diff --git a/apps/hermes/src/api/rest/get_price_feed.rs b/apps/hermes/src/api/rest/get_price_feed.rs index a700f201a9..8f9980aeed 100644 --- a/apps/hermes/src/api/rest/get_price_feed.rs +++ b/apps/hermes/src/api/rest/get_price_feed.rs @@ -49,6 +49,8 @@ pub struct GetPriceFeedQueryParams { binary: bool, } +/// **Deprecated: use /v2/updates/price/{publish_time} instead** +/// /// Get a price update for a price feed with a specific timestamp /// /// Given a price feed id and timestamp, retrieve the Pyth price update closest to that timestamp. @@ -62,6 +64,7 @@ pub struct GetPriceFeedQueryParams { GetPriceFeedQueryParams ) )] +#[deprecated] pub async fn get_price_feed( State(state): State>, QsQuery(params): QsQuery, diff --git a/apps/hermes/src/api/rest/get_vaa.rs b/apps/hermes/src/api/rest/get_vaa.rs index cb147bfdd6..3b8b054533 100644 --- a/apps/hermes/src/api/rest/get_vaa.rs +++ b/apps/hermes/src/api/rest/get_vaa.rs @@ -55,6 +55,8 @@ pub struct GetVaaResponse { publish_time: UnixTimestamp, } +/// **Deprecated: use /v2/updates/price/{publish_time} instead** +/// /// Get a VAA for a price feed with a specific timestamp /// /// Given a price feed id and timestamp, retrieve the Pyth price update closest to that timestamp. @@ -69,6 +71,7 @@ pub struct GetVaaResponse { GetVaaQueryParams ) )] +#[deprecated] pub async fn get_vaa( State(state): State>, QsQuery(params): QsQuery, diff --git a/apps/hermes/src/api/rest/get_vaa_ccip.rs b/apps/hermes/src/api/rest/get_vaa_ccip.rs index 7bc25e55d4..d613e1660f 100644 --- a/apps/hermes/src/api/rest/get_vaa_ccip.rs +++ b/apps/hermes/src/api/rest/get_vaa_ccip.rs @@ -46,6 +46,8 @@ pub struct GetVaaCcipResponse { data: String, // TODO: Use a typed wrapper for the hex output with leading 0x. } +/// **Deprecated: use /v2/updates/price/{publish_time} instead** +/// /// Get a VAA for a price feed using CCIP /// /// This endpoint accepts a single argument which is a hex-encoded byte string of the following form: @@ -60,6 +62,7 @@ pub struct GetVaaCcipResponse { GetVaaCcipQueryParams ) )] +#[deprecated] pub async fn get_vaa_ccip( State(state): State>, QsQuery(params): QsQuery, diff --git a/apps/hermes/src/api/rest/latest_price_feeds.rs b/apps/hermes/src/api/rest/latest_price_feeds.rs index 4e2df2747d..d90a4d3111 100644 --- a/apps/hermes/src/api/rest/latest_price_feeds.rs +++ b/apps/hermes/src/api/rest/latest_price_feeds.rs @@ -50,6 +50,8 @@ pub struct LatestPriceFeedsQueryParams { binary: bool, } +/// **Deprecated: use /v2/updates/price/latest instead** +/// /// Get the latest price updates by price feed id. /// /// Given a collection of price feed ids, retrieve the latest Pyth price for each price feed. @@ -63,6 +65,7 @@ pub struct LatestPriceFeedsQueryParams { LatestPriceFeedsQueryParams ) )] +#[deprecated] pub async fn latest_price_feeds( State(state): State>, QsQuery(params): QsQuery, diff --git a/apps/hermes/src/api/rest/latest_vaas.rs b/apps/hermes/src/api/rest/latest_vaas.rs index d409c0a70a..82c320551d 100644 --- a/apps/hermes/src/api/rest/latest_vaas.rs +++ b/apps/hermes/src/api/rest/latest_vaas.rs @@ -43,6 +43,8 @@ pub struct LatestVaasQueryParams { } +/// **Deprecated: use /v2/updates/price/latest instead** +/// /// Get VAAs for a set of price feed ids. /// /// Given a collection of price feed ids, retrieve the latest VAA for each. The returned VAA(s) can @@ -58,6 +60,7 @@ pub struct LatestVaasQueryParams { (status = 200, description = "VAAs retrieved successfully", body = Vec, example=json!([doc_examples::vaa_example()])) ), )] +#[deprecated] pub async fn latest_vaas( State(state): State>, QsQuery(params): QsQuery, diff --git a/apps/hermes/src/api/rest/price_feed_ids.rs b/apps/hermes/src/api/rest/price_feed_ids.rs index 684a1fa10d..5f767f7837 100644 --- a/apps/hermes/src/api/rest/price_feed_ids.rs +++ b/apps/hermes/src/api/rest/price_feed_ids.rs @@ -14,6 +14,8 @@ use { }, }; +/// **Deprecated: use /v2/price_feeds instead** +/// /// Get the set of price feed IDs. /// /// This endpoint fetches all of the price feed IDs for which price updates can be retrieved. @@ -25,6 +27,7 @@ use { (status = 200, description = "Price feed ids retrieved successfully", body = Vec) ), )] +#[deprecated] pub async fn price_feed_ids( State(state): State>, ) -> Result>, RestError>