(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={})
| 5353 | return self.extend(request, params) |
| 5354 | |
| 5355 | def edit_contract_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}): |
| 5356 | if (price is None) and not ('priceMatch' in params): |
| 5357 | # moved here from editContractOrder for warning in case of calling editOrderWs() without price argument for swap orders |
| 5358 | raise ArgumentsRequired(self.id + ' editOrder() and editOrderWs() require a price argument for swap orders') |
| 5359 | market = self.market(symbol) |
| 5360 | if not market['contract']: |
| 5361 | raise NotSupported(self.id + ' editContractOrder() does not support ' + market['type'] + ' orders') |
| 5362 | request = { |
| 5363 | 'symbol': market['id'], |
| 5364 | 'side': side.upper(), |
| 5365 | 'orderId': id, |
| 5366 | 'quantity': self.amount_to_precision(symbol, amount), |
| 5367 | } |
| 5368 | clientOrderId = self.safe_string_n(params, ['newClientOrderId', 'clientOrderId', 'origClientOrderId']) |
| 5369 | if price is not None: |
| 5370 | request['price'] = self.price_to_precision(symbol, price) |
| 5371 | if clientOrderId is not None: |
| 5372 | request['origClientOrderId'] = clientOrderId |
| 5373 | params = self.omit(params, ['clientOrderId', 'newClientOrderId']) |
| 5374 | return request |
| 5375 | |
| 5376 | async def edit_contract_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}): |
| 5377 | """ |
no test coverage detected