/// <summary> /// Connect to the Combined Depth WebSocket /// </summary> /// <param name="symbols"></param> /// <param name="messageEventHandler"></param> /// <returns></returns> public Guid ConnectToDepthWebSocketCombined(string symbols, BinanceWebSocketMessageHandler <BinanceCombinedDepthData> messageEventHandler) { Guard.AgainstNullOrEmpty(symbols, nameof(symbols)); symbols = PrepareCombinedSymbols.CombinedDepth(symbols); Logger.Debug("Connecting to Combined Depth Web Socket"); var endpoint = new Uri($"{CombinedWebsocketUri}={symbols}"); return(CreateBinanceWebSocket(endpoint, messageEventHandler)); }
/// <summary> /// Connect to the Trades WebSocket /// </summary> /// <param name="symbol"></param> /// <param name="messageEventHandler"></param> /// <returns></returns>https://github.com/glitch100/BinanceDotNet/issues public Guid ConnectToDeptAndTradesWebSocketCombined(List <string> symbols, OnMessageReceived messageEventHandler) { var chanels = PrepareCombinedSymbols.CombinedDepthAndTrade(symbols); Logger.Debug("Connecting to Combined Trades Web Socket"); var endpoint = new Uri($"{CombinedWebsocketUri}/{chanels}"); return(CreateBinanceWebSocket(endpoint, messageEventHandler)); }
/// <summary> /// Connect to the Combined Partial Depth WebSocket /// </summary> /// <param name="symbols"></param> /// <param name="depth"></param> /// <param name="messageEventHandler"></param> /// <returns></returns> public async Task <Guid> ConnectToPartialDepthWebSocketCombinedAsync(string symbols, string depth, BinanceWebSocketMessageHandler <BinancePartialDepthData> messageEventHandler) { Guard.AgainstNullOrEmpty(symbols, nameof(symbols)); Guard.AgainstNullOrEmpty(depth, nameof(depth)); symbols = PrepareCombinedSymbols.CombinedPartialDepth(symbols, depth); Logger.Debug("Connecting to Combined Partial Depth Web Socket"); var endpoint = new Uri($"{CombinedWebsocketUri}={symbols}"); return(await CreateBinanceWebSocketAsync(endpoint, messageEventHandler)); }