From 0597b12358d7ae48fbf6dcb95c0244c7a90cf370 Mon Sep 17 00:00:00 2001 From: megdevs Date: Tue, 19 Dec 2023 14:10:44 +0000 Subject: [PATCH 1/2] return prices in a stream rather than a stream of arrays --- proto/valorem/trade/v1/spot.proto | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proto/valorem/trade/v1/spot.proto b/proto/valorem/trade/v1/spot.proto index f65df77..0b57ca6 100644 --- a/proto/valorem/trade/v1/spot.proto +++ b/proto/valorem/trade/v1/spot.proto @@ -34,9 +34,9 @@ message SpotPriceRequest { // SpotPriceResponse provides the fetched spot prices for the tokens specified in the request. message SpotPriceResponse { - // spot_price_info holds the data about the fetched spot prices for each of the - // tokens specified in the request. - repeated SpotPriceInfo spot_price_info = 1; + // spot_price_info holds the data about the fetched spot prices for the tokens specified in the request. The price for + // each token is sent down the stream as and when it is ready. + SpotPriceInfo spot_price_info = 1; } // SpotPriceInfo represents the details and the spot price (if available) for a single token From 01f010f2d3e3d0a6fed00bf6ec17728774df2a83 Mon Sep 17 00:00:00 2001 From: megdevs Date: Tue, 19 Dec 2023 16:37:04 +0000 Subject: [PATCH 2/2] no need to wrap in response struct --- proto/valorem/trade/v1/spot.proto | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/proto/valorem/trade/v1/spot.proto b/proto/valorem/trade/v1/spot.proto index 0b57ca6..d6b72d6 100644 --- a/proto/valorem/trade/v1/spot.proto +++ b/proto/valorem/trade/v1/spot.proto @@ -19,7 +19,7 @@ service Spot { // stream of SpotPriceResponse: Continuously streams data about the spot prices // of the requested tokens on their respective chains // as updates are available. - rpc GetSpotPrice (SpotPriceRequest) returns (stream SpotPriceResponse); + rpc GetSpotPrice (SpotPriceRequest) returns (stream SpotPriceInfo); } // SpotPriceRequest encapsulates the details of the tokens for which @@ -31,14 +31,6 @@ message SpotPriceRequest { repeated SpotPriceInfo spot_price_info = 1; } -// SpotPriceResponse provides the fetched spot prices for the tokens specified in the request. -message SpotPriceResponse { - - // spot_price_info holds the data about the fetched spot prices for the tokens specified in the request. The price for - // each token is sent down the stream as and when it is ready. - SpotPriceInfo spot_price_info = 1; -} - // SpotPriceInfo represents the details and the spot price (if available) for a single token // on a particular blockchain. message SpotPriceInfo {