edit a trade order, gate currently only supports the modification of the price or amount fields https://www.gate.com/docs/developers/apiv4/en/#amend-single-order https://www.gate.com/docs/developers/apiv4/en/#amend-single-order-2 :param str id: order id :pa
(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={})
| 4537 | return self.extend(request, params) |
| 4538 | |
| 4539 | def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}): |
| 4540 | """ |
| 4541 | edit a trade order, gate currently only supports the modification of the price or amount fields |
| 4542 | |
| 4543 | https://www.gate.com/docs/developers/apiv4/en/#amend-single-order |
| 4544 | https://www.gate.com/docs/developers/apiv4/en/#amend-single-order-2 |
| 4545 | |
| 4546 | :param str id: order id |
| 4547 | :param str symbol: unified symbol of the market to create an order in |
| 4548 | :param str type: 'market' or 'limit' |
| 4549 | :param str side: 'buy' or 'sell' |
| 4550 | :param float amount: how much of the currency you want to trade in units of the base currency |
| 4551 | :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| 4552 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 4553 | :param bool [params.unifiedAccount]: set to True for editing an order in a unified account |
| 4554 | :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 4555 | """ |
| 4556 | self.load_markets() |
| 4557 | self.load_unified_status() |
| 4558 | market = self.market(symbol) |
| 4559 | extendedRequest = self.edit_order_request(id, symbol, type, side, amount, price, params) |
| 4560 | response: dict |
| 4561 | if market['spot']: |
| 4562 | response = self.privateSpotPatchOrdersOrderId(extendedRequest) |
| 4563 | else: |
| 4564 | response = self.privateFuturesPutSettleOrdersOrderId(extendedRequest) |
| 4565 | # |
| 4566 | # { |
| 4567 | # "id": "243233276443", |
| 4568 | # "text": "apiv4", |
| 4569 | # "create_time": "1670908873", |
| 4570 | # "update_time": "1670914102", |
| 4571 | # "create_time_ms": 1670908873077, |
| 4572 | # "update_time_ms": 1670914102241, |
| 4573 | # "status": "open", |
| 4574 | # "currency_pair": "ADA_USDT", |
| 4575 | # "type": "limit", |
| 4576 | # "account": "spot", |
| 4577 | # "side": "sell", |
| 4578 | # "amount": "10", |
| 4579 | # "price": "0.6", |
| 4580 | # "time_in_force": "gtc", |
| 4581 | # "iceberg": "0", |
| 4582 | # "left": "10", |
| 4583 | # "fill_price": "0", |
| 4584 | # "filled_total": "0", |
| 4585 | # "fee": "0", |
| 4586 | # "fee_currency": "USDT", |
| 4587 | # "point_fee": "0", |
| 4588 | # "gt_fee": "0", |
| 4589 | # "gt_maker_fee": "0", |
| 4590 | # "gt_taker_fee": "0", |
| 4591 | # "gt_discount": False, |
| 4592 | # "rebated_fee": "0", |
| 4593 | # "rebated_fee_currency": "ADA" |
| 4594 | # } |
| 4595 | # |
| 4596 | return self.parse_order(response, market) |
nothing calls this directly
no test coverage detected