Ejemplo n.º 1
0
async def run():
    api_key = os.environ['BITPANDAAPIKEY']

    client = CryptoXLib.create_coinmate_client(api_key, "", "")

    print("Trading pairs:")
    await client.get_exchange_info()

    print("Currency pairs:")
    await client.get_currency_pairs()

    print("Ticker:")
    await client.get_ticker(pair = Pair('BTC', 'EUR'))

    await client.close()
Ejemplo n.º 2
0
async def run():
    api_key = os.environ['COINMATEAPIKEY']
    sec_key = os.environ['COINMATESECKEY']
    user_id = os.environ['COINMATEUSERID']

    client = CryptoXLib.create_coinmate_client(user_id, api_key, sec_key)

    # Bundle several subscriptions into a single websocket
    client.compose_subscriptions([
        OrderbookSubscription(Pair("BTC", "EUR"), callbacks = [order_book_update]),
        TradesSubscription(Pair("BTC", "EUR"), callbacks = [trades_update])
    ])

    # Bundle private subscriptions into a separate websocket
    client.compose_subscriptions([
        UserOrdersSubscription(callbacks = [account_update]),
        UserTradesSubscription(callbacks = [account_update]),
        UserTransfersSubscription(callbacks = [account_update]),
        BalancesSubscription(callbacks = [account_update])
    ])

    # Execute all websockets asynchronously
    await client.start_websockets()
Ejemplo n.º 3
0
 async def init_test(self):
     self.client = CryptoXLib.create_coinmate_client(
         user_id, api_key, sec_key)