Ejemplo n.º 1
0
        public static Data.SellPrices GetSellPrices()
        {
            WebClient webClient = new ApiWebClient();

            string response = webClient.DownloadString(new Uri(GetApiUrl()));

            Data.SellPrices sellPrices = JsonConvert.DeserializeObject <Data.SellPrices>(response);
            return(sellPrices);
        }
Ejemplo n.º 2
0
        public IEnumerable <ExchangeInformation> GetExchangeInformation()
        {
            ApiWebClient webClient = new ApiWebClient();

            string response = webClient.DownloadFlakyString(new Uri(GetApiUrl()));

            Data.SellPrices sellPrices = JsonConvert.DeserializeObject <Data.SellPrices>(response);

            List <ExchangeInformation> results = new List <ExchangeInformation>();

            results.Add(new ExchangeInformation()
            {
                SourceCurrency = "BTC",
                TargetCurrency = "USD",
                TargetSymbol   = "$",
                ExchangeRate   = sellPrices.Subtotal.Amount
            });

            return(results);
        }