Hi guys,
I made a bot in Python 2.7 on windows 10, for bittrex api v2. version 2 because of the necessity to use immediate_or_cancel.
now they dropped v2, and added version 3, but for some reason I cannot get the authentication procedure correct, can anybody help me with this?
I am a high-volume trader(so bittrex support was quite quick to try and help out), but even in this case, Bittrex support couldn't help me(because he could only copy/paste it seemed, and was using python 3.7).
examples are very welcome, of course without any personal info
![Wink](https://bitcointalk.org/Smileys/default/wink.gif)
my code looks along the lines of this:
if self.api_version == "v3":
request_url =
https://api.bittrex.com/v3/balances Timestamp = str(int(time.time() * 1000))
Method = "GET"
Content = ""
ContentHash = hashlib.sha512(Content.encode()).hexdigest()
print ContentHash
Array = [Timestamp, request_url, Method, ContentHash]
S = ""
PreSign = S.join(str(v) for v in Array)
print PreSign
Signature = hmac.new(self.api_secret.encode(),
PreSign.encode(),
hashlib.sha512).hexdigest()
Header = {
'Accept':'application/json',
'Api-Key':self.api_key,
'Api-Timestamp':Timestamp,
'Api-Content-Hash':ContentHash,
'Api-Signature':Signature,
'Content-Type':'application/json'
}
return requests.get(request_url, data = Content, headers = Header, timeout=10).json()
please don't take notice of indentation, that is not the problem.
It gives an error on the last line, saying: ValueError: No JSON object could be decoded. So this must mean that my authentication is not working for some reason
any help will be very appreciated, so don't forget to leave an altcoin address in case it might solve my problem, and I wish to be thankfull!
If I just print the outcome of the URl sent, then I get