[hermes] Add deprecation notices to old API methods (#1516)

* [hermes] Add deprecation notices for doc purposes

* bump version

* deprecation
This commit is contained in:
Jayant Krishnamurthy 2024-04-29 05:26:41 -07:00 committed by GitHub
parent 050a3412f9
commit 6da2e1ba53
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 21 additions and 2 deletions

View File

@ -1796,7 +1796,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hermes"
version = "0.5.8"
version = "0.5.9"
dependencies = [
"anyhow",
"async-trait",

View File

@ -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"

View File

@ -124,6 +124,7 @@ pub async fn run(opts: RunOptions, state: ApiState) -> Result<()> {
// Initialize Axum Router. Note the type here is a `Router<State>` 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))

View File

@ -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<S>(
State(state): State<ApiState<S>>,
QsQuery(params): QsQuery<GetPriceFeedQueryParams>,

View File

@ -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<S>(
State(state): State<ApiState<S>>,
QsQuery(params): QsQuery<GetVaaQueryParams>,

View File

@ -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<S>(
State(state): State<ApiState<S>>,
QsQuery(params): QsQuery<GetVaaCcipQueryParams>,

View File

@ -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<S>(
State(state): State<ApiState<S>>,
QsQuery(params): QsQuery<LatestPriceFeedsQueryParams>,

View File

@ -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<String>, example=json!([doc_examples::vaa_example()]))
),
)]
#[deprecated]
pub async fn latest_vaas<S>(
State(state): State<ApiState<S>>,
QsQuery(params): QsQuery<LatestVaasQueryParams>,

View File

@ -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<RpcPriceIdentifier>)
),
)]
#[deprecated]
pub async fn price_feed_ids<S>(
State(state): State<ApiState<S>>,
) -> Result<Json<Vec<RpcPriceIdentifier>>, RestError>