Answer the question
In order to leave comments, you need to log in
How to write a signature for a request?
How to write a signature? Previous attempts have failed. Developer serialization - https://docs.kuna.io/docs/api-data-schema-and-seri... There are no Python libraries. Here is the code I made up. There is no understanding. Help, understand or give a link where you can understand how to do this. My code
r = 'https://api.kuna.io/v3/auth/me'
timestamp = str(int(time.time()))
msg = str(r) + str(public_key) + str(timestamp)
kun_signature = hmac.new(secret_key.encode('ascii'), msg.encode('ascii'), hashlib.sha384).hexdigest()
headers = {'accept': 'application/json',
'content-type': 'application/json',
'kun-nonce': timestamp,
'kun-apikey': public_key,
'kun-signature': kun_signature}
pool = requests.post(r, headers=headers)
print(pool)
<Response [400]>
Answer the question
In order to leave comments, you need to log in
This is how the signature for kuna.io is created
r = 'https://api.kuna.io/v3/auth/me'
api_path = "/v3/auth/me"
nonce = str(int(time.time()*1000.0))
body = str('')
msg = api_path+nonce+body
print(msg)
kun_signature = hmac.new(secret_key.encode('ascii'), msg.encode('ascii'), hashlib.sha384).hexdigest()
headers = {'accept': 'application/json',
'content-type': 'application/json',
'kun-nonce': nonce,
'kun-apikey': public_key,
'kun-signature': kun_signature}
pool = requests.post(r, headers=headers)
print(pool.text)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question