Exemplo n.º 1
0
        public ExchangeRateItem ExchangeRate(Currency currency, Coin coin)
        {
            var client = new WebClient();

            client.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36");
            var ls = ExchangeRateItem.FromJson(
                client.DownloadString($"https://api.paybear.io/v2/{coin.ToString()}/exchange/{currency.ToString()}/rate"));

            return(ls);
        }
Exemplo n.º 2
0
 public static string ToJson(this ExchangeRateItem self) => JsonConvert.SerializeObject((object)self, (JsonSerializerSettings)Converter.Settings);