@@ -172,7 +172,7 @@ public async Task<IEnumerable<Candlestick>> GetCandleSticks(string symbol, TimeI
172
172
}
173
173
174
174
var args = $ "symbol={ symbol . ToUpper ( ) } &interval={ interval . GetDescription ( ) } "
175
- + ( startTime . HasValue ? $ "&startTime={ startTime . Value . GetUnixTimeStamp ( ) } " : "" )
175
+ + ( startTime . HasValue ? $ "&startTime={ startTime . Value . GetUnixTimeStamp ( ) } " : "" )
176
176
+ ( endTime . HasValue ? $ "&endTime={ endTime . Value . GetUnixTimeStamp ( ) } " : "" )
177
177
+ $ "&limit={ limit } ";
178
178
@@ -193,7 +193,17 @@ public async Task<IEnumerable<PriceChangeInfo>> GetPriceChange24H(string symbol
193
193
{
194
194
var args = string . IsNullOrWhiteSpace ( symbol ) ? "" : $ "symbol={ symbol . ToUpper ( ) } ";
195
195
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
+ }
197
207
198
208
return result ;
199
209
}
@@ -233,7 +243,7 @@ public async Task<IEnumerable<OrderBookTicker>> GetOrderBookTicker()
233
243
/// <param name="timeInForce">Indicates how long an order will remain active before it is executed or expires.</param>
234
244
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
235
245
/// <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 )
237
247
{
238
248
//Validates that the order is valid.
239
249
ValidateOrderValue ( symbol , orderType , price , quantity , icebergQty ) ;
@@ -259,7 +269,7 @@ public async Task<NewOrder> PostNewOrder(string symbol, decimal quantity, decima
259
269
/// <param name="timeInForce">Indicates how long an order will remain active before it is executed or expires.</param>
260
270
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
261
271
/// <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 )
263
273
{
264
274
//Validates that the order is valid.
265
275
ValidateOrderValue ( symbol , orderType , price , quantity , icebergQty ) ;
@@ -282,7 +292,7 @@ public async Task<dynamic> PostNewOrderTest(string symbol, decimal quantity, dec
282
292
/// <param name="origClientOrderId">origClientOrderId of the order to retrieve.</param>
283
293
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
284
294
/// <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 )
286
296
{
287
297
var args = $ "symbol={ symbol . ToUpper ( ) } &recvWindow={ recvWindow } ";
288
298
@@ -317,7 +327,7 @@ public async Task<Order> GetOrder(string symbol, long? orderId = null, string or
317
327
/// <param name="origClientOrderId">origClientOrderId of the order to cancel.</param>
318
328
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
319
329
/// <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 )
321
331
{
322
332
if ( string . IsNullOrWhiteSpace ( symbol ) )
323
333
{
@@ -350,7 +360,7 @@ public async Task<CanceledOrder> CancelOrder(string symbol, long? orderId = null
350
360
/// <param name="symbol">Ticker symbol.</param>
351
361
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
352
362
/// <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 )
354
364
{
355
365
if ( string . IsNullOrWhiteSpace ( symbol ) )
356
366
{
@@ -370,7 +380,7 @@ public async Task<IEnumerable<Order>> GetCurrentOpenOrders(string symbol, long r
370
380
/// <param name="limit">Limit of records to retrieve.</param>
371
381
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
372
382
/// <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 )
374
384
{
375
385
if ( string . IsNullOrWhiteSpace ( symbol ) )
376
386
{
@@ -387,7 +397,7 @@ public async Task<IEnumerable<Order>> GetAllOrders(string symbol, long? orderId
387
397
/// </summary>
388
398
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
389
399
/// <returns></returns>
390
- public async Task < AccountInfo > GetAccountInfo ( long recvWindow = 6000000 )
400
+ public async Task < AccountInfo > GetAccountInfo ( long recvWindow = 5000 )
391
401
{
392
402
var result = await _apiClient . CallAsync < AccountInfo > ( ApiMethod . GET , EndPoints . AccountInformation , true , $ "recvWindow={ recvWindow } ") ;
393
403
@@ -400,7 +410,7 @@ public async Task<AccountInfo> GetAccountInfo(long recvWindow = 6000000)
400
410
/// <param name="symbol">Ticker symbol.</param>
401
411
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
402
412
/// <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 )
404
414
{
405
415
if ( string . IsNullOrWhiteSpace ( symbol ) )
406
416
{
@@ -421,7 +431,7 @@ public async Task<IEnumerable<Trade>> GetTradeList(string symbol, long recvWindo
421
431
/// <param name="addressName">Address name.</param>
422
432
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
423
433
/// <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 )
425
435
{
426
436
if ( string . IsNullOrWhiteSpace ( asset ) )
427
437
{
@@ -454,7 +464,7 @@ public async Task<WithdrawResponse> Withdraw(string asset, decimal amount, strin
454
464
/// <param name="endTime">End time.</param>
455
465
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
456
466
/// <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 )
458
468
{
459
469
if ( string . IsNullOrWhiteSpace ( asset ) )
460
470
{
@@ -481,7 +491,7 @@ public async Task<DepositHistory> GetDepositHistory(string asset, DepositStatus?
481
491
/// <param name="endTime">End time.</param>
482
492
/// <param name="recvWindow">Specific number of milliseconds the request is valid for.</param>
483
493
/// <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 )
485
495
{
486
496
if ( string . IsNullOrWhiteSpace ( asset ) )
487
497
{
@@ -612,7 +622,6 @@ public string ListenUserDataEndpoint(ApiClientAbstract.MessageHandler<AccountUpd
612
622
613
623
return listenKey ;
614
624
}
615
-
616
625
#endregion
617
626
}
618
627
}
0 commit comments