Example #1
0
        public Dictionary <string, string> GetDepositAddresses()
        {
            WebResponse response = LiveCoinGetRequst.AuthRequst(Payment + "balances", "");
            Dictionary <string, string> temp;

            using (StreamReader stream = new StreamReader(
                       response.GetResponseStream(), Encoding.UTF8))
            {
                string str = stream.ReadToEnd();
                temp = JsonConvert.DeserializeObject <Dictionary <string, string> >(str);
            }
            return(temp);
        }
Example #2
0
        public Dictionary <string, TransformBallans> GetBalances()
        {
            WebResponse response = LiveCoinGetRequst.AuthRequst(Payment + "balances", "");
            Dictionary <string, TransformBallans> temp = new Dictionary <string, TransformBallans>();

            using (StreamReader stream = new StreamReader(
                       response.GetResponseStream(), Encoding.UTF8))
            {
                string str    = stream.ReadToEnd();
                var    resalt = JsonConvert.DeserializeObject <List <Field> >(str);
                foreach (var item in resalt)
                {
                    if (temp.ContainsKey(item.currency))
                    {
                        if (item.type == "available")
                        {
                            temp[item.currency].Available = Convert.ToDecimal(item.price);
                        }
                        if (item.type == "trade")
                        {
                            temp[item.currency].OnOrders = Convert.ToDecimal(item.price);
                        }
                    }
                    else
                    {
                        if (item.type == "available")
                        {
                            var a = new TransformBallans();
                            a.Available = Convert.ToDecimal(item.price);
                            temp.Add(item.currency, a);
                        }
                        if (item.type == "trade")
                        {
                            var a = new TransformBallans();
                            a.OnOrders = Convert.ToDecimal(item.price);
                            temp.Add(item.currency, a);
                        }
                    }
                }
                return(temp);
            }
        }