diff --git a/bfxapi/examples/subscribe_orderbook.py b/bfxapi/examples/subscribe_orderbook.py index d8e94d3..153fef5 100644 --- a/bfxapi/examples/subscribe_orderbook.py +++ b/bfxapi/examples/subscribe_orderbook.py @@ -5,7 +5,7 @@ sys.path.append('../') from bfxapi import Client bfx = Client( - logLevel='INFO', + logLevel='DEBUG', # Verifies that the local orderbook is up to date # with the bitfinex servers manageOrderBooks=True @@ -23,9 +23,9 @@ def log_update(data): def log_snapshot(data): print ("Initial book: {}".format(data)) -def start(): - bfx.ws.subscribe('book', 'tBTCUSD') - bfx.ws.subscribe('book', 'tETHUSD') +async def start(): + await bfx.ws.subscribe('book', 'tBTCUSD') + # bfx.ws.subscribe('book', 'tETHUSD') bfx.ws.on('connected', start) bfx.ws.run() diff --git a/bfxapi/examples/subscribe_trades_candles.py b/bfxapi/examples/subscribe_trades_candles.py index 6900c87..1b1dd27 100644 --- a/bfxapi/examples/subscribe_trades_candles.py +++ b/bfxapi/examples/subscribe_trades_candles.py @@ -20,9 +20,9 @@ def log_candle(candle): def log_trade(trade): print ("New trade: {}".format(trade)) -def start(): - bfx.ws.subscribe('candles', 'tBTCUSD', timeframe='1m') - bfx.ws.subscribe('trades', 'tBTCUSD') +async def start(): + await bfx.ws.subscribe('candles', 'tBTCUSD', timeframe='1m') + await bfx.ws.subscribe('trades', 'tBTCUSD') bfx.ws.on('connected', start) bfx.ws.run()