public WithdrawStatus[] GetWithdrawStatus(string asset, string method, string aclass = "currency")
        {
            string props = string.Format("&asset={0}&method={1}", asset, method);

            if (!aclass.IsNullOrWhiteSpace())
            {
                props = string.Format("&aclass={0}{1}", aclass, props);
            }

            string response = this.QueryPrivate("WithdrawStatus", props);

            if (response == null)
            {
                return(null);
            }

            ObjResultArray result = JsonConvert.DeserializeObject <ObjResultArray>(response);

            if (result.Error == null || result.Error.Count > 0)
            {
                return(null);
            }

            List <WithdrawStatus> statusinfos = new List <WithdrawStatus>();

            foreach (JObject obj in result.Result)
            {
                try
                {
                    WithdrawStatus info = JsonConvert.DeserializeObject <WithdrawStatus>(obj.ToString());
                    statusinfos.Add(info);
                }
                catch (Exception ex)
                {
                    ex.ToOutput();
                    continue;
                }
            }

            return(statusinfos.ToArray());
        }
        public WithdrawCancel GetWithdrawCancel(string asset, string refid, string aclass = "currency")
        {
            string props = string.Format("&asset={0}&refid={1}", asset, refid);

            if (!aclass.IsNullOrWhiteSpace())
            {
                props = string.Format("&aclass={0}{1}", aclass, props);
            }

            string response = this.QueryPrivate("WithdrawCancel", props);

            if (response == null)
            {
                return(null);
            }

            ObjResultArray result = JsonConvert.DeserializeObject <ObjResultArray>(response);

            if (result.Error == null || result.Error.Count > 0)
            {
                return(null);
            }

            /*List<WithdrawStatus> statusinfos = new List<WithdrawStatus>();
             * foreach (JObject obj in result.Result)
             * {
             *  try
             *  {
             *      WithdrawStatus info = JsonConvert.DeserializeObject<WithdrawStatus>(obj.ToString());
             *      statusinfos.Add(info);
             *  }
             *  catch (Exception ex)
             *  {
             *      ex.ToOutput();
             *      continue;
             *  }
             * }
             *
             * return statusinfos.ToArray();*/
            return(null);
        }
Example #3
0
        public DepositMethod[] GetDepositMethods(string asset, string aclass = "currency")
        {
            string props = string.Format("&asset={0}&aclass={1}", asset, aclass);

            string response = this.QueryPrivate("DepositMethods", props);

            if (response == null)
            {
                return(null);
            }

            ObjResultArray result = JsonConvert.DeserializeObject <ObjResultArray>(response);

            if (result.Error == null || result.Error.Count > 0)
            {
                return(null);
            }

            List <DepositMethod> methods = new List <DepositMethod>();

            foreach (JObject obj in result.Result)
            {
                try
                {
                    DepositMethod method = JsonConvert.DeserializeObject <DepositMethod>(obj.ToString());
                    methods.Add(method);
                }
                catch (Exception ex)
                {
                    ex.ToOutput();
                    continue;
                }
            }

            return(methods.ToArray());
        }