async def run(): api_key = os.environ['BTSEAPIKEY'] sec_key = os.environ['BTSESECKEY'] client = CryptoXLib.create_btse_client(api_key, sec_key) print("Exchange details:") await client.get_exchange_info(pair=Pair('BTC', 'USD')) print("Account funds:") await client.get_funds() await client.close()
async def run(): api_key = os.environ['BTSEAPIKEY'] sec_key = os.environ['BTSESECKEY'] client = CryptoXLib.create_btse_client(api_key, sec_key) # Bundle several subscriptions into a single websocket client.compose_subscriptions([ AccountSubscription(), OrderbookL2Subscription( [Pair("BTC", "USD"), Pair('ETH', 'BTC')], depth=1) ]) # Bundle another subscriptions into a separate websocket client.compose_subscriptions([ OrderbookSubscription([Pair('BTSE', 'BTC')], callbacks=[order_book_update]), TradeSubscription([Pair('BTSE', 'BTC')]) ]) # Execute all websockets asynchronously await client.start_websockets()
async def init_test(self): self.client = CryptoXLib.create_btse_client(api_key, sec_key)
def initialize(cls) -> None: cls.client = CryptoXLib.create_btse_client(api_key, sec_key) cls.print_logs = True cls.log_level = logging.DEBUG