public async Task <IList <Candle> > GetDailyRates(Coin coin, int days) { var client = new ProductClient(_appSettings.ProductionBaseUri, _authenticator); var productId = $"{coin.ToUpperString()}-EUR"; return(await client.GetHistoricRatesAsync(productId, DateTimeOffset.UtcNow.AddDays(-1 * (days + 1)), DateTimeOffset.UtcNow, TimeSpan.FromDays(1))); }
public async Task <IEnumerable <Candle> > Get(string id) { _logger.LogInformation($"Retrieving historic rates of {id.ToUpper()}-EUR"); var client = new ProductClient("https://api.gdax.com", _authenticator); var response = await client.GetHistoricRatesAsync($"{id.ToUpper()}-EUR", DateTimeOffset.UtcNow.AddDays(-7), DateTimeOffset.UtcNow, TimeSpan.FromDays(1)); return(response); }