watches information on multiple orders made by the user https://www.gate.com/docs/developers/apiv4/ws/en/#orders-channel https://www.gate.com/docs/developers/futures/ws/en/#orders-api https://www.gate.com/docs/developers/delivery/ws/en/#orders-api https://ww
(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})
| 1361 | client.resolve(newPositions, type + ':positions') |
| 1362 | |
| 1363 | async def watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]: |
| 1364 | """ |
| 1365 | watches information on multiple orders made by the user |
| 1366 | |
| 1367 | https://www.gate.com/docs/developers/apiv4/ws/en/#orders-channel |
| 1368 | https://www.gate.com/docs/developers/futures/ws/en/#orders-api |
| 1369 | https://www.gate.com/docs/developers/delivery/ws/en/#orders-api |
| 1370 | https://www.gate.com/docs/developers/options/ws/en/#orders-channel |
| 1371 | |
| 1372 | :param str symbol: unified market symbol of the market orders were made in |
| 1373 | :param int [since]: the earliest time in ms to fetch orders for |
| 1374 | :param int [limit]: the maximum number of order structures to retrieve |
| 1375 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 1376 | :param str [params.type]: spot, margin, swap, future, or option. Required if listening to all symbols. |
| 1377 | :param boolean [params.isInverse]: if future, listen to inverse or linear contracts |
| 1378 | :returns dict[]: a list of `order structures <https://docs.ccxt.com/?id=order-structure>` |
| 1379 | """ |
| 1380 | await self.load_markets() |
| 1381 | market = None |
| 1382 | if symbol is not None: |
| 1383 | market = self.market(symbol) |
| 1384 | symbol = market['symbol'] |
| 1385 | type = None |
| 1386 | query = None |
| 1387 | type, query = self.handle_market_type_and_params('watchOrders', market, params) |
| 1388 | typeId = self.get_supported_mapping(type, { |
| 1389 | 'spot': 'spot', |
| 1390 | 'margin': 'spot', |
| 1391 | 'future': 'futures', |
| 1392 | 'swap': 'futures', |
| 1393 | 'option': 'options', |
| 1394 | }) |
| 1395 | channel = typeId + '.orders' |
| 1396 | messageHash = 'orders' |
| 1397 | payload = ['!' + 'all'] |
| 1398 | if symbol is not None: |
| 1399 | messageHash += ':' + market['id'] |
| 1400 | payload = [market['id']] |
| 1401 | subType = None |
| 1402 | subType, query = self.handle_sub_type_and_params('watchOrders', market, query) |
| 1403 | isInverse = (subType == 'inverse') |
| 1404 | url = self.get_url_by_market_type(type, isInverse) |
| 1405 | # uid required for non spot markets |
| 1406 | requiresUid = (type != 'spot') |
| 1407 | orders = await self.subscribe_private(url, messageHash, payload, channel, query, requiresUid) |
| 1408 | if self.newUpdates: |
| 1409 | limit = orders.getLimit(symbol, limit) |
| 1410 | return self.filter_by_since_limit(orders, since, limit, 'timestamp', True) |
| 1411 | |
| 1412 | def handle_order(self, client: Client, message): |
| 1413 | # |
nothing calls this directly
no test coverage detected