fetch an open order by the id https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order https://develope
(self, id: str, symbol: Str = None, params={})
| 7117 | return self.parse_orders(response, market, since, limit) |
| 7118 | |
| 7119 | def fetch_open_order(self, id: str, symbol: Str = None, params={}): |
| 7120 | """ |
| 7121 | fetch an open order by the id |
| 7122 | |
| 7123 | https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order |
| 7124 | https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order |
| 7125 | https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order |
| 7126 | https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order |
| 7127 | https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order |
| 7128 | https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order |
| 7129 | |
| 7130 | :param str id: order id |
| 7131 | :param str symbol: unified market symbol |
| 7132 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 7133 | :param str [params.trigger]: set to True if you would like to fetch portfolio margin account stop or conditional orders |
| 7134 | :param boolean [params.portfolioMargin]: set to True if you would like to fetch for a portfolio margin account |
| 7135 | :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 7136 | """ |
| 7137 | if symbol is None: |
| 7138 | raise ArgumentsRequired(self.id + ' fetchOpenOrder() requires a symbol argument') |
| 7139 | self.load_markets() |
| 7140 | market = self.market(symbol) |
| 7141 | request = { |
| 7142 | 'symbol': market['id'], |
| 7143 | } |
| 7144 | isPortfolioMargin = None |
| 7145 | isPortfolioMargin, params = self.handle_option_and_params_2(params, 'fetchOpenOrder', 'papi', 'portfolioMargin', False) |
| 7146 | isConditional = self.safe_bool_n(params, ['stop', 'trigger', 'conditional']) |
| 7147 | params = self.omit(params, ['stop', 'trigger', 'conditional']) |
| 7148 | isPortfolioMarginConditional = (isPortfolioMargin and isConditional) |
| 7149 | orderIdRequest = 'strategyId' if isPortfolioMarginConditional else 'orderId' |
| 7150 | request[orderIdRequest] = id |
| 7151 | response = None |
| 7152 | if market['linear']: |
| 7153 | if isPortfolioMargin: |
| 7154 | if isConditional: |
| 7155 | response = self.papiGetUmConditionalOpenOrder(self.extend(request, params)) |
| 7156 | else: |
| 7157 | response = self.papiGetUmOpenOrder(self.extend(request, params)) |
| 7158 | else: |
| 7159 | response = self.fapiPrivateGetOpenOrder(self.extend(request, params)) |
| 7160 | elif market['inverse']: |
| 7161 | if isPortfolioMargin: |
| 7162 | if isConditional: |
| 7163 | response = self.papiGetCmConditionalOpenOrder(self.extend(request, params)) |
| 7164 | else: |
| 7165 | response = self.papiGetCmOpenOrder(self.extend(request, params)) |
| 7166 | else: |
| 7167 | response = self.dapiPrivateGetOpenOrder(self.extend(request, params)) |
| 7168 | else: |
| 7169 | if market['option']: |
| 7170 | raise NotSupported(self.id + ' fetchOpenOrder() does not support option markets') |
| 7171 | elif market['spot']: |
| 7172 | raise NotSupported(self.id + ' fetchOpenOrder() does not support spot markets') |
| 7173 | # |
| 7174 | # linear swap |
| 7175 | # |
| 7176 | # { |
nothing calls this directly
no test coverage detected