public async Task <Core.Models.Ticker> GetTickerAsync(TradingPair tradingPair, CancellationToken cancellationToken)
        {
            var result = await _bittrexClient.GetTickerAsync(tradingPair.ToString(TradingPairFormatOption), cancellationToken);

            if (!result.Success)
            {
                throw new Exception(result.Message);
            }

            return(new Core.Models.Ticker(Name, tradingPair, result.Result.Ask, result.Result.Bid, result.Result.Last));
        }
Beispiel #2
0
        public virtual async Task <CryptoResponse <Ticker> > GetTickerAsync(string market)
        {
            var tickerResponse = await _bittrexClient.GetTickerAsync(market);

            if (tickerResponse.Success)
            {
                return(new CryptoResponse <Ticker>(new Ticker
                {
                    Last = tickerResponse.Data.Last,
                    Ask = tickerResponse.Data.Ask,
                    Bid = tickerResponse.Data.Bid
                }));
            }
            return(new CryptoResponse <Ticker>(tickerResponse.Error.Message));
        }