Esempio n. 1
0
        public Dictionary <string, string> GetDepositAddresses()
        {
            var postData = new Dictionary <string, object>();

            postData.Add("command", "returnDepositAddresses");
            postData.Add("nonce", PoloniexPostRequst.GetCurrentHttpPostNonce());

            var str = PoloniexPostRequst.PostString("tradingApi", postData.ToHttpPostString());
            Dictionary <string, string> temp = new Dictionary <string, string>();
            var t = JsonConvert.DeserializeObject <Dictionary <string, string> >(str);

            return(t);
        }
Esempio n. 2
0
        public Dictionary <string, TransformBallans> GetBalances()
        {
            var postData = new Dictionary <string, object>();

            postData.Add("command", "returnCompleteBalances");
            postData.Add("nonce", PoloniexPostRequst.GetCurrentHttpPostNonce());

            var str = PoloniexPostRequst.PostString("tradingApi", postData.ToHttpPostString());
            Dictionary <string, TransformBallans> temp = new Dictionary <string, TransformBallans>();
            var t = JsonConvert.DeserializeObject <Dictionary <string, PoloniexWalletField> >(str);

            temp = t.ToDictionary(x => x.Key, y => new TransformBallans(y.Value));
            return(temp);
        }
Esempio n. 3
0
        public TransformWithdrow PostWithdrow(string currencyPair, string adrress, decimal amountQuote)
        {
            var postData = new Dictionary <string, object> {
                { "command", "withdraw" },
                { "currencyPair", currencyPair },
                { "adrress", adrress },
                { "amount", Convert.ToString(amountQuote) },
                { "nonce", PoloniexPostRequst.GetCurrentHttpPostNonce() }
            };

            var str = PoloniexPostRequst.PostString("tradingApi", postData.ToHttpPostString());
            var tp  = JsonConvert.DeserializeObject <JObject>(str);

            return(new TransformWithdrow(tp.Value <int>("id"), tp.Value <string>("currency"), tp.Value <string>("address"), tp.Value <decimal>("amount"), tp.Value <DateTime>("date")));
        }
Esempio n. 4
0
        public string PostOrder(string currencyPair, OrderType type, decimal pricePerCoin, decimal amountQuote)
        {
            var postData = new Dictionary <string, object> {
                { "command", GetOrderType(type) },
                { "currencyPair", currencyPair },
                { "rate", Convert.ToString(pricePerCoin) },
                { "amount", Convert.ToString(amountQuote) },
                { "nonce", PoloniexPostRequst.GetCurrentHttpPostNonce() }
            };

            var str = PoloniexPostRequst.PostString("tradingApi", postData.ToHttpPostString());
            var tp  = JsonConvert.DeserializeObject <JObject>(str);

            return(tp.Value <string>("orderNumber"));
        }