Skip to content

Commit 6da2e1b

Browse files
authored
[hermes] Add deprecation notices to old API methods (#1516)
* [hermes] Add deprecation notices for doc purposes * bump version * deprecation
1 parent 050a341 commit 6da2e1b

File tree

9 files changed

+21
-2
lines changed

9 files changed

+21
-2
lines changed

apps/hermes/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/hermes/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hermes"
3-
version = "0.5.8"
3+
version = "0.5.9"
44
description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle."
55
edition = "2021"
66

apps/hermes/src/api.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ pub async fn run(opts: RunOptions, state: ApiState) -> Result<()> {
124124
// Initialize Axum Router. Note the type here is a `Router<State>` due to the use of the
125125
// `with_state` method which replaces `Body` with `State` in the type signature.
126126
let app = Router::new();
127+
#[allow(deprecated)]
127128
let app = app
128129
.merge(SwaggerUi::new("/docs").url("/docs/openapi.json", ApiDoc::openapi()))
129130
.route("/", get(rest::index))

apps/hermes/src/api/rest/get_price_feed.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ pub struct GetPriceFeedQueryParams {
4949
binary: bool,
5050
}
5151

52+
/// **Deprecated: use /v2/updates/price/{publish_time} instead**
53+
///
5254
/// Get a price update for a price feed with a specific timestamp
5355
///
5456
/// Given a price feed id and timestamp, retrieve the Pyth price update closest to that timestamp.
@@ -62,6 +64,7 @@ pub struct GetPriceFeedQueryParams {
6264
GetPriceFeedQueryParams
6365
)
6466
)]
67+
#[deprecated]
6568
pub async fn get_price_feed<S>(
6669
State(state): State<ApiState<S>>,
6770
QsQuery(params): QsQuery<GetPriceFeedQueryParams>,

apps/hermes/src/api/rest/get_vaa.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ pub struct GetVaaResponse {
5555
publish_time: UnixTimestamp,
5656
}
5757

58+
/// **Deprecated: use /v2/updates/price/{publish_time} instead**
59+
///
5860
/// Get a VAA for a price feed with a specific timestamp
5961
///
6062
/// Given a price feed id and timestamp, retrieve the Pyth price update closest to that timestamp.
@@ -69,6 +71,7 @@ pub struct GetVaaResponse {
6971
GetVaaQueryParams
7072
)
7173
)]
74+
#[deprecated]
7275
pub async fn get_vaa<S>(
7376
State(state): State<ApiState<S>>,
7477
QsQuery(params): QsQuery<GetVaaQueryParams>,

apps/hermes/src/api/rest/get_vaa_ccip.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ pub struct GetVaaCcipResponse {
4646
data: String, // TODO: Use a typed wrapper for the hex output with leading 0x.
4747
}
4848

49+
/// **Deprecated: use /v2/updates/price/{publish_time} instead**
50+
///
4951
/// Get a VAA for a price feed using CCIP
5052
///
5153
/// This endpoint accepts a single argument which is a hex-encoded byte string of the following form:
@@ -60,6 +62,7 @@ pub struct GetVaaCcipResponse {
6062
GetVaaCcipQueryParams
6163
)
6264
)]
65+
#[deprecated]
6366
pub async fn get_vaa_ccip<S>(
6467
State(state): State<ApiState<S>>,
6568
QsQuery(params): QsQuery<GetVaaCcipQueryParams>,

apps/hermes/src/api/rest/latest_price_feeds.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ pub struct LatestPriceFeedsQueryParams {
5050
binary: bool,
5151
}
5252

53+
/// **Deprecated: use /v2/updates/price/latest instead**
54+
///
5355
/// Get the latest price updates by price feed id.
5456
///
5557
/// Given a collection of price feed ids, retrieve the latest Pyth price for each price feed.
@@ -63,6 +65,7 @@ pub struct LatestPriceFeedsQueryParams {
6365
LatestPriceFeedsQueryParams
6466
)
6567
)]
68+
#[deprecated]
6669
pub async fn latest_price_feeds<S>(
6770
State(state): State<ApiState<S>>,
6871
QsQuery(params): QsQuery<LatestPriceFeedsQueryParams>,

apps/hermes/src/api/rest/latest_vaas.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ pub struct LatestVaasQueryParams {
4343
}
4444

4545

46+
/// **Deprecated: use /v2/updates/price/latest instead**
47+
///
4648
/// Get VAAs for a set of price feed ids.
4749
///
4850
/// 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 {
5860
(status = 200, description = "VAAs retrieved successfully", body = Vec<String>, example=json!([doc_examples::vaa_example()]))
5961
),
6062
)]
63+
#[deprecated]
6164
pub async fn latest_vaas<S>(
6265
State(state): State<ApiState<S>>,
6366
QsQuery(params): QsQuery<LatestVaasQueryParams>,

apps/hermes/src/api/rest/price_feed_ids.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ use {
1414
},
1515
};
1616

17+
/// **Deprecated: use /v2/price_feeds instead**
18+
///
1719
/// Get the set of price feed IDs.
1820
///
1921
/// This endpoint fetches all of the price feed IDs for which price updates can be retrieved.
@@ -25,6 +27,7 @@ use {
2527
(status = 200, description = "Price feed ids retrieved successfully", body = Vec<RpcPriceIdentifier>)
2628
),
2729
)]
30+
#[deprecated]
2831
pub async fn price_feed_ids<S>(
2932
State(state): State<ApiState<S>>,
3033
) -> Result<Json<Vec<RpcPriceIdentifier>>, RestError>

0 commit comments

Comments
 (0)