1
1
use serde:: { Deserialize , Serialize } ;
2
2
3
- use crate :: {
4
- payload:: AggregatedPriceFeedData ,
5
- router:: { JsonUpdate , PriceFeedId } ,
3
+ use crate :: router:: {
4
+ Chain , Channel , JsonBinaryEncoding , JsonUpdate , PriceFeedId , PriceFeedProperty ,
6
5
} ;
7
6
8
7
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
9
8
#[ serde( rename_all = "camelCase" ) ]
10
9
pub struct LatestPriceRequest {
11
10
pub price_feed_ids : Vec < PriceFeedId > ,
11
+ pub properties : Vec < PriceFeedProperty > ,
12
+ pub chains : Vec < Chain > ,
13
+ #[ serde( default ) ]
14
+ pub json_binary_encoding : JsonBinaryEncoding ,
15
+ /// If `true`, the stream update will contain a JSON object containing
16
+ /// all data of the update.
17
+ #[ serde( default = "default_parsed" ) ]
18
+ pub parsed : bool ,
19
+ pub channel : Channel ,
12
20
}
13
21
14
22
#[ derive( Debug , Clone , Serialize , Deserialize ) ]
@@ -18,22 +26,9 @@ pub struct ReducePriceRequest {
18
26
pub price_feed_ids : Vec < PriceFeedId > ,
19
27
}
20
28
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
- }
29
+ pub type LatestPriceResponse = JsonUpdate ;
30
+ pub type ReducePriceResponse = JsonUpdate ;
32
31
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 ,
32
+ pub fn default_parsed ( ) -> bool {
33
+ true
39
34
}
0 commit comments