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

Method fetch_order_classic

python/ccxt/bybit.py:4868–4896  ·  view source on GitHub ↗

fetches information on an order made by the user *classic accounts only* https://bybit-exchange.github.io/docs/v5/order/order-list :param str id: the order id :param str symbol: unified symbol of the market the order was made in :param dict [params]: extra

(self, id: str, symbol: Str = None, params={})

Source from the content-addressed store, hash-verified

4866 return self.parse_orders(orders, market)
4867
4868 def fetch_order_classic(self, id: str, symbol: Str = None, params={}) -> Order:
4869 """
4870 fetches information on an order made by the user *classic accounts only*
4871
4872 https://bybit-exchange.github.io/docs/v5/order/order-list
4873
4874 :param str id: the order id
4875 :param str symbol: unified symbol of the market the order was made in
4876 :param dict [params]: extra parameters specific to the exchange API endpoint
4877 :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>`
4878 """
4879 if symbol is None:
4880 raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
4881 self.load_markets()
4882 market = self.market(symbol)
4883 if market['spot']:
4884 raise NotSupported(self.id + ' fetchOrder() is not supported for spot markets')
4885 request = {
4886 'orderId': id,
4887 }
4888 result = self.fetch_orders(symbol, None, None, self.extend(request, params))
4889 length = len(result)
4890 if length == 0:
4891 isTrigger = self.safe_bool_n(params, ['trigger', 'stop'], False)
4892 extra = '' if isTrigger else ' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
4893 raise OrderNotFound('Order ' + str(id) + ' was not found.' + extra)
4894 if length > 1:
4895 raise InvalidOrder(self.id + ' returned more than one order')
4896 return self.safe_value(result, 0)
4897
4898 def fetch_order(self, id: str, symbol: Str = None, params={}) -> Order:
4899 """

Callers 1

fetch_orderMethod · 0.95

Calls 10

fetch_ordersMethod · 0.95
ArgumentsRequiredClass · 0.90
NotSupportedClass · 0.90
OrderNotFoundClass · 0.90
InvalidOrderClass · 0.90
safe_bool_nMethod · 0.80
safe_valueMethod · 0.80
load_marketsMethod · 0.45
marketMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected