cancels an open order https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order :param str id: the order id of the order to cancel :param str [symbol]: unified symbol of the market the order was made in :param dict [params]: extra
(self, id: str, symbol: Str = None, params={})
| 1657 | return [self.safe_order({'info': response})] |
| 1658 | |
| 1659 | def cancel_order(self, id: str, symbol: Str = None, params={}): |
| 1660 | """ |
| 1661 | cancels an open order |
| 1662 | |
| 1663 | https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order |
| 1664 | |
| 1665 | :param str id: the order id of the order to cancel |
| 1666 | :param str [symbol]: unified symbol of the market the order was made in |
| 1667 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 1668 | :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 1669 | """ |
| 1670 | self.load_markets() |
| 1671 | market = None |
| 1672 | if symbol is not None: |
| 1673 | market = self.market(symbol) |
| 1674 | request = { |
| 1675 | 'order_id': id, |
| 1676 | } |
| 1677 | response = self.v1PrivatePostPrivateCancelOrder(self.extend(request, params)) |
| 1678 | # |
| 1679 | # { |
| 1680 | # "id": 1686882846638, |
| 1681 | # "method": "private/cancel-order", |
| 1682 | # "code": 0, |
| 1683 | # "message": "NO_ERROR", |
| 1684 | # "result": { |
| 1685 | # "client_oid": "CCXT_c2d2152cc32d40a3ae7fbf", |
| 1686 | # "order_id": "6142909895025252686" |
| 1687 | # } |
| 1688 | # } |
| 1689 | # |
| 1690 | result = self.safe_dict(response, 'result', {}) |
| 1691 | return self.parse_order(result, market) |
| 1692 | |
| 1693 | def cancel_orders(self, ids: List[str], symbol: Str = None, params={}): |
| 1694 | """ |
nothing calls this directly
no test coverage detected