예제 #1
0
        public string AuthQuery(string method, Dictionary <string, string> postDict)
        {
            //通过Tick获得的整数对Btce来说可能太大了!
            string nonce = AuthUtility.GetNonceBySeconds();

            postDict.Add("nonce", nonce);
            postDict.Add("method", method);
            string post = AuthUtility.ToPost(postDict, true);

            var sign = AuthUtility.GetSign(post, AuthKey.PrivateKey);

            byte[]         data       = Encoding.ASCII.GetBytes(post);
            HttpWebRequest webRequest = GetWebRequest(data, sign);

            string json = AuthUtility.GetResponseJson(webRequest);

            return(json);
        }