Sub ButtonLogin_Click
' $apikey='xxx';
' $apisecret='xxx';
' $nonce=time();
' $uri='https://bittrex.com/api/v1.1/market/getopenorders?apikey='.$apikey.'&nonce='.$nonce;
' $sign=hash_hmac('sha512',$uri,$apisecret);
' $ch = curl_init($uri);
' curl_setopt($ch, CURLOPT_HTTPHEADER, Array('apisign:'.$sign));
' $execResult = curl_exec($ch);
' $obj = json_decode($execResult);
Dim API_Key As String
Dim API_Secret As String
Dim nonce As Int
Dim Post_URL As String
Dim sign() As Byte
Dim API_Signed As String
Dim Byte_Conv As ByteConverter
Dim Post_Data As String
Dim uri As String
EditTextJson.Text = ""
EditTextOut.Text = ""
Post_URL = "https://bittrex.com/api/v1.1/market/getopenorders"
Post_Data = "apikey=" & API_Key & "&nonce=" & nonce
'Read Only
'Key:00e2ccecef704aa683563f6bb91567e8
'Secret:224559c2a1c14200938dc9bf5bb69d4b
' $apikey='xxx';
API_Key = "00e2ccecef704aa683563f6bb91567e8"
' $apisecret='xxx';
API_Secret = "224559c2a1c14200938dc9bf5bb69d4b"
' $nonce=time();
nonce = DateTime.Now/1000
' $uri='https://bittrex.com/api/v1.1/market/getopenorders?apikey='.$apikey.'&nonce='.$nonce;
uri = Post_URL & "?apikey=" & API_Key & "&nonce=" & nonce
' $sign=hash_hmac('sha512',$uri,$apisecret);
sign = HashHmac(uri, API_Secret)
API_Signed = Byte_Conv.HexFromBytes(sign) 'convert to HEX
API_Signed = API_Signed.ToLowerCase
Dim job_GetInfo As HttpJob
job_GetInfo.Initialize("job_GetInfo", Me)
job_GetInfo.PostString(Post_URL, Post_Data)
job_GetInfo.GetRequest.SetHeader("apisign", API_Signed)
job_GetInfo.GetRequest.SetHeader("apikey", API_Key)
'Stuff that appears unnecessary but since others use it.....
job_GetInfo.GetRequest.SetHeader("User-Agent","Mozilla/4.0 (compatible; Cryptsy API B4A client)")
job_GetInfo.GetRequest.SetContentType("application/x-www-form-urlencoded")
End Sub
private Sub jobDone (job1 As HttpJob)
Log(job1.Success)
Log(job1.GetString)
If (job1.JobName == "job_GetInfo" ) Then
Try
EditTextOut.Text = job1.GetString
Catch
Log(LastException)
End Try
End If
End Sub