public OpenOrder SellOrderLimit(decimal amount, decimal price, string book) { string additionaljsonparameters = String.Format(@", ""amount"": ""{0}"", ""price"": ""{1}"", ""book"": ""{2}""", amount, price, book); dynamic r = JsonWebRequestWithAuthentication("https://api.quadrigacx.com/v2/sell", "POST", additionaljsonparameters); processError(r); return(OpenOrder.GetFromJson(r, book)); }
public IEnumerable <OpenOrder> GetOpenOrders(string book = "btc_cad") { string additionaljsonparameters = String.Format(@", ""book"": ""{0}""", book); dynamic r = JsonWebRequestWithAuthentication("https://api.quadrigacx.com/v2/open_orders", "POST", additionaljsonparameters); processError(r); List <OpenOrder> l = new List <OpenOrder>(); foreach (dynamic tran in r) { l.Add(OpenOrder.GetFromJson(tran, book)); } return(l); }
public IEnumerable <OpenOrder> LookupOrder(string orderid) { string additionaljsonparameters = String.Format(@", ""id"": ""{0}""", orderid); dynamic r = JsonWebRequestWithAuthentication("https://api.quadrigacx.com/v2/lookup_order", "POST", additionaljsonparameters); processError(r); List <OpenOrder> l = new List <OpenOrder>(); foreach (dynamic tran in r) { processError(tran); l.Add(OpenOrder.GetFromJson(tran, tran.book.ToString())); } return(l); }
public static OpenOrder GetFromJson(dynamic APICallResult, string book) { OpenOrder o = new OpenOrder { amount = APICallResult.amount, id = APICallResult.id, price = APICallResult.price, status = APICallResult.status, type = APICallResult.type, book = book }; try { o.updated = DateTime.Parse(APICallResult.updated.ToString()); } catch (Exception) {} try { o.created = DateTime.Parse(APICallResult.datetime.ToString()); } catch (Exception) { } try { o.created = DateTime.Parse(APICallResult.created.ToString()); } catch (Exception) { } return(o); }
public static OpenOrder GetFromJson(dynamic APICallResult, string book) { OpenOrder o = new OpenOrder { amount = APICallResult.amount, id = APICallResult.id, price = APICallResult.price, status = APICallResult.status, type = APICallResult.type, book = book }; try { o.updated = DateTime.Parse(APICallResult.updated.ToString()); } catch (Exception) {} try { o.created = DateTime.Parse(APICallResult.datetime.ToString()); } catch (Exception) { } try { o.created = DateTime.Parse(APICallResult.created.ToString()); } catch (Exception) { } return o; }