Skip to content

Commit 5c18ce9

Browse files
committed
Set Symbol on spot and usd futures ExchangeData.GetOrderBookAsync response
1 parent 1de6cb5 commit 5c18ce9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Binance.Net/Clients/SpotApi/BinanceSocketClientSpotApiExchangeData.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,10 @@ public async Task<CallResult<BinanceResponse<BinanceOrderBook>>> GetOrderBookAsy
8585
parameters.AddParameter("symbol", symbol);
8686
parameters.AddOptionalParameter("limit", limit);
8787
int weight = limit <= 100 ? 5 : limit <= 500 ? 25 : limit <= 1000 ? 50 : 250;
88-
return await _client.QueryAsync<BinanceOrderBook>(_client.ClientOptions.Environment.SpotSocketApiAddress.AppendPath("ws-api/v3"), $"depth", parameters, weight: weight, ct: ct).ConfigureAwait(false);
88+
var result = await _client.QueryAsync<BinanceOrderBook>(_client.ClientOptions.Environment.SpotSocketApiAddress.AppendPath("ws-api/v3"), $"depth", parameters, weight: weight, ct: ct).ConfigureAwait(false);
89+
if (result)
90+
result.Data.Result.Symbol = symbol;
91+
return result;
8992
}
9093

9194
#endregion

Binance.Net/Clients/UsdFuturesApi/BinanceSocketClientUsdFuturesApiExchangeData.cs

+4-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ public async Task<CallResult<BinanceResponse<BinanceFuturesOrderBook>>> GetOrder
5555
parameters.AddParameter("symbol", symbol);
5656
parameters.AddOptionalParameter("limit", limit);
5757
int weight = limit <= 50 ? 2 : limit <= 100 ? 5 : limit <= 500 ? 10 : 20;
58-
return await _client.QueryAsync<BinanceFuturesOrderBook>(_client.ClientOptions.Environment.UsdFuturesSocketApiAddress!.AppendPath("ws-fapi/v1"), $"depth", parameters, weight: weight, ct: ct).ConfigureAwait(false);
58+
var result = await _client.QueryAsync<BinanceFuturesOrderBook>(_client.ClientOptions.Environment.UsdFuturesSocketApiAddress!.AppendPath("ws-fapi/v1"), $"depth", parameters, weight: weight, ct: ct).ConfigureAwait(false);
59+
if (result)
60+
result.Data.Result.Symbol = symbol;
61+
return result;
5962
}
6063

6164
#endregion

0 commit comments

Comments
 (0)