Websocket

Our WebSocket uses AES 256 Algorithm for parameters encryption. This means that all Websocket output will be encrypted using this algorithm with the keys that have been shared.

API_KEY

API Key that is shared

HASH

Request Hash

REQUEST_TS

Random string of 18 digits

Generating HASH-KEY

from random import choice
import hashlib

API_SECRET = '...'
API_KEY = '...'

def generate_digits(code_length) -> str:
    code = ""
    for i in range(code_length):
        code += choice(digits)
    return code

request_ts = generate_digits(18)
concatenated_string = API_SECRET + request_ts + API_KEY
hash_string = hashlib.sha256((concatenated_string).encode('utf8')).hexdigest()

API_KEY # API_KEY
hash_string # HASH
request_ts # REQUEST_TS

Last updated