Skip to content

Commit ef58504

Browse files
committed
fixed bug in authentication in Binance ctor
- fixes #419
1 parent 676dcd5 commit ef58504

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

ExchangeSharp/API/Exchanges/Binance/ExchangeBinanceAPI.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ private string GetWebSocketStreamUrlForSymbols(string suffix, params string[] ma
6565
return streams.ToString();
6666
}
6767

68-
public ExchangeBinanceAPI()
69-
{
70-
// give binance plenty of room to accept requests
71-
RequestWindow = TimeSpan.FromMinutes(15.0);
72-
NonceStyle = NonceStyle.UnixMilliseconds;
73-
NonceOffset = TimeSpan.FromSeconds(10.0);
74-
MarketSymbolSeparator = string.Empty;
75-
WebSocketOrderBookType = WebSocketOrderBookType.DeltasOnly;
76-
}
77-
78-
public override string ExchangeMarketSymbolToGlobalMarketSymbol(string marketSymbol)
68+
public ExchangeBinanceAPI()
69+
{
70+
// give binance plenty of room to accept requests
71+
RequestWindow = TimeSpan.FromMilliseconds(60000); // 60000 is max value = max request time window of 60 seconds
72+
NonceStyle = NonceStyle.UnixMilliseconds;
73+
NonceOffset = TimeSpan.FromSeconds(15); // 15 seconds are deducted from current UTCTime as base of the request time window
74+
MarketSymbolSeparator = string.Empty;
75+
WebSocketOrderBookType = WebSocketOrderBookType.DeltasOnly;
76+
}
77+
78+
public override string ExchangeMarketSymbolToGlobalMarketSymbol(string marketSymbol)
7979
{
8080
// All pairs in Binance end with BTC, ETH, BNB or USDT
8181
if (marketSymbol.EndsWith("BTC") || marketSymbol.EndsWith("ETH") || marketSymbol.EndsWith("BNB"))

0 commit comments

Comments
 (0)