Skip to content

Commit 19cac25

Browse files
adrielvieiraAdriel Vieira
andauthored
creates channels attributes based on products attribute in case channels are not provided in order to start connection (danpaquin#393)
Co-authored-by: Adriel Vieira <[email protected]>
1 parent b6f3a85 commit 19cac25

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cbpro/websocket_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def _connect(self):
7070
self.url = self.url[:-1]
7171

7272
if self.channels is None:
73-
sub_params = {'type': 'subscribe', 'product_ids': self.products}
73+
self.channels = [{"name": "ticker", "product_ids": [product_id for product_id in self.products]}]
74+
sub_params = {'type': 'subscribe', 'product_ids': self.products, 'channels': self.channels}
7475
else:
7576
sub_params = {'type': 'subscribe', 'product_ids': self.products, 'channels': self.channels}
7677

0 commit comments

Comments
 (0)