public static SimpleOrderInfo CreateFromJObject(JArray obj) { if (obj == null) { return(null); } var r = new SimpleOrderInfo() { Price = obj.Value <decimal>(0), Amount = obj.Value <decimal>(1), }; return(r); }
public static SimpleOrderInfo CreateFromJObject(JArray obj) { if (obj == null) { return null; } var r = new SimpleOrderInfo() { Price = obj.Value<decimal>(0), Amount = obj.Value<decimal>(1), }; return r; }
public static OrderBook CreateFromJObject(JObject o) { var r = new OrderBook(); r.Asks = new List <SimpleOrderInfo>(); r.Bids = new List <SimpleOrderInfo>(); foreach (var item in o["asks"] as JArray) { var order = SimpleOrderInfo.CreateFromJObject(item as JArray); r.Asks.Add(order); } foreach (var item in o["bids"] as JArray) { var order = SimpleOrderInfo.CreateFromJObject(item as JArray); r.Bids.Add(order); } return(r); }