/// <summary> /// Handles object messages sent by bitmex. /// </summary> /// <param name="msg">The MSG.</param> /// <param name="streams">The streams.</param> /// <returns></returns> public static bool HandleObjectMessage(string msg, BitmexClientStreams streams) { var response = BitmexJsonSerializer.Deserialize <JObject>(msg); // ******************** // ADD OBJECT HANDLERS BELOW // ******************** return (TradeResponse.TryHandle(response, streams.TradesSubject) || TradeBinResponse.TryHandle(response, streams.TradeBinSubject) || BookResponse.TryHandle(response, streams.BookSubject) || QuoteResponse.TryHandle(response, streams.QuoteSubject) || LiquidationResponse.TryHandle(response, streams.LiquidationSubject) || PositionResponse.TryHandle(response, streams.PositionSubject) || MarginResponse.TryHandle(response, streams.MarginSubject) || OrderResponse.TryHandle(response, streams.OrderSubject) || WalletResponse.TryHandle(response, streams.WalletSubject) || InstrumentResponse.TryHandle(response, streams.InstrumentSubject) || ExecutionResponse.TryHandle(response, streams.ExecutionSubject) || FundingResponse.TryHandle(response, streams.FundingsSubject) || ErrorResponse.TryHandle(response, streams.ErrorSubject) || SubscribeResponse.TryHandle(response, streams.SubscribeSubject) || InfoResponse.TryHandle(response, streams.InfoSubject) || AuthenticationResponse.TryHandle(response, streams.AuthenticationSubject)); }
private bool HandleObjectMessage(string msg) { var response = BitmexJsonSerializer.Deserialize <JObject>(msg); // ******************** // ADD OBJECT HANDLERS BELOW // ******************** return (TradeResponse.TryHandle(response, Streams.TradesSubject) || TradeBinResponse.TryHandle(response, Streams.TradeBinSubject) || BookResponse.TryHandle(response, Streams.BookSubject) || QuoteResponse.TryHandle(response, Streams.QuoteSubject) || LiquidationResponse.TryHandle(response, Streams.LiquidationSubject) || PositionResponse.TryHandle(response, Streams.PositionSubject) || OrderResponse.TryHandle(response, Streams.OrderSubject) || WalletResponse.TryHandle(response, Streams.WalletSubject) || ErrorResponse.TryHandle(response, Streams.ErrorSubject) || SubscribeResponse.TryHandle(response, Streams.SubscribeSubject) || InfoResponse.TryHandle(response, Streams.InfoSubject) || AuthenticationResponse.TryHandle(response, Streams.AuthenticationSubject)); }
private bool HandleObjectMessage(string msg) { // ******************** // ADD OBJECT HANDLERS BELOW // ******************** return (ErrorResponse.TryHandle(msg, Streams.ErrorSubject) || SubscribeResponse.TryHandle(msg, Streams.SubscribeSubject) || BookResponse.TryHandle(msg, Streams.BookSubject, "orderBookL2") || TradeResponse.TryHandle(msg, Streams.TradesSubject) || QuoteResponse.TryHandle(msg, Streams.QuoteSubject) || BookResponse.TryHandle(msg, Streams.Book25Subject, "orderBookL2_25") || LiquidationResponse.TryHandle(msg, Streams.LiquidationSubject) || PositionResponse.TryHandle(msg, Streams.PositionSubject) || MarginResponse.TryHandle(msg, Streams.MarginSubject) || OrderResponse.TryHandle(msg, Streams.OrderSubject) || WalletResponse.TryHandle(msg, Streams.WalletSubject) || ExecutionResponse.TryHandle(msg, Streams.ExecutionSubject) || FundingResponse.TryHandle(msg, Streams.FundingsSubject) || InstrumentResponse.TryHandle(msg, Streams.InstrumentSubject) || TradeBinResponse.TryHandle(msg, Streams.TradeBinSubject) || InfoResponse.TryHandle(msg, Streams.InfoSubject) || AuthenticationResponse.TryHandle(msg, Streams.AuthenticationSubject)); }