public Dictionary <string, TransformBallans> GetBalances() { var list = Helpers.GetCoins(); var result = new Dictionary <string, TransformBallans>(); var temp = YoubitPostRequst.PostString(Balance, ""); if (!temp.Contains("funds")) { foreach (var item in list) { result.Add(item, new TransformBallans(0, 0)); } } else { var res = JObject.Parse(temp); foreach (var item in list) { var avaible = Convert.ToDecimal(res["return"]["funds"][item]); var onorders = Convert.ToDecimal(res["return"]["funds_incl_orders"][item]) - avaible; result.Add(item, new TransformBallans(avaible, onorders)); } } return(result); }
public TransformWithdrow PostWihdrow(string currencyPair, string adrress, decimal amountQuote) { var postData = new Dictionary <string, object>(); postData.Add("coinName", currencyPair); postData.Add("amount", amountQuote); postData.Add("address", adrress); var temp = YoubitPostRequst.PostString(Withdrow, postData.ToHttpPostString()); var res = JObject.Parse(temp); return(new TransformWithdrow(0, currencyPair, adrress, amountQuote, DateTime.Now)); }
public string PostOrder(string currencyPair, OrderType type, decimal pricePerCoin, decimal amountQuote) { var postData = new Dictionary <string, object>(); postData.Add("pair", currencyPair.ToLower() + "_btc"); postData.Add("type", GetOrderType(type)); postData.Add("rate", pricePerCoin); postData.Add("amount", amountQuote); var temp = YoubitPostRequst.PostString(Trade, postData.ToHttpPostString()); var res = JObject.Parse(temp); return(res["return"]["order_id"].ToString()); }
public Dictionary <string, string> GetDepositAddresses() { var list = Helpers.GetCoins(); var result = new Dictionary <string, string>(); foreach (var item in list) { var postData = new Dictionary <string, object>(); postData.Add("coinName", item); postData.Add("need_new", 0); var temp = YoubitPostRequst.PostString(Address, postData.ToHttpPostString()); var res = JObject.Parse(temp); result.Add(item, res["return"]["address"].ToString()); } return(result); }