11use serde:: { Deserialize , Serialize } ;
22
3- use crate :: { payload:: AggregatedPriceFeedData , router:: PriceFeedId } ;
3+ use crate :: {
4+ payload:: AggregatedPriceFeedData ,
5+ router:: { JsonUpdate , PriceFeedId } ,
6+ } ;
47
5- /// A request sent from the client to the server.
68#[ derive( Debug , Clone , Serialize , Deserialize ) ]
7- #[ serde( tag = "type" ) ]
89#[ serde( rename_all = "camelCase" ) ]
9- pub enum ApiRequest {
10- LatestPrice ( LatestPriceRequest ) ,
10+ pub struct LatestPriceRequest {
11+ pub price_feed_ids : Vec < PriceFeedId > ,
1112}
1213
1314#[ derive( Debug , Clone , Serialize , Deserialize ) ]
1415#[ serde( rename_all = "camelCase" ) ]
15- pub struct LatestPriceRequest {
16+ pub struct ReducePriceRequest {
17+ pub payload : JsonUpdate ,
1618 pub price_feed_ids : Vec < PriceFeedId > ,
1719}
1820
@@ -22,6 +24,12 @@ pub struct LatestPriceResponse {
2224 pub latest_prices : Vec < LatestPrice > ,
2325}
2426
27+ #[ derive( Debug , Clone , Serialize , Deserialize ) ]
28+ #[ serde( rename_all = "camelCase" ) ]
29+ pub struct ReducePriceResponse {
30+ pub payload : JsonUpdate ,
31+ }
32+
2533#[ derive( Debug , Clone , Serialize , Deserialize ) ]
2634#[ serde( rename_all = "camelCase" ) ]
2735pub struct LatestPrice {
0 commit comments