@@ -172,7 +172,7 @@ public async Task<IEnumerable<Candlestick>> GetCandleSticks(string symbol, TimeI
172172 }
173173
174174 var args = $ "symbol={ symbol . ToUpper ( ) } &interval={ interval . GetDescription ( ) } "
175- + ( startTime . HasValue ? $ "&startTime={ startTime . Value . GetUnixTimeStamp ( ) } " : "" )
175+ + ( startTime . HasValue ? $ "&startTime={ startTime . Value . GetUnixTimeStamp ( ) } " : "" )
176176 + ( endTime . HasValue ? $ "&endTime={ endTime . Value . GetUnixTimeStamp ( ) } " : "" )
177177 + $ "&limit={ limit } ";
178178
@@ -193,7 +193,17 @@ public async Task<IEnumerable<PriceChangeInfo>> GetPriceChange24H(string symbol
193193 {
194194 var args = string . IsNullOrWhiteSpace ( symbol ) ? "" : $ "symbol={ symbol . ToUpper ( ) } ";
195195
196- var result = await _apiClient . CallAsync < IEnumerable < PriceChangeInfo > > ( ApiMethod . GET , EndPoints . TickerPriceChange24H , false , args ) ;
196+ var result = new List < PriceChangeInfo > ( ) ;
197+
198+ if ( ! string . IsNullOrEmpty ( symbol ) )
199+ {
200+ var data = await _apiClient . CallAsync < PriceChangeInfo > ( ApiMethod . GET , EndPoints . TickerPriceChange24H , false , args ) ;
201+ result . Add ( data ) ;
202+ }
203+ else
204+ {
205+ result = await _apiClient . CallAsync < List < PriceChangeInfo > > ( ApiMethod . GET , EndPoints . TickerPriceChange24H , false , args ) ;
206+ }
197207
198208 return result ;
199209 }
@@ -233,7 +243,7 @@ public async Task<IEnumerable<OrderBookTicker>> GetOrderBookTicker()
233243 /// <param name="timeInForce">Indicates how long an order will remain active before it is executed or expires.</param>
234244 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
235245 /// <returns></returns>
236- public async Task < NewOrder > PostNewOrder ( string symbol , decimal quantity , decimal price , OrderSide side , OrderType orderType = OrderType . LIMIT , TimeInForce timeInForce = TimeInForce . GTC , decimal icebergQty = 0m , long recvWindow = 6000000 )
246+ public async Task < NewOrder > PostNewOrder ( string symbol , decimal quantity , decimal price , OrderSide side , OrderType orderType = OrderType . LIMIT , TimeInForce timeInForce = TimeInForce . GTC , decimal icebergQty = 0m , long recvWindow = 5000 )
237247 {
238248 //Validates that the order is valid.
239249 ValidateOrderValue ( symbol , orderType , price , quantity , icebergQty ) ;
@@ -259,7 +269,7 @@ public async Task<NewOrder> PostNewOrder(string symbol, decimal quantity, decima
259269 /// <param name="timeInForce">Indicates how long an order will remain active before it is executed or expires.</param>
260270 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
261271 /// <returns></returns>
262- public async Task < dynamic > PostNewOrderTest ( string symbol , decimal quantity , decimal price , OrderSide side , OrderType orderType = OrderType . LIMIT , TimeInForce timeInForce = TimeInForce . GTC , decimal icebergQty = 0m , long recvWindow = 6000000 )
272+ public async Task < dynamic > PostNewOrderTest ( string symbol , decimal quantity , decimal price , OrderSide side , OrderType orderType = OrderType . LIMIT , TimeInForce timeInForce = TimeInForce . GTC , decimal icebergQty = 0m , long recvWindow = 5000 )
263273 {
264274 //Validates that the order is valid.
265275 ValidateOrderValue ( symbol , orderType , price , quantity , icebergQty ) ;
@@ -282,7 +292,7 @@ public async Task<dynamic> PostNewOrderTest(string symbol, decimal quantity, dec
282292 /// <param name="origClientOrderId">origClientOrderId of the order to retrieve.</param>
283293 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
284294 /// <returns></returns>
285- public async Task < Order > GetOrder ( string symbol , long ? orderId = null , string origClientOrderId = null , long recvWindow = 6000000 )
295+ public async Task < Order > GetOrder ( string symbol , long ? orderId = null , string origClientOrderId = null , long recvWindow = 5000 )
286296 {
287297 var args = $ "symbol={ symbol . ToUpper ( ) } &recvWindow={ recvWindow } ";
288298
@@ -317,7 +327,7 @@ public async Task<Order> GetOrder(string symbol, long? orderId = null, string or
317327 /// <param name="origClientOrderId">origClientOrderId of the order to cancel.</param>
318328 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
319329 /// <returns></returns>
320- public async Task < CanceledOrder > CancelOrder ( string symbol , long ? orderId = null , string origClientOrderId = null , long recvWindow = 6000000 )
330+ public async Task < CanceledOrder > CancelOrder ( string symbol , long ? orderId = null , string origClientOrderId = null , long recvWindow = 5000 )
321331 {
322332 if ( string . IsNullOrWhiteSpace ( symbol ) )
323333 {
@@ -350,7 +360,7 @@ public async Task<CanceledOrder> CancelOrder(string symbol, long? orderId = null
350360 /// <param name="symbol">Ticker symbol.</param>
351361 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
352362 /// <returns></returns>
353- public async Task < IEnumerable < Order > > GetCurrentOpenOrders ( string symbol , long recvWindow = 6000000 )
363+ public async Task < IEnumerable < Order > > GetCurrentOpenOrders ( string symbol , long recvWindow = 5000 )
354364 {
355365 if ( string . IsNullOrWhiteSpace ( symbol ) )
356366 {
@@ -370,7 +380,7 @@ public async Task<IEnumerable<Order>> GetCurrentOpenOrders(string symbol, long r
370380 /// <param name="limit">Limit of records to retrieve.</param>
371381 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
372382 /// <returns></returns>
373- public async Task < IEnumerable < Order > > GetAllOrders ( string symbol , long ? orderId = null , int limit = 500 , long recvWindow = 6000000 )
383+ public async Task < IEnumerable < Order > > GetAllOrders ( string symbol , long ? orderId = null , int limit = 500 , long recvWindow = 5000 )
374384 {
375385 if ( string . IsNullOrWhiteSpace ( symbol ) )
376386 {
@@ -387,7 +397,7 @@ public async Task<IEnumerable<Order>> GetAllOrders(string symbol, long? orderId
387397 /// </summary>
388398 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
389399 /// <returns></returns>
390- public async Task < AccountInfo > GetAccountInfo ( long recvWindow = 6000000 )
400+ public async Task < AccountInfo > GetAccountInfo ( long recvWindow = 5000 )
391401 {
392402 var result = await _apiClient . CallAsync < AccountInfo > ( ApiMethod . GET , EndPoints . AccountInformation , true , $ "recvWindow={ recvWindow } ") ;
393403
@@ -400,7 +410,7 @@ public async Task<AccountInfo> GetAccountInfo(long recvWindow = 6000000)
400410 /// <param name="symbol">Ticker symbol.</param>
401411 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
402412 /// <returns></returns>
403- public async Task < IEnumerable < Trade > > GetTradeList ( string symbol , long recvWindow = 6000000 )
413+ public async Task < IEnumerable < Trade > > GetTradeList ( string symbol , long recvWindow = 5000 )
404414 {
405415 if ( string . IsNullOrWhiteSpace ( symbol ) )
406416 {
@@ -421,7 +431,7 @@ public async Task<IEnumerable<Trade>> GetTradeList(string symbol, long recvWindo
421431 /// <param name="addressName">Address name.</param>
422432 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
423433 /// <returns></returns>
424- public async Task < WithdrawResponse > Withdraw ( string asset , decimal amount , string address , string addressName = "" , long recvWindow = 6000000 )
434+ public async Task < WithdrawResponse > Withdraw ( string asset , decimal amount , string address , string addressName = "" , long recvWindow = 5000 )
425435 {
426436 if ( string . IsNullOrWhiteSpace ( asset ) )
427437 {
@@ -454,7 +464,7 @@ public async Task<WithdrawResponse> Withdraw(string asset, decimal amount, strin
454464 /// <param name="endTime">End time.</param>
455465 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
456466 /// <returns></returns>
457- public async Task < DepositHistory > GetDepositHistory ( string asset , DepositStatus ? status = null , DateTime ? startTime = null , DateTime ? endTime = null , long recvWindow = 6000000 )
467+ public async Task < DepositHistory > GetDepositHistory ( string asset , DepositStatus ? status = null , DateTime ? startTime = null , DateTime ? endTime = null , long recvWindow = 5000 )
458468 {
459469 if ( string . IsNullOrWhiteSpace ( asset ) )
460470 {
@@ -481,7 +491,7 @@ public async Task<DepositHistory> GetDepositHistory(string asset, DepositStatus?
481491 /// <param name="endTime">End time.</param>
482492 /// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
483493 /// <returns></returns>
484- public async Task < WithdrawHistory > GetWithdrawHistory ( string asset , WithdrawStatus ? status = null , DateTime ? startTime = null , DateTime ? endTime = null , long recvWindow = 6000000 )
494+ public async Task < WithdrawHistory > GetWithdrawHistory ( string asset , WithdrawStatus ? status = null , DateTime ? startTime = null , DateTime ? endTime = null , long recvWindow = 5000 )
485495 {
486496 if ( string . IsNullOrWhiteSpace ( asset ) )
487497 {
@@ -612,7 +622,6 @@ public string ListenUserDataEndpoint(ApiClientAbstract.MessageHandler<AccountUpd
612622
613623 return listenKey ;
614624 }
615-
616625 #endregion
617626 }
618627}
0 commit comments