public Dictionary <string, TransformInfo> GetInfo() { Dictionary <string, TransformInfo> temp = new Dictionary <string, TransformInfo>(); var coins = AccseptCoins.GetCoins(); foreach (var item in coins) { try { string site = " https://api.exmo.com/v1/trades/?pair="+ item.Key + "_" + item.Value; WebResponse resp = GetRequst.Requst(site); using (StreamReader stream = new StreamReader( resp.GetResponseStream(), Encoding.UTF8)) { string str = stream.ReadToEnd(); dynamic res = JsonConvert.DeserializeObject(str); } } catch (Exception e) { } } return(temp); }
public TransformOrders GetOrder(string MainCoinName, string SecondCoinName) { if (MainCoinName == "USDT") { return(new TransformOrders()); } string end = @"?limit=30"; string start = "https://yobit.net/api/3/depth/"; TransformOrders temp = new TransformOrders(); string site = start + SecondCoinName.ToLower() + "_" + MainCoinName.ToLower() + end; try { WebResponse resp = GetRequst.Requst(site); using (StreamReader stream = new StreamReader( resp.GetResponseStream(), Encoding.UTF8)) { string str = stream.ReadToEnd(); if (!str.Contains("Invalid pair name") && !str.Contains("Ddos")) { var res = JsonConvert.DeserializeObject <Dictionary <string, Field> >(str); temp = new TransformOrders(res.First().Value.asks, res.First().Value.bids); } } return(temp); } catch (WebException e) { string message = e.Message; //MessageBoxButtons buttons = MessageBoxButtons.OK; //MessageBox.Show(message, "YOBIT", buttons); return(temp); } }
public Dictionary <string, TransformInfo> GetInfo() { string site = "https://poloniex.com/public?command=returnCurrencies"; WebResponse resp = GetRequst.Requst(site); Dictionary <string, TransformInfo> temp; using (StreamReader stream = new StreamReader( resp.GetResponseStream(), Encoding.UTF8)) { string str = stream.ReadToEnd(); var res = JsonConvert.DeserializeObject <Dictionary <string, PoloniexCoinsInfoFields> >(str); temp = res.ToDictionary(d => d.Key, d => new TransformInfo(d.Value)); } return(temp); }
public static WebResponse Requst(string arg) { return(GetRequst.Requst(arg)); }