public KunaOrder CancelOrder(string orderId) { var response = UserQuery("order/delete", "POST", new Dictionary <string, string>() { { "id", orderId } }); return(KunaOrder.FromJson(JObject.Parse(response))); }
public KunaOrder PlaceOrder(string market, string side, double volume, double price) { var response = UserQuery("orders", "POST", new Dictionary <string, string>() { { "side", side }, { "volume", volume.ToString(CultureInfo.InvariantCulture) }, { "market", market }, { "price", price.ToString(CultureInfo.InvariantCulture) } }); return(KunaOrder.FromJson(JObject.Parse(response))); }
public static KunaOrderBook FromJson(JObject json) { var res = new KunaOrderBook(); foreach (JObject orderJson in (json["asks"] as JArray)) { res.Asks.Add(KunaOrder.FromJson(orderJson)); } foreach (JObject orderJson in (json["bids"] as JArray)) { res.Bids.Add(KunaOrder.FromJson(orderJson)); } return(res); }
public List <KunaOrder> ActiveOrders(string market) { var response = UserQuery("orders", "GET", new Dictionary <string, string>() { { "market", market } }); var json = JArray.Parse(response); var orders = new List <KunaOrder>(); foreach (var jsonOrder in json) { orders.Add(KunaOrder.FromJson(jsonOrder as JObject)); } return(orders); }
public KunaOrder CancelOrder(KunaOrder order) { return(CancelOrder(order.Id)); }