-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
switch to new protocol, ticker and level2 channels (#12)
* Introduces a flat schema for all messages. * Subscription message moved to gdax module. * Fixes bad call to logging module in ws4py implementation. * Reverted to ws4py 0.3.4 due to [possible bug](Lawouach/WebSocket-for-Python#230) in other recent releases.
- Loading branch information
Showing
6 changed files
with
118 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
import json | ||
|
||
from myproducer import producer | ||
|
||
|
||
subscription_message = { | ||
'type': 'subscribe', | ||
'product_ids': ['BTC-USD'], | ||
'channels': ['ticker', 'level2'], | ||
} | ||
|
||
def create_raw(dt, data): | ||
raw = {'timestamp': dt.isoformat(), 'producerUUID': producer.uuid.bytes, 'data': data} | ||
data_dict = json.loads(data) | ||
extra = {'timestamp': dt.isoformat(), 'producerUUID': producer.uuid.bytes} | ||
raw = {**extra, **data_dict} | ||
return raw |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ six==1.10.0 | |
urllib3==1.22 | ||
websocket-client==0.44.0 | ||
websockets==3.3 | ||
ws4py==0.4.2 | ||
ws4py==0.3.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters