private List <Model.TickerResponse> GetTicker()
        {
            var tickers = _hitbtcRestClient.GetTickersAsync().Result.Result.ToList();
            var lstData = new List <Model.TickerResponse>();
            var symbols = _hitbtcRestClient.GetSymbolsAsync().Result.Result.ToList();

            foreach (var symbol in symbols)
            {
                var ticker = tickers.SingleOrDefault(x => x.Symbol == symbol.Id);

                if (ticker == null)
                {
                    continue;
                }

                var pairParsed = new Model.TickerResponse()
                {
                    Symbol            = symbol.Id,
                    QuantityIncrement = symbol.QuantityIncrement,
                    A             = symbol.BaseCurrency,
                    B             = symbol.QuoteCurrency,// BTC
                    BaseVolume    = ticker.Volume ?? 0,
                    High24hr      = ticker.High ?? 0,
                    HighestBid    = ticker.Bid ?? 0,
                    Last          = ticker.Last ?? 0,
                    Low24hr       = ticker.Low ?? 0,
                    LowestAsk     = ticker.Ask ?? 0,
                    PercentChange = 0,
                    QuoteVolume   = ticker.Volume ?? 0,
                };
                lstData.Add(pairParsed);
            }
            return(lstData);
        }
예제 #2
0
        public void GetTickersAsyncTest()
        {
            var client = new HitRestApi();

            var response = client.GetTickersAsync().Result;

            ResponseBasicCheck(response);

            Assert.AreNotEqual(0, response.Result.Length);
        }