MCPcopy Create free account
hub / github.com/ccxt/ccxt / subscribe_multiple

Method subscribe_multiple

python/ccxt/pro/coinbase.py:155–186  ·  view source on GitHub ↗

@ignore subscribes to a websocket channel https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-overview#subscribe :param str name: the name of the channel :param boolean isPrivate: whether the channel is private or not :param str[] [symbols]: unified

(self, name: str, isPrivate: bool, symbols: Strings = None, params={})

Source from the content-addressed store, hash-verified

153 return res
154
155 async def subscribe_multiple(self, name: str, isPrivate: bool, symbols: Strings = None, params={}):
156 """
157 @ignore
158 subscribes to a websocket channel
159
160 https://docs.cloud.coinbase.com/advanced-trade-api/docs/ws-overview#subscribe
161
162 :param str name: the name of the channel
163 :param boolean isPrivate: whether the channel is private or not
164 :param str[] [symbols]: unified market symbol
165 :param dict [params]: extra parameters specific to the exchange API endpoint
166 :returns dict: subscription to a websocket channel
167 """
168 await self.load_markets()
169 productIds = []
170 messageHashes = []
171 symbols = self.market_symbols(symbols, None, False)
172 for i in range(0, len(symbols)):
173 symbol = symbols[i]
174 market = self.market(symbol)
175 marketId = market['id']
176 productIds.append(marketId)
177 messageHashes.append(name + '::' + symbol)
178 url = self.urls['api']['ws']
179 subscribe = {
180 'type': 'subscribe',
181 'product_ids': productIds,
182 'channel': name,
183 }
184 if isPrivate:
185 subscribe = self.extend(subscribe, self.create_ws_auth(name, productIds))
186 return await self.watch_multiple(url, messageHashes, subscribe, messageHashes)
187
188 async def un_subscribe_multiple(self, topic: str, name: str, isPrivate: bool, symbols: Strings = None, params={}):
189 """

Callers 3

watch_tickersMethod · 0.95

Calls 8

create_ws_authMethod · 0.95
market_symbolsMethod · 0.80
watch_multipleMethod · 0.80
rangeFunction · 0.50
load_marketsMethod · 0.45
marketMethod · 0.45
appendMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected