async def run(): #api_key = os.environ['BIBOXEUROPEAPIKEY'] #sec_key = os.environ['BIBOXEUROPESECKEY'] api_key = "" sec_key = "" bibox_europe = CryptoXLib.create_bibox_europe_client(api_key, sec_key) print("Ping:") await bibox_europe.get_ping() print("Pair list:") await bibox_europe.get_pairs() print("Exchange info:") await bibox_europe.get_exchange_info() print("User assets:") await bibox_europe.get_spot_assets(full = True) print("Create order:") try: await bibox_europe.create_order(pair = Pair('ETH', 'BTC'), order_type = enums.OrderType.LIMIT, order_side = enums.OrderSide.BUY, price = "1", quantity = "1") except BiboxEuropeException as e: print(e) print("Cancel order:") await bibox_europe.cancel_order(order_id = "1234567890") await bibox_europe.close()
async def run(): #api_key = os.environ['BIBOXEUROPEAPIKEY'] #sec_key = os.environ['BIBOXEUROPESECKEY'] api_key = "" sec_key = "" bibox = CryptoXLib.create_bibox_europe_client(api_key, sec_key) bibox.compose_subscriptions([ OrderBookSubscription(pair=Pair('ETH', 'BTC'), callbacks=[order_book_update]), OrderBookSubscription(pair=Pair('BTC', 'EUR'), callbacks=[order_book_update]), ]) # Execute all websockets asynchronously await bibox.start_websockets() await bibox.close()