コード例 #1
0
        public IEnumerable <ICurrencyCoin> GetAllCoins()
        {
            var list = new List <ICurrencyCoin>();

            list.AddRange(_binanceService.GetAllPricesAsync().Result);
            list.AddRange(_bittrexService.GetMarketSummariesAsync().Result);
            list.AddRange(_cryptopiaService.GetMarketsAsync().Result.Where(c => !KNOWN_BAD_COINS.Contains(c.TickerSymbol)));
            return(list);
        }
コード例 #2
0
        /// <summary>
        /// Gets all the tickers and their last prices from each exchange.
        /// </summary>
        public List <ICurrencyCoin> GetAllExchangeTickersAndPrices()
        {
            var allExchangeTickers = new List <ICurrencyCoin>();
            var crptopiaTickers    = _cryptopiaService.GetMarketsAsync();
            var bittrexTickers     = _bittrexService.GetMarketSummariesAsync();
            var binanceTickers     = _binanceService.GetAllPricesAsync();

            Task.WaitAll(new Task[] { crptopiaTickers, bittrexTickers, binanceTickers });
            allExchangeTickers.AddRange(crptopiaTickers.Result.Where(c => !CRYPTOPIA_KNOWN_BAD_COINS.Contains(c.TickerSymbol)));
            allExchangeTickers.AddRange(binanceTickers.Result);
            allExchangeTickers.AddRange(bittrexTickers.Result);

            return(allExchangeTickers);
        }