Exemplo n.º 1
0
        public static Trade ReadFromJObject(JObject o)
        {
            if (o == null)
            {
                return(null);
            }

            return(new Trade()
            {
                Pair = WexPairHelper.FromString(o.Value <string>("pair")),
                Type = TradeTypeHelper.FromString(o.Value <string>("type")),
                Amount = o.Value <decimal>("amount"),
                Rate = o.Value <decimal>("rate"),
                Timestamp = o.Value <UInt32>("timestamp"),
                IsYourOrder = (o.Value <int>("is_your_order") == 1),
                OrderId = o.Value <int>("order_id")
            });
        }
Exemplo n.º 2
0
        public static Order ReadFromJObject(JObject o)
        {
            if (o == null)
            {
                return(null);
            }

            return(new Order()
            {
                Pair = WexPairHelper.FromString(o.Value <string>("pair")),
                Type = TradeTypeHelper.FromString(o.Value <string>("type")),
                Amount = o.Value <decimal>("amount"),
                StartAmount = o.Value <decimal>("start_amount"),
                Rate = o.Value <decimal>("rate"),
                TimestampCreated = UnixTime.ConvertToDateTime(
                    o.Value <UInt32>("timestamp_created")),
                Status = o.Value <int>("status"),
            });
        }