Exemple #1
0
        public static Funds ReadFromJObject(JObject o)
        {
            if (o == null)
            {
                return(null);
            }

            var funds = new Funds()
            {
                Btc = o.Value <decimal>("btc"),
                Ltc = o.Value <decimal>("ltc"),
                Nmc = o.Value <decimal>("ntc"),
                Nvc = o.Value <decimal>("nvc"),
                Trc = o.Value <decimal>("trc"),
                Ppc = o.Value <decimal>("ppc"),
                Ftc = o.Value <decimal>("Ftc"),
                Usd = o.Value <decimal>("Usd"),
                Rur = o.Value <decimal>("rur"),
                Eur = o.Value <decimal>("eur")
            };

            foreach (var val in o)
            {
                funds.Balances[val.Key.ToUpper()] = decimal.Parse(val.Value.Value <string>(), NumberStyles.AllowExponent | NumberStyles.Float, CultureInfo.InvariantCulture);
            }
            return(funds);
        }
Exemple #2
0
 public static CancelOrderAnswer ReadFromJObject(JObject o)
 {
     return(new CancelOrderAnswer
     {
         Funds = Funds.ReadFromJObject(o["funds"] as JObject),
         OrderId = o.Value <int>("order_id")
     });
 }
Exemple #3
0
 public static UserInfo ReadFromJObject(JObject o)
 {
     return(new UserInfo
     {
         Funds = Funds.ReadFromJObject(o["funds"] as JObject),
         Rights = Rights.ReadFromJObject(o["rights"] as JObject),
         TransactionCount = o.Value <int>("transaction_count"),
         OpenOrders = o.Value <int>("open_orders"),
         ServerTime = o.Value <int>("server_time")
     });
 }
Exemple #4
0
 public static TradeAnswer ReadFromJObject(JObject o)
 {
     if (o == null)
     {
         return(null);
     }
     return(new TradeAnswer
     {
         Funds = Funds.ReadFromJObject(o["funds"] as JObject),
         Received = o.Value <decimal>("received"),
         Remains = o.Value <decimal>("remains"),
         OrderId = o.Value <int>("order_id")
     });
 }
Exemple #5
0
        public static Funds ReadFromJObject(JObject o)
        {
            if (o == null)
                return null;

            var r = new Funds()
            {
                Usd = o.Value<decimal>("usd"),
                Btc = o.Value<decimal>("btc"),
                Sc = o.Value<decimal>("sc"),
                Ltc = o.Value<decimal>("ltc"),
                Ruc = o.Value<decimal>("ruc"),
                Nmc = o.Value<decimal>("nmc")
            };

            return r;
        }
Exemple #6
0
        public static Funds ReadFromJObject(JObject o)
        {
            if (o == null)
            {
                return(null);
            }

            var r = new Funds()
            {
                Usd = o.Value <decimal>("usd"),
                Btc = o.Value <decimal>("btc"),
                Sc  = o.Value <decimal>("sc"),
                Ltc = o.Value <decimal>("ltc"),
                Ruc = o.Value <decimal>("ruc"),
                Nmc = o.Value <decimal>("nmc")
            };

            return(r);
        }
Exemple #7
0
        public static Funds ReadFromJObject(JObject o)
        {
            if (o == null)
                return null;

            var funds = new Funds()
            {
                Btc = o.Value<decimal>("btc"),
                Ltc = o.Value<decimal>("ltc"),
                Nmc = o.Value<decimal>("ntc"),
                Nvc = o.Value<decimal>("nvc"),
                Trc = o.Value<decimal>("trc"),
                Ppc = o.Value<decimal>("ppc"),
                Ftc = o.Value<decimal>("Ftc"),
                Usd = o.Value<decimal>("Usd"),
                Rur = o.Value<decimal>("rur"),
                Eur = o.Value<decimal>("eur")
            };
            foreach (var val in o)
            {
                funds.Balances[val.Key.ToUpper()] = decimal.Parse(val.Value.Value<string>(), NumberStyles.AllowExponent | NumberStyles.Float, CultureInfo.InvariantCulture);
            }
            return funds;
        }