async def run(): # to retrieve your API/SEC key go to your bitforex account, create the keys and store them in # BITFOREXAPIKEY/BITFOREXSECKEY environment variables api_key = os.environ['AAXAPIKEY'] sec_key = os.environ['AAXSECKEY'] user_id = os.environ['AAXUSERID'] aax = CryptoXLib.create_aax_client(api_key, sec_key) # Bundle several subscriptions into a single websocket aax.compose_subscriptions([ OrderBookSubscription(pair = Pair('BTC', 'USDT'), depth = 20, callbacks = [order_book_update]), OrderBookSubscription(pair = Pair('ETH', 'USDT'), depth = 20, callbacks = [order_book_update2]), ]) # Bundle subscriptions into a separate websocket aax.compose_subscriptions([ AccountSubscription(user_id) ]) # Execute all websockets asynchronously await aax.start_websockets() await aax.close()
async def init_test(self): self.client = CryptoXLib.create_aax_client(api_key, sec_key)
def initialize(cls) -> None: cls.client = CryptoXLib.create_aax_client(api_key, sec_key) cls.print_logs = True cls.log_level = logging.DEBUG