Utilities¶
Module for rest and websocket utilities
-
create_cid
()[source]¶ Create a new Client order id. Based on timestamp multiplied to 10k to make it improbable that two actions are assigned the same cid.
Returns: A integer number equal to the current timestamp * 10 thousend. Return type: int
-
cid_to_date
(cid)[source]¶ Converts a cid to date string YYYY-MM-DD
Parameters: cid (int) – A cid as it is generated by the function utils.create_cid()
Returns: A string formated date (e.g. YYYY-MM-DD, 2018-10-01) Return type: str
-
get_nonce
(multiplier)[source]¶ Returns a nonce used in authentication. Nonce must be an increasing number. If other frameworks have used higher numbers you might need to increase the nonce_multiplier.
-
TRADE_SYMBOL_MISSING
= re.compile('^[a-zA-Z]{6}$')¶ Regular expression used to match trade symbols without a leading t (e.g. BTCUSD)
-
FUNDING_SYMBOL_MISSING
= re.compile('^[a-zA-Z]{3}$')¶ Regular expression used to match financing symbols without a leading f (e.g. BTC)