Teach how to hash data in mql4 - page 6

 
Sergeev, did you get drafted?
 
sanyooooook:
Sergeev, did you get drafted into the army?
Hello to you too :)
 
sergeev:
Hello to you, too :)
I was just checking to see if... ))
 
don't wait for it :)
 
sergeev:
can't wait :)

(Did you make it to the Canadian border in time? )

ZS: I'm not waiting, just haven't seen you in a while so I thought.

 
Alexandr Bryzgalov:
it's on BTC-e.

sent to codebase for SHA512 + HMAC verification

will be posted shortly.

 
o_o:

sent to codebase for SHA512 + HMAC verification

will be posted shortly.

+
 
Alexandr Bryzgalov:
+

just checked the operation on BTC-e itself.

all ok

#include "SHA512.mq4"
//+------------------------------------------------------------------+
void OnStart()
{
        string key=
        string secret=

        string request;
        request+="method=getInfo";
        request+="&";
        request+="nonce="+string(1);
        
        char data[];
        StringToCharArray(request, data, 0, StringLen(request), CP_UTF8);
        
        string sha512data=SHA512::hmac(data, secret);
        string headers;
        headers+="Key:"+key+"\r\n";
        headers+="Sign:"+sha512data+"\r\n";
        headers+="Content-Type: application/x-www-form-urlencoded\r\n";
        headers+="Content-Length:"+string(ArraySize(data))+"\r\n";
        headers+="\r\n";

        string res_header;
        char result[];
        int ret=WebRequest("POST", "https://btc-e.com/tapi", headers, 10000, data, result, res_header);
        string ans=CharArrayToString(result);
        Print(ans);
}


in response

{"success":1,"return":{"funds":{"usd":0,"btc":0,"ltc":0,"nmc":0,"rur":0,"eur":0,"nvc":0,"trc":0,"ppc":0,"ftc":0,"xpm":0,"cnh":0,"gbp":0,"dsh":0,"eth":0},"rights":{"info":1,"trade":1,"withdraw":0},"transaction_count":0,"open_orders":0,"server_time":1492628713}}


So, next step is to parse the response with my other JSON line

and you'll use it just fine )

 
o_o:

just checked the operation on BTC-e itself.

all ok


in reply to


all in all, it's ok. you will use it )

i also did a freelance order for $400 for all api functions for brizhe on mql4

only the hashing was via libs.

It will be possible to do without any libs at all.

thanks, i'll try to add these functions to the old api (if i can find them).

ZS: bot by the way worked fine, but rarely, so I had no desire to arbitrage, now seems to be moving, should be frequent responses

 

Jason parsed it himself, or rather only what I needed.

I'm not sure how much speed is lost in string work.