Bitcoin Forum
June 17, 2024, 12:18:08 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Exchanges / Re: Problems with Yobit BTC withdrawals on: August 16, 2017, 09:38:16 PM
Oh, thank you
2  Local / Трейдеры / Проблемы с выводом YoBit on: August 16, 2017, 09:04:12 PM
Всем привет!

Попытался вчера вывести немного битков с Yobit - транзакция зависла и до сих пор висит неподтвержденной. Транзакция: 5ef5f16c16ef473d0e1082f575e86552d429b52b349cfd7fe0bf90af8a54d1e6. Кто-нибудь сталкавался с подобной проблемой?
3  Economy / Exchanges / Problems with Yobit BTC withdrawals on: August 16, 2017, 08:46:50 PM
Hi all!

I tried to withdraw some BTC from YoBit exchange 1 day ago, but my transaction still unconfirmed. Transaction: 5ef5f16c16ef473d0e1082f575e86552d429b52b349cfd7fe0bf90af8a54d1e6. Did anyone have problems like this?
4  Economy / Exchanges / Re: Yobit tapi on: August 07, 2017, 09:10:54 PM
Thanks all for help. The problem was with WebRequest code. There is fixed version of method
Code:
public void GetInfo()
        {
            string parameters = $"method=getInfo&nonce=" + (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;

            string address = $"{tapi}/";

            var keyByte = Encoding.UTF8.GetBytes(secret);

            string sign1 = string.Empty;
            byte[] inputBytes = Encoding.UTF8.GetBytes(parameters);
            using (var hmac = new HMACSHA512(keyByte))
            {
                byte[] hashValue = hmac.ComputeHash(inputBytes);

                StringBuilder hex1 = new StringBuilder(hashValue.Length * 2);
                foreach (byte b in hashValue)
                {
                    hex1.AppendFormat("{0:x2}", b);
                }
                sign1 = hex1.ToString();
            }

            WebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create(address);
            if (webRequest != null)
            {
                webRequest.Method = "POST";
                webRequest.Timeout = 20000;
                webRequest.ContentType = "application/x-www-form-urlencoded";
                webRequest.Headers.Add("Key", key);
                webRequest.Headers.Add("Sign", sign1);

                webRequest.ContentLength = parameters.Length;
                using (var dataStream = webRequest.GetRequestStream())
                {
                    dataStream.Write(inputBytes, 0, parameters.Length);
                }

                using (System.IO.Stream s = webRequest.GetResponse().GetResponseStream())
                {
                    using (System.IO.StreamReader sr = new System.IO.StreamReader(s))
                    {
                        var jsonResponse = sr.ReadToEnd();
                        Console.WriteLine(String.Format("Response: {0}", jsonResponse));
                    }
                }
            }

        }
5  Local / Кодеры / Re: Вопрос по API Yobit on: August 07, 2017, 09:03:54 PM
ligor, огромное спасибо! Smiley
6  Economy / Exchanges / Re: Yobit tapi on: August 06, 2017, 12:59:24 PM
Thank you for your answer

I post real API key and secret

I compare your code with mine and I can't find differences. I know about nonce increasing, but I have not any successes request so i think, that it should work. I tried to rewrite calculation of nonce but i still have this error.

I have another API key and secret pair for my test, but they don't work too
7  Economy / Exchanges / Yobit tapi on: August 06, 2017, 10:37:56 AM
I am trying to write simple application for myself and when i try to call getInfo method i always get a error into the response. Key, sign, method or nonce is incorrect. I found a number of examples but i still can't find mistake in my code. Could anyone help me with it? My code:

    const string key = "072BCC223A1ADBE86854A4B4A9468EAB";
    const string secret = "4c962093fb943d418afb8fae14841c6b";
    const string tapi = "https://yobit.net/tapi";

    public void GetInfo() {
        int nonce = 1;

        string parameters = $"method=getInfo&nonce=1";

        string address = $"{tapi}?{parameters}";

        var keyByte = Encoding.UTF8.GetBytes(secret);

        string sign1 = string.Empty;
        byte[] inputBytes = Encoding.UTF8.GetBytes(parameters);
        using (var hmac = new HMACSHA512(keyByte))
        {
            byte[] hashValue = hmac.ComputeHash(inputBytes);

            StringBuilder hex1 = new StringBuilder(hashValue.Length * 2);
            foreach (byte b in hashValue)
            {
                hex1.AppendFormat("{0:x2}", b);
            }
            sign1 =  hex1.ToString();
        }

        WebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create(address);
        if (webRequest != null)
        {
            webRequest.Method = "POST";
            webRequest.Timeout = 20000;
            webRequest.ContentType = "application/x-www-form-urlencoded";
            webRequest.Headers.Add("Key", key);
            webRequest.Headers.Add("Sign", sign1);

            using (System.IO.Stream s = webRequest.GetResponse().GetResponseStream())
            {
                using (System.IO.StreamReader sr = new System.IO.StreamReader(s))
                {
                    var jsonResponse = sr.ReadToEnd();
                    Console.WriteLine(String.Format("Response: {0}", jsonResponse));
                }
            }
        }


        Log(nonce.ToString());
    }
KeyAPI - InfoOnly, I specially hardcode nonce as 1 because i think that it will be easier to find a problem.
8  Local / Кодеры / Вопрос по API Yobit on: August 06, 2017, 10:28:24 AM
Добрый день. Подскажите, пожалуйста, возможно кто-то встречался с такой проблемой. Пытаюсь для себя написать на C# простое приложение и пры поппытке вызвать метод getInfo всегда получаю ошибку. Пишет, что ключ, подпись, метод или nonce неверный. Нашел несколько примеров, проверил все, что мог. Ошибки не вижу. Может кто-нибудь знает в чем тут может быть дело? Вот код:

        const string key = "072BCC223A1ADBE86854A4B4A9468EAB";
        const string secret = "4c962093fb943d418afb8fae14841c6b";
        const string tapi = "https://yobit.net/tapi";

        public void GetInfo() {
            int nonce = 1;

            string parameters = $"method=getInfo&nonce=1";

            string address = $"{tapi}?{parameters}";

            var keyByte = Encoding.UTF8.GetBytes(secret);

            string sign1 = string.Empty;
            byte[] inputBytes = Encoding.UTF8.GetBytes(parameters);
            using (var hmac = new HMACSHA512(keyByte))
            {
                byte[] hashValue = hmac.ComputeHash(inputBytes);

                StringBuilder hex1 = new StringBuilder(hashValue.Length * 2);
                foreach (byte b in hashValue)
                {
                    hex1.AppendFormat("{0:x2}", b);
                }
                sign1 =  hex1.ToString();
            }

            WebRequest webRequest = (HttpWebRequest)System.Net.WebRequest.Create(address);
            if (webRequest != null)
            {
                webRequest.Method = "POST";
                webRequest.Timeout = 20000;
                webRequest.ContentType = "application/x-www-form-urlencoded";
                webRequest.Headers.Add("Key", key);
                webRequest.Headers.Add("Sign", sign1);

                using (System.IO.Stream s = webRequest.GetResponse().GetResponseStream())
                {
                    using (System.IO.StreamReader sr = new System.IO.StreamReader(s))
                    {
                        var jsonResponse = sr.ReadToEnd();
                        Console.WriteLine(String.Format("Response: {0}", jsonResponse));
                    }
                }
            }


            Log(nonce.ToString());
        }


Ключ - InfoOnly, nonce специально захардкодил на 1 для простоты. Буду очень признателен за любую помощь
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!