|
|
@@ -1,14 +1,22 @@
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
-use crate::{
|
|
|
- payload::AggregatedPriceFeedData,
|
|
|
- router::{JsonUpdate, PriceFeedId},
|
|
|
+use crate::router::{
|
|
|
+ Chain, Channel, JsonBinaryEncoding, JsonUpdate, PriceFeedId, PriceFeedProperty,
|
|
|
};
|
|
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
pub struct LatestPriceRequest {
|
|
|
pub price_feed_ids: Vec<PriceFeedId>,
|
|
|
+ pub properties: Vec<PriceFeedProperty>,
|
|
|
+ pub chains: Vec<Chain>,
|
|
|
+ #[serde(default)]
|
|
|
+ pub json_binary_encoding: JsonBinaryEncoding,
|
|
|
+ /// If `true`, the stream update will contain a JSON object containing
|
|
|
+ /// all data of the update.
|
|
|
+ #[serde(default = "default_parsed")]
|
|
|
+ pub parsed: bool,
|
|
|
+ pub channel: Channel,
|
|
|
}
|
|
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
|
@@ -18,22 +26,9 @@ pub struct ReducePriceRequest {
|
|
|
pub price_feed_ids: Vec<PriceFeedId>,
|
|
|
}
|
|
|
|
|
|
-#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
|
-#[serde(rename_all = "camelCase")]
|
|
|
-pub struct LatestPriceResponse {
|
|
|
- pub latest_prices: Vec<LatestPrice>,
|
|
|
-}
|
|
|
-
|
|
|
-#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
|
-#[serde(rename_all = "camelCase")]
|
|
|
-pub struct ReducePriceResponse {
|
|
|
- pub payload: JsonUpdate,
|
|
|
-}
|
|
|
+pub type LatestPriceResponse = JsonUpdate;
|
|
|
+pub type ReducePriceResponse = JsonUpdate;
|
|
|
|
|
|
-#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
|
-#[serde(rename_all = "camelCase")]
|
|
|
-pub struct LatestPrice {
|
|
|
- pub id: PriceFeedId,
|
|
|
- pub exponent: i16,
|
|
|
- pub prices: AggregatedPriceFeedData,
|
|
|
+pub fn default_parsed() -> bool {
|
|
|
+ true
|
|
|
}
|