Beispiel #1
0
        public ORDERLIST GetOrderList(int?from              = null,
                                      int?count             = null,
                                      int?fromId            = null,
                                      int?endId             = null,
                                      bool?orderAsc         = null,
                                      DateTime?since        = null,
                                      DateTime?end          = null,
                                      BTCECURRENCYPAIR?pair = null,
                                      bool?active           = null)
        {
            var args = new Dictionary <string, string>()
            {
                { "method", "OrderList" }
            };

            if (from != null)
            {
                args.Add("from", from.Value.ToString());
            }
            if (count != null)
            {
                args.Add("count", count.Value.ToString());
            }
            if (fromId != null)
            {
                args.Add("from_id", fromId.Value.ToString());
            }
            if (endId != null)
            {
                args.Add("end_id", endId.Value.ToString());
            }
            if (orderAsc != null)
            {
                args.Add("order", orderAsc.Value ? "ASC" : "DESC");
            }
            if (since != null)
            {
                args.Add("since", UNIXTIME.GetFromDateTime(since.Value).ToString());
            }
            if (end != null)
            {
                args.Add("end", UNIXTIME.GetFromDateTime(end.Value).ToString());
            }
            if (pair != null)
            {
                args.Add("pair", BTCECURRENCYPAIRHELPER.ToString(pair.Value));
            }
            if (active != null)
            {
                args.Add("active", active.Value ? "1" : "0");
            }
            var result = JObject.Parse(Query(args));

            if (result.Value <int>("success") == 0)
            {
                throw new Exception(result.Value <string>("error"));
            }
            return(ORDERLIST.ReadFromJObject(result["return"] as JObject));
        }
Beispiel #2
0
        public TRANSACTIONHISTORY GetTransactionHistory(int?from       = null,
                                                        int?count      = null,
                                                        int?fromId     = null,
                                                        int?endId      = null,
                                                        bool?orderAsc  = null,
                                                        DateTime?since = null,
                                                        DateTime?end   = null)
        {
            var args = new Dictionary <string, string>()
            {
                {
                    "method",
                    "TransHistory"
                }
            };

            if (from != null)
            {
                args.Add("from", from.Value.ToString());
            }
            if (count != null)
            {
                args.Add("count", count.Value.ToString());
            }
            if (fromId != null)
            {
                args.Add("from_id", fromId.Value.ToString());
            }
            if (endId != null)
            {
                args.Add("end_id", endId.Value.ToString());
            }
            if (orderAsc != null)
            {
                args.Add("order", orderAsc.Value ? "ASC" : "DESC");
            }
            if (since != null)
            {
                args.Add("since", UNIXTIME.GetFromDateTime(since.Value).ToString());
            }
            if (end != null)
            {
                args.Add("end", UNIXTIME.GetFromDateTime(end.Value).ToString());
            }
            var result = JObject.Parse(Query(args));

            if (result.Value <int>("success") == 0)
            {
                throw new Exception(result.Value <string>("error"));
            }
            return(TRANSACTIONHISTORY.ReadFromJObject(result["return"] as JObject));
        }