public Order[] GetOrders() { Dictionary<string, string> _params = new Dictionary<string, string>(); _params.Add("created", this.GetTime().ToString()); _params.Add("method", "get_orders"); JObject _json = this.Post(_params); int _count = _json["list"].Count(); Order[] _orders = new Order[_count]; for(int i=0;i<_count;i++) { Order _order = new Order(); _order.Id = _json["list"][i]["id"].Value<int>(); _order.Type = (OrderType)_json["list"][i]["type"].Value<int>(); _order.OrderPrice = _json["list"][i]["order_price"].Value<decimal>(); _order.OrderAmount = _json["list"][i]["order_amount"].Value<decimal>(); _order.ProcessedAmount = _json["list"][i]["processed_amount"].Value<decimal>(); _order.OrderTime = DateTime.Parse("1970-1-1 0:0:0.0").AddSeconds(_json["list"][i]["order_time"].Value<int>()).AddHours(this.timezone); _orders[i] = _order; } return _orders; }
public Order GetOrderInfo(int _id) { Dictionary<string, string> _params = new Dictionary<string, string>(); _params.Add("created", this.GetTime().ToString()); _params.Add("id", _id.ToString()); _params.Add("method", "order_info"); JObject _json = this.Post(_params); Order _order = new Order(); _order.Id = _json["id"].Value<int>(); _order.Type = (OrderType)_json["type"].Value<int>(); _order.OrderPrice = _json["order_price"].Value<decimal>(); _order.OrderAmount = _json["order_amount"].Value<decimal>(); _order.ProcessedPrice = _json["processed_price"].Value<decimal>(); _order.ProcessedAmount = _json["processed_amount"].Value<decimal>(); _order.Vot = _json["vot"].Value<decimal>(); _order.Fee = _json["fee"].Value<decimal>(); _order.Total = _json["total"].Value<decimal>(); _order.Status = (OrderStatus)_json["status"].Value<int>(); return _order; }