danpaquin / coinbasepro-python

The unofficial Python client for the Coinbase Pro API
MIT License
1.82k stars 732 forks source link

how to run this code? #390

Closed fahadshery closed 4 years ago

fahadshery commented 4 years ago

Hi All,

I am trying to run this piece of code:

import cbpro, time
order_book = cbpro.OrderBook(product_id='BTC-USD')
order_book.start()
time.sleep(10)
order_book.close()

But getting the following console msgs:

/usr/local/bin/python3.8 /Users/Fahad/GitLab/fuse/src/testorder.py
-- Subscribed to OrderBook! --

Connection is already closed. - data: None

-- OrderBook Socket Closed! --

Process finished with exit code 0

What am I doing wrong?

danpaquin commented 4 years ago

Looks like the websocket client may have syntax issues raised here: https://github.com/danpaquin/coinbasepro-python/issues/386

Does this solve the problem?

fahadshery commented 4 years ago

yes thanks