public static Depth GetDepth(BtcePair pair) { string queryStr = string.Format("https://btc-e.com/api/2/{0}/depth", BtcePairHelper.ToString(pair)); try { return(Depth.ReadFromJObject(JObject.Parse(WebApi.Query(queryStr)))); } catch (Exception e) { return(null); } }
public static Depth ReadFromJObject(JObject o) { var r = new Depth(); r.Asks = new List<OrderInfo>(); r.Bids = new List<OrderInfo>(); foreach (var item in o["asks"] as JArray) { var order = OrderInfo.ReadFromJObject(item as JArray); r.Asks.Add(order); } foreach (var item in o["bids"] as JArray) { var order = OrderInfo.ReadFromJObject(item as JArray); r.Bids.Add(order); } return r; }
public static Depth ReadFromJObject(JObject o) { var r = new Depth(); r.Asks = new List <OrderInfo>(); r.Bids = new List <OrderInfo>(); foreach (var item in o["asks"] as JArray) { var order = OrderInfo.ReadFromJObject(item as JArray); r.Asks.Add(order); } foreach (var item in o["bids"] as JArray) { var order = OrderInfo.ReadFromJObject(item as JArray); r.Bids.Add(order); } return(r); }
public static Depth GetDepth(BtcePair pair) { return (Depth.ReadFromJObject( JObject.Parse(Query(string.Format("{1}api/2/{0}/depth", BtcePairHelper.ToString(pair), ExchangeHost))))); }
public static Dictionary <BtcePair, Depth> GetDepth(BtcePair[] pairlist, int limit = 150) { return(MakeRequest <Depth>("depth", pairlist, new Func <JContainer, Depth>(x => Depth.ReadFromJObject(x as JObject)), new Dictionary <string, string>() { { "limit", limit.ToString() } }, true)); }
public static Depth GetDepth(BtcePair pair) { string queryStr = string.Format("https://btc-e.com/api/2/{0}/depth", BtcePairHelper.ToString(pair)); return(Depth.ReadFromJObject(JObject.Parse(Query(queryStr)))); }