public KunaUserInfo GetUserInfo() { var response = UserQuery("members/me", "GET", new Dictionary <string, string>()); var json = JObject.Parse(response); return(KunaUserInfo.FromJson(json)); }
public static KunaUserInfo FromJson(JObject json) { var res = new KunaUserInfo() { Email = (json["email"] as JValue).Value.ToString(), Activated = (bool)(json["activated"] as JValue).Value }; foreach (JObject acc in (json["accounts"] as JArray)) { var kunaAcc = new KunaAccount() { Currency = acc["currency"].ToString(), Balance = Convert.ToDouble(acc["balance"].ToString(), CultureInfo.InvariantCulture), Locked = Convert.ToDouble(acc["locked"].ToString(), CultureInfo.InvariantCulture) }; res.Accounts.Add(kunaAcc); res.AccountsByCurr[kunaAcc.Currency] = kunaAcc; } return(res); }