11use serde:: { Deserialize , Serialize } ;
22
3- use crate :: {
4- payload:: AggregatedPriceFeedData ,
5- router:: { JsonUpdate , PriceFeedId } ,
6- } ;
3+ use crate :: router:: { Chain , Channel , JsonUpdate , PriceFeedId , PriceFeedProperty } ;
74
85#[ derive( Debug , Clone , Serialize , Deserialize ) ]
96#[ serde( rename_all = "camelCase" ) ]
107pub struct LatestPriceRequest {
118 pub price_feed_ids : Vec < PriceFeedId > ,
9+ pub properties : Vec < PriceFeedProperty > ,
10+ pub chains : Vec < Chain > ,
11+ /// If `true`, the stream update will contain a JSON object containing
12+ /// all data of the update.
13+ #[ serde( default = "default_parsed" ) ]
14+ pub parsed : bool ,
15+ pub channel : Channel ,
1216}
1317
1418#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -18,22 +22,9 @@ pub struct ReducePriceRequest {
1822 pub price_feed_ids : Vec < PriceFeedId > ,
1923}
2024
21- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
22- #[ serde( rename_all = "camelCase" ) ]
23- pub struct LatestPriceResponse {
24- pub latest_prices : Vec < LatestPrice > ,
25- }
26-
27- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
28- #[ serde( rename_all = "camelCase" ) ]
29- pub struct ReducePriceResponse {
30- pub payload : JsonUpdate ,
31- }
25+ pub type LatestPriceResponse = JsonUpdate ;
26+ pub type ReducePriceResponse = JsonUpdate ;
3227
33- #[ derive( Debug , Clone , Serialize , Deserialize ) ]
34- #[ serde( rename_all = "camelCase" ) ]
35- pub struct LatestPrice {
36- pub id : PriceFeedId ,
37- pub exponent : i16 ,
38- pub prices : AggregatedPriceFeedData ,
28+ pub fn default_parsed ( ) -> bool {
29+ true
3930}
0 commit comments