cancels an open order https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md#cancel-order :param str id: order id :param str symbol: unified symbol of the market the order was made in :param dict [params]: extra parameters specific to the exchange
(self, id: str, symbol: Str = None, params={})
| 923 | return self.parse_order(result, market) |
| 924 | |
| 925 | def cancel_order(self, id: str, symbol: Str = None, params={}): |
| 926 | """ |
| 927 | cancels an open order |
| 928 | |
| 929 | https://github.com/P2B-team/p2b-api-docs/blob/master/api-doc.md#cancel-order |
| 930 | |
| 931 | :param str id: order id |
| 932 | :param str symbol: unified symbol of the market the order was made in |
| 933 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 934 | :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 935 | """ |
| 936 | if symbol is None: |
| 937 | raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument') |
| 938 | self.load_markets() |
| 939 | market = self.market(symbol) |
| 940 | request = { |
| 941 | 'market': market['id'], |
| 942 | 'orderId': id, |
| 943 | } |
| 944 | response = self.privatePostOrderCancel(self.extend(request, params)) |
| 945 | # |
| 946 | # { |
| 947 | # "success": True, |
| 948 | # "errorCode": "", |
| 949 | # "message": "", |
| 950 | # "result": { |
| 951 | # "orderId": 171906478744, |
| 952 | # "market": "ETH_BTC", |
| 953 | # "price": "0.04348", |
| 954 | # "side": "buy", |
| 955 | # "type": "limit", |
| 956 | # "timestamp": 1698484861.746517, |
| 957 | # "dealMoney": "0", |
| 958 | # "dealStock": "0", |
| 959 | # "amount": "0.0277", |
| 960 | # "takerFee": "0.002", |
| 961 | # "makerFee": "0.002", |
| 962 | # "left": "0.0277", |
| 963 | # "dealFee": "0" |
| 964 | # } |
| 965 | # } |
| 966 | # |
| 967 | result = self.safe_dict(response, 'result') |
| 968 | return self.parse_order(result) |
| 969 | |
| 970 | def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}): |
| 971 | """ |
nothing calls this directly
no test coverage detected