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()
示例#2
0
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()
示例#3
0
 async def init_test(self):
     self.client = CryptoXLib.create_btse_client(api_key, sec_key)
示例#4
0
 def initialize(cls) -> None:
     cls.client = CryptoXLib.create_btse_client(api_key, sec_key)
     cls.print_logs = True
     cls.log_level = logging.DEBUG