internal static bool TryParse( IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out OrderCanceledMessage response) { var result = serializer.TryDeserializeIfContains( input, new[] { AccountSubscriptionType.Orders.ToTopicId(), OrderEventType.Cancellation.ToString().ToLower() }, out response); return(result && response?.Data?.OrderId > 0); }
internal static bool TryParse( IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out MarketBestBidOfferUpdateMessage response) { var result = serializer.TryDeserializeIfContains( input, new[] { "\"tick\"", SubscriptionType.MarketBestBidOffer.ToTopicId() }, out response); return(result && !string.IsNullOrEmpty(response?.Tick?.Symbol)); }
internal static bool TryParse( IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out MarketByPricePullResponse response) { var result = serializer.TryDeserializeIfContains( input, new[] { "\"rep\"", SubscriptionType.MarketByPrice.ToTopicId() }, out response); return(result && response?.Data?.SeqNum > 0); }
internal static bool TryParse( IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out MarketCandlestickPullResponse response) { var result = serializer.TryDeserializeIfContains( input, new[] { "\"rep\"", SubscriptionType.MarketCandlestick.ToTopicId() }, out response); return(result && response?.Data?.FirstOrDefault()?.Id > 0); }
internal static bool TryParse( IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out AccountErrorMessage response) { var result = serializer.TryDeserializeIfContains( input, new[] { "\"code\"", "\"message\"" }, out response); return(result && response?.Code != 200); }
internal static bool TryParse( IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out MarketDepthUpdateMessage response) { var result = serializer.TryDeserializeIfContains( input, new[] { "\"tick\"", SubscriptionType.MarketDepth.ToTopicId() }, out response); return(result && response?.Tick?.Timestamp.Ticks > 0); }
internal static bool TryParse( IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out AuthenticationResponse response) { var result = serializer.TryDeserializeIfContains( input, new[] { "\"req\"", "\"auth\"" }, out response); return(result); }
internal static bool TryParse( IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out AccountSubscribeResponse response) { var result = serializer.TryDeserializeIfContains( input, new[] { "\"sub\"", "\"code\"" }, new[] { "\"message\"" }, out response); return(result); }
internal static bool TryParse(IHuobiSerializer serializer, string input, [MaybeNullWhen(false)] out ErrorMessage response) { var result = serializer.TryDeserializeIfContains(input, "\"err-code\"", out response); return(result && !string.IsNullOrEmpty(response?.ErrorCode)); }