I'm having trouble following LakeBTC's API instructions for connecting to their API via Python.
API Documentation: https://www.lakebtc.com/s/api
I have my key (email address) and secret. I'm using the API URL: https://www.LakeBTC.com/api_v1
No matter what I try, I get a 401 Error. Below is my code, any ideas?
tonce = str(int(time.time() * 1e6))
p = 'tonce=' + tonce \
+ '&accesskey=' + self.key \
+ '&requestmethod=post' \
+ '&id=1' \
+ '&method=' + 'getAccountInfo' \
+ '¶ms='
# Create signature
hmac_obj = hmac.new(self.secret, p, hashlib.sha1)
b64 = 'Basic ' + base64.b64encode(self.key + ':' + hmac_obj.digest())
header = {
'Json-Rpc-Tonce': tonce,
'Authorization': b64,
'content-type': 'application/json-rpc',
}
response = requests.post(self.apiUrl, data=p, headers=header)
Am I encrypting and hashing correctly?