|
|
@@ -1,7 +1,7 @@
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
use crate::router::{
|
|
|
- Channel, Format, JsonBinaryEncoding, JsonUpdate, PriceFeedId, PriceFeedProperty,
|
|
|
+ Channel, Format, JsonBinaryEncoding, JsonUpdate, PriceFeedId, PriceFeedProperty, TimestampUs,
|
|
|
};
|
|
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
|
@@ -21,6 +21,22 @@ pub struct LatestPriceRequest {
|
|
|
pub channel: Channel,
|
|
|
}
|
|
|
|
|
|
+#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
|
+#[serde(rename_all = "camelCase")]
|
|
|
+pub struct PriceRequest {
|
|
|
+ pub timestamp: TimestampUs,
|
|
|
+ pub price_feed_ids: Vec<PriceFeedId>,
|
|
|
+ pub properties: Vec<PriceFeedProperty>,
|
|
|
+ pub formats: Vec<Format>,
|
|
|
+ #[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)]
|
|
|
#[serde(rename_all = "camelCase")]
|
|
|
pub struct ReducePriceRequest {
|
|
|
@@ -30,6 +46,7 @@ pub struct ReducePriceRequest {
|
|
|
|
|
|
pub type LatestPriceResponse = JsonUpdate;
|
|
|
pub type ReducePriceResponse = JsonUpdate;
|
|
|
+pub type PriceResponse = JsonUpdate;
|
|
|
|
|
|
pub fn default_parsed() -> bool {
|
|
|
true
|