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

Method watch_orders

python/ccxt/pro/bitget.py:1446–1534  ·  view source on GitHub ↗

watches information on multiple orders made by the user https://www.bitget.com/api-doc/spot/websocket/private/Order-Channel https://www.bitget.com/api-doc/spot/websocket/private/Plan-Order-Channel https://www.bitget.com/api-doc/contract/websocket/private/Order-Chann

(self, symbol: Str = None, since: Int = None, limit: Int = None, params={})

Source from the content-addressed store, hash-verified

1444 })
1445
1446 async def watch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
1447 """
1448 watches information on multiple orders made by the user
1449
1450 https://www.bitget.com/api-doc/spot/websocket/private/Order-Channel
1451 https://www.bitget.com/api-doc/spot/websocket/private/Plan-Order-Channel
1452 https://www.bitget.com/api-doc/contract/websocket/private/Order-Channel
1453 https://www.bitget.com/api-doc/contract/websocket/private/Plan-Order-Channel
1454 https://www.bitget.com/api-doc/margin/cross/websocket/private/Cross-Orders
1455 https://www.bitget.com/api-doc/margin/isolated/websocket/private/Isolate-Orders
1456 https://www.bitget.com/api-doc/uta/websocket/private/Order-Channel
1457
1458 :param str symbol: unified market symbol of the market orders were made in
1459 :param int [since]: the earliest time in ms to fetch orders for
1460 :param int [limit]: the maximum number of order structures to retrieve
1461 :param dict [params]: extra parameters specific to the exchange API endpoint
1462 :param boolean [params.trigger]: *contract only* set to True for watching trigger orders
1463 :param str [params.marginMode]: 'isolated' or 'cross' for watching spot margin orders]
1464 :param str [params.type]: 'spot', 'swap'
1465 :param str [params.subType]: 'linear', 'inverse'
1466 :param boolean [params.uta]: set to True for the unified trading account(uta), defaults to False
1467 :returns dict[]: a list of `order structures <https://docs.ccxt.com/?id=order-structure>`
1468 """
1469 await self.load_markets()
1470 market = None
1471 marketId = None
1472 isTrigger = None
1473 isTrigger, params = self.is_trigger_order(params)
1474 messageHash = 'triggerOrder' if (isTrigger) else 'order'
1475 subscriptionHash = 'order:trades'
1476 if symbol is not None:
1477 market = self.market(symbol)
1478 symbol = market['symbol']
1479 marketId = market['id']
1480 messageHash = messageHash + ':' + symbol
1481 uta = None
1482 uta, params = self.handle_option_and_params(params, 'watchOrders', 'uta', False)
1483 productType = self.safe_string(params, 'productType')
1484 type = None
1485 type, params = self.handle_market_type_and_params('watchOrders', market, params)
1486 subType = None
1487 subType, params = self.handle_sub_type_and_params('watchOrders', market, params, 'linear')
1488 if (type == 'spot' or type == 'margin') and (symbol is None):
1489 marketId = 'default'
1490 if (productType is None) and (type != 'spot') and (symbol is None):
1491 messageHash = messageHash + ':' + subType
1492 elif productType == 'USDT-FUTURES':
1493 messageHash = messageHash + ':linear'
1494 elif productType == 'COIN-FUTURES':
1495 messageHash = messageHash + ':inverse'
1496 elif productType == 'USDC-FUTURES':
1497 messageHash = messageHash + ':usdcfutures' # non unified channel
1498 instType = None
1499 if market is None and type == 'spot':
1500 instType = 'SPOT'
1501 else:
1502 instType, params = self.get_inst_type('watchOrders', market, uta, params)
1503 if type == 'spot' and (symbol is not None):

Callers

nothing calls this directly

Calls 13

get_inst_typeMethod · 0.95
watch_privateMethod · 0.95
is_trigger_orderMethod · 0.80
safe_stringMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected