diff --git a/lazer/sdk/rust/protocol/src/api.rs b/lazer/sdk/rust/protocol/src/api.rs index c1488b3877..082a02391f 100644 --- a/lazer/sdk/rust/protocol/src/api.rs +++ b/lazer/sdk/rust/protocol/src/api.rs @@ -1,18 +1,20 @@ use serde::{Deserialize, Serialize}; -use crate::{payload::AggregatedPriceFeedData, router::PriceFeedId}; +use crate::{ + payload::AggregatedPriceFeedData, + router::{JsonUpdate, PriceFeedId}, +}; -/// A request sent from the client to the server. #[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(tag = "type")] #[serde(rename_all = "camelCase")] -pub enum ApiRequest { - LatestPrice(LatestPriceRequest), +pub struct LatestPriceRequest { + pub price_feed_ids: Vec, } #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct LatestPriceRequest { +pub struct ReducePriceRequest { + pub payload: JsonUpdate, pub price_feed_ids: Vec, } @@ -22,6 +24,12 @@ pub struct LatestPriceResponse { pub latest_prices: Vec, } +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct ReducePriceResponse { + pub payload: JsonUpdate, +} + #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct LatestPrice {