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 = UnixTime.ConvertToDateTime(o.Value <UInt32>("server_time")) }); }
public static InfoAnswer ReadFromJObject(JObject o) { var pair_info_reader = new Func <JContainer, PairInfo>( x => PairInfo.ReadFromJObject(x as JObject) ); return(new InfoAnswer() { ServerTime = UnixTime.ConvertToDateTime( o.Value <UInt32>("server_time")), Pairs = JsonHelpers.ReadPairDict <PairInfo>( o.Value <JObject>("pairs"), pair_info_reader) }); }
public static TradeInfoV3 ReadFromJObject(JObject o) { if (o == null) { return(null); } return(new TradeInfoV3 { Amount = o.Value <decimal>("amount"), Price = o.Value <decimal>("price"), Timestamp = UnixTime.ConvertToDateTime(o.Value <UInt32>("timestamp")), Tid = o.Value <UInt32>("tid"), TradeType = TradeInfoTypeHelper.FromString(o.Value <string>("type")) }); }
public static Transaction ReadFromJObject(JObject o) { if (o == null) { return(null); } return(new Transaction() { Type = (TransType)o.Value <int>("type"), Amount = o.Value <decimal>("amount"), Currency = WexCurrencyHelper.FromString(o.Value <string>("currency")), Description = o.Value <string>("desc"), Status = (TransStatus)o.Value <int>("status"), Timestamp = UnixTime.ConvertToDateTime(o.Value <UInt32>("timestamp")) }); }
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"), }); }
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) { if (reader == null) { throw new ArgumentNullException("reader"); } if (serializer == null) { throw new ArgumentNullException("serializer"); } if (reader.TokenType == JsonToken.Integer) { var instance = (UInt32)serializer.Deserialize(reader, typeof(UInt32)); return(UnixTime.ConvertToDateTime(instance)); } throw new WexApiException("UnixTimeJsonConverter: Unexpected reader.TokenType=" + reader.TokenType); }
public static TickerAnswer ReadFromJObject(JObject o) { if (o == null) { return(null); } return(new TickerAnswer() { High = o.Value <decimal>("high"), Low = o.Value <decimal>("low"), Average = o.Value <decimal>("avg"), Volume = o.Value <decimal>("vol"), VolumeCurrent = o.Value <decimal>("vol_cur"), Last = o.Value <decimal>("last"), Buy = o.Value <decimal>("buy"), Sell = o.Value <decimal>("sell"), Updated = UnixTime.ConvertToDateTime(o.Value <UInt32>("updated")), }); }
public override string ToString() => $"[{Status}] {Pair}: {TradeType} {Amount} by {Rate} on {UnixTime.ConvertToDateTime(TimestampCreated)}";