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); }
public void GetSymbolsAsyncTest() { var client = new HitRestApi(); var response = client.GetSymbolsAsync().Result; ResponseBasicCheck(response); Assert.AreNotEqual(0, response.Result.Length); }
public HitBTCClient(string startCoin, decimal waitingTime = 0, string key = "xxx", string sign = "xxx", decimal feeSell = 0.00054m, decimal feeBuy = 0.00054m) : base(startCoin: startCoin, feeBuy: feeBuy, feeSell: feeSell) { _hitbtcRestClient = new HitRestApi(new HitConfig { ApiKey = key, Secret = sign }); _hitbctSocketApi = new HitSocketApi(new HitConfig { ApiKey = key, Secret = sign, }); _currentAmount = UpdatedAmount; _lstMarket = _hitbtcRestClient.GetSymbolsAsync().Result.Result.ToList(); _waitingTime = waitingTime; }