Closed TheHolyRoger closed 3 years ago
Please point out which part is wrong.
@revilwang WS API docs say "# refer to Authentication section for gen_sign implementation"
There is no authentication section on that page...
Scroll down to the end of API Overview
section, and you'll see details about Authentication.
Are you talking about the REST page? https://www.gate.io/docs/apiv4/en/index.html#api-signature-string-generation
def gen_sign(method, url, query_string=None, payload_string=None):
key = '' # api_key
secret = '' # api_secret
t = time.time()
m = hashlib.sha512()
m.update((payload_string or "").encode('utf-8'))
hashed_payload = m.hexdigest()
s = '%s\n%s\n%s\n%s\n%s' % (method, url, query_string or "", hashed_payload, t)
sign = hmac.new(secret.encode('utf-8'), s.encode('utf-8'), hashlib.sha512).hexdigest()
return {'KEY': key, 'Timestamp': str(t), 'SIGN': sign}
This is wrong for your WS ^
No, WebSocket Authentication part is just above the System API
section.
Oh, ok I see it now sorry! It could use a header on the menu for it...
Thanks for your advice. Let's put it into a standalone section on next doc update
Please update your docs! I had to come here looking for how to auth to the websocket.
Info here is wrong: https://www.gateio.ch/docs/apiv4/ws/index.html#spot-websocket-v4