public string PostOrder(string currencyPair, OrderType type, decimal pricePerCoin, decimal amountQuote) { var postData = new Dictionary <string, object>() { { "currencyPair", currencyPair + "_btc" }, { "rate", pricePerCoin }, { "amount", amountQuote } }; string res = GatePostRequst.PostString(GetType(type), postData.ToHttpPostString()); dynamic a = JsonConvert.DeserializeObject(res); return(Convert.ToString(a.orderNumber)); }
public TransformWithdrow PostWihdrow(string currencyPair, string adrress, decimal amountQuote) { var postData = new Dictionary <string, object>() { { "currencyPair", currencyPair }, { "amount", amountQuote }, { "adress", adrress } }; string res = GatePostRequst.PostString(Withdrow, postData.ToHttpPostString()); var temp = new TransformWithdrow() { Amount = amountQuote, Currency = currencyPair, Wallet = adrress, Date = DateTime.Now }; return(temp); }
public Dictionary <string, string> GetDepositAddresses() { var postData = new Dictionary <string, string>(); foreach (var item in GetCoins()) { postData.Add(item, "¤cy=" + item); } var resault = new Dictionary <string, string>(); foreach (var item in postData) { var str = GatePostRequst.PostString(Balance, item.Value); dynamic tp = JsonConvert.DeserializeObject(str); resault.Add(item.Key, tp.addr.Value); } return(resault); }
public Dictionary <string, TransformBallans> GetBalances() { var str = GatePostRequst.PostString(Balance, ""); Dictionary <string, TransformBallans> resault = new Dictionary <string, TransformBallans>(); Dictionary <string, string> available = new Dictionary <string, string>(); dynamic tp = JsonConvert.DeserializeObject(str); foreach (var item in tp.available) { available.Add(item.Name, item.Value); } foreach (var item in tp.locked) { if (available.ContainsKey(item.Name)) { resault.Add(item.Name, new TransformBallans(available[item.Name], item.Value)); } } return(resault); }