fetches information on an order made by the user https://www.weex.com/api-doc/spot/orderApi/OrderDetails # spot https://www.weex.com/api-doc/contract/Transaction_API/GetSingleOrderInfo # contract :param str id: order id :param str symbol: unified symbol o
(self, id: Str, symbol: Str = None, params={})
| 2216 | return self.parse_orders(ordersResponse, market, None, None, extendedParams) |
| 2217 | |
| 2218 | def fetch_order(self, id: Str, symbol: Str = None, params={}): |
| 2219 | """ |
| 2220 | fetches information on an order made by the user |
| 2221 | |
| 2222 | https://www.weex.com/api-doc/spot/orderApi/OrderDetails # spot |
| 2223 | https://www.weex.com/api-doc/contract/Transaction_API/GetSingleOrderInfo # contract |
| 2224 | |
| 2225 | :param str id: order id |
| 2226 | :param str symbol: unified symbol of the market the order was made in |
| 2227 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 2228 | :param str [params.type]: 'spot' or 'swap', used if symbol is not provided(default is 'spot') |
| 2229 | :param str [params.clientOrderId]: *spot only* a unique id for the order, used if id is not provided |
| 2230 | :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 2231 | """ |
| 2232 | self.load_markets() |
| 2233 | market = None |
| 2234 | if symbol is not None: |
| 2235 | market = self.market(symbol) |
| 2236 | marketType = None |
| 2237 | marketType, params = self.handle_market_type_and_params('fetchOrder', market, params) |
| 2238 | isSpot = (marketType == 'spot') |
| 2239 | request = {} |
| 2240 | if (id is None) and not isSpot: |
| 2241 | raise ArgumentsRequired(self.id + ' fetchOrder() requires an id argument for non-spot markets') |
| 2242 | clientOrderId = self.safe_string(params, 'clientOrderId') |
| 2243 | params = self.omit(params, 'clientOrderId') |
| 2244 | if clientOrderId is not None: |
| 2245 | request['origClientOrderId'] = clientOrderId |
| 2246 | elif id is None: |
| 2247 | raise ArgumentsRequired(self.id + ' fetchOrder() requires an id argument or clientOrderId parameter for spot markets') |
| 2248 | else: |
| 2249 | request['orderId'] = id |
| 2250 | response = None |
| 2251 | if isSpot: |
| 2252 | # |
| 2253 | # { |
| 2254 | # "symbol": "DOGEUSDT", |
| 2255 | # "orderId": 736800333186991070, |
| 2256 | # "clientOrderId": "082007092f624a18bb7af2ab42e7c8e8", |
| 2257 | # "price": "0.08500", |
| 2258 | # "origQty": "300.0", |
| 2259 | # "executedQty": "0", |
| 2260 | # "cummulativeQuoteQty": "0", |
| 2261 | # "status": "NEW", |
| 2262 | # "timeInForce": "GTC", |
| 2263 | # "type": "LIMIT", |
| 2264 | # "side": "BUY", |
| 2265 | # "time": 1775666888520, |
| 2266 | # "updateTime": 1775666888536, |
| 2267 | # "isWorking": True |
| 2268 | # } |
| 2269 | # |
| 2270 | response = self.privateGetApiV3Order(self.extend(request, params)) |
| 2271 | else: |
| 2272 | response = self.contractPrivateGetCapiV3Order(self.extend(request, params)) |
| 2273 | return self.parse_order(response, market) |
| 2274 | |
| 2275 | def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]: |
nothing calls this directly
no test coverage detected