[hermes] Add deprecation notices to old API methods (#1516)
* [hermes] Add deprecation notices for doc purposes * bump version * deprecation
This commit is contained in:
parent
050a3412f9
commit
6da2e1ba53
|
@ -1796,7 +1796,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hermes"
|
name = "hermes"
|
||||||
version = "0.5.8"
|
version = "0.5.9"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "hermes"
|
name = "hermes"
|
||||||
version = "0.5.8"
|
version = "0.5.9"
|
||||||
description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle."
|
description = "Hermes is an agent that provides Verified Prices from the Pythnet Pyth Oracle."
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
|
|
@ -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
|
// 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.
|
// `with_state` method which replaces `Body` with `State` in the type signature.
|
||||||
let app = Router::new();
|
let app = Router::new();
|
||||||
|
#[allow(deprecated)]
|
||||||
let app = app
|
let app = app
|
||||||
.merge(SwaggerUi::new("/docs").url("/docs/openapi.json", ApiDoc::openapi()))
|
.merge(SwaggerUi::new("/docs").url("/docs/openapi.json", ApiDoc::openapi()))
|
||||||
.route("/", get(rest::index))
|
.route("/", get(rest::index))
|
||||||
|
|
|
@ -49,6 +49,8 @@ pub struct GetPriceFeedQueryParams {
|
||||||
binary: bool,
|
binary: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// **Deprecated: use /v2/updates/price/{publish_time} instead**
|
||||||
|
///
|
||||||
/// Get a price update for a price feed with a specific timestamp
|
/// 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.
|
/// Given a price feed id and timestamp, retrieve the Pyth price update closest to that timestamp.
|
||||||
|
@ -62,6 +64,7 @@ pub struct GetPriceFeedQueryParams {
|
||||||
GetPriceFeedQueryParams
|
GetPriceFeedQueryParams
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
#[deprecated]
|
||||||
pub async fn get_price_feed<S>(
|
pub async fn get_price_feed<S>(
|
||||||
State(state): State<ApiState<S>>,
|
State(state): State<ApiState<S>>,
|
||||||
QsQuery(params): QsQuery<GetPriceFeedQueryParams>,
|
QsQuery(params): QsQuery<GetPriceFeedQueryParams>,
|
||||||
|
|
|
@ -55,6 +55,8 @@ pub struct GetVaaResponse {
|
||||||
publish_time: UnixTimestamp,
|
publish_time: UnixTimestamp,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// **Deprecated: use /v2/updates/price/{publish_time} instead**
|
||||||
|
///
|
||||||
/// Get a VAA for a price feed with a specific timestamp
|
/// 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.
|
/// Given a price feed id and timestamp, retrieve the Pyth price update closest to that timestamp.
|
||||||
|
@ -69,6 +71,7 @@ pub struct GetVaaResponse {
|
||||||
GetVaaQueryParams
|
GetVaaQueryParams
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
#[deprecated]
|
||||||
pub async fn get_vaa<S>(
|
pub async fn get_vaa<S>(
|
||||||
State(state): State<ApiState<S>>,
|
State(state): State<ApiState<S>>,
|
||||||
QsQuery(params): QsQuery<GetVaaQueryParams>,
|
QsQuery(params): QsQuery<GetVaaQueryParams>,
|
||||||
|
|
|
@ -46,6 +46,8 @@ pub struct GetVaaCcipResponse {
|
||||||
data: String, // TODO: Use a typed wrapper for the hex output with leading 0x.
|
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
|
/// 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:
|
/// 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
|
GetVaaCcipQueryParams
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
#[deprecated]
|
||||||
pub async fn get_vaa_ccip<S>(
|
pub async fn get_vaa_ccip<S>(
|
||||||
State(state): State<ApiState<S>>,
|
State(state): State<ApiState<S>>,
|
||||||
QsQuery(params): QsQuery<GetVaaCcipQueryParams>,
|
QsQuery(params): QsQuery<GetVaaCcipQueryParams>,
|
||||||
|
|
|
@ -50,6 +50,8 @@ pub struct LatestPriceFeedsQueryParams {
|
||||||
binary: bool,
|
binary: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// **Deprecated: use /v2/updates/price/latest instead**
|
||||||
|
///
|
||||||
/// Get the latest price updates by price feed id.
|
/// 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.
|
/// Given a collection of price feed ids, retrieve the latest Pyth price for each price feed.
|
||||||
|
@ -63,6 +65,7 @@ pub struct LatestPriceFeedsQueryParams {
|
||||||
LatestPriceFeedsQueryParams
|
LatestPriceFeedsQueryParams
|
||||||
)
|
)
|
||||||
)]
|
)]
|
||||||
|
#[deprecated]
|
||||||
pub async fn latest_price_feeds<S>(
|
pub async fn latest_price_feeds<S>(
|
||||||
State(state): State<ApiState<S>>,
|
State(state): State<ApiState<S>>,
|
||||||
QsQuery(params): QsQuery<LatestPriceFeedsQueryParams>,
|
QsQuery(params): QsQuery<LatestPriceFeedsQueryParams>,
|
||||||
|
|
|
@ -43,6 +43,8 @@ pub struct LatestVaasQueryParams {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// **Deprecated: use /v2/updates/price/latest instead**
|
||||||
|
///
|
||||||
/// Get VAAs for a set of price feed ids.
|
/// 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
|
/// 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()]))
|
(status = 200, description = "VAAs retrieved successfully", body = Vec<String>, example=json!([doc_examples::vaa_example()]))
|
||||||
),
|
),
|
||||||
)]
|
)]
|
||||||
|
#[deprecated]
|
||||||
pub async fn latest_vaas<S>(
|
pub async fn latest_vaas<S>(
|
||||||
State(state): State<ApiState<S>>,
|
State(state): State<ApiState<S>>,
|
||||||
QsQuery(params): QsQuery<LatestVaasQueryParams>,
|
QsQuery(params): QsQuery<LatestVaasQueryParams>,
|
||||||
|
|
|
@ -14,6 +14,8 @@ use {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// **Deprecated: use /v2/price_feeds instead**
|
||||||
|
///
|
||||||
/// Get the set of price feed IDs.
|
/// Get the set of price feed IDs.
|
||||||
///
|
///
|
||||||
/// This endpoint fetches all of the price feed IDs for which price updates can be retrieved.
|
/// 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>)
|
(status = 200, description = "Price feed ids retrieved successfully", body = Vec<RpcPriceIdentifier>)
|
||||||
),
|
),
|
||||||
)]
|
)]
|
||||||
|
#[deprecated]
|
||||||
pub async fn price_feed_ids<S>(
|
pub async fn price_feed_ids<S>(
|
||||||
State(state): State<ApiState<S>>,
|
State(state): State<ApiState<S>>,
|
||||||
) -> Result<Json<Vec<RpcPriceIdentifier>>, RestError>
|
) -> Result<Json<Vec<RpcPriceIdentifier>>, RestError>
|
||||||
|
|
Loading…
Reference in New Issue