fetches information on an order made by the user https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-order-detail :param str id: order id :param str symbol: unified symbol of the market the order was made in :param dict [params]: ext
(self, id: str, symbol: Str = None, params={})
| 1252 | return self.parse_balance(response) |
| 1253 | |
| 1254 | def fetch_order(self, id: str, symbol: Str = None, params={}): |
| 1255 | """ |
| 1256 | fetches information on an order made by the user |
| 1257 | |
| 1258 | https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-order-detail |
| 1259 | |
| 1260 | :param str id: order id |
| 1261 | :param str symbol: unified symbol of the market the order was made in |
| 1262 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 1263 | :returns dict: An `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 1264 | """ |
| 1265 | self.load_markets() |
| 1266 | market = None |
| 1267 | if symbol is not None: |
| 1268 | market = self.market(symbol) |
| 1269 | request = { |
| 1270 | 'order_id': id, |
| 1271 | } |
| 1272 | response = self.v1PrivatePostPrivateGetOrderDetail(self.extend(request, params)) |
| 1273 | # |
| 1274 | # { |
| 1275 | # "id": 1686872583882, |
| 1276 | # "method": "private/get-order-detail", |
| 1277 | # "code": 0, |
| 1278 | # "result": { |
| 1279 | # "account_id": "ae075bef-1234-4321-bd6g-bb9007252a63", |
| 1280 | # "order_id": "6142909895025252686", |
| 1281 | # "client_oid": "CCXT_c2d2152cc32d40a3ae7fbf", |
| 1282 | # "order_type": "LIMIT", |
| 1283 | # "time_in_force": "GOOD_TILL_CANCEL", |
| 1284 | # "side": "BUY", |
| 1285 | # "exec_inst": [], |
| 1286 | # "quantity": "0.00020", |
| 1287 | # "limit_price": "20000.00", |
| 1288 | # "order_value": "4", |
| 1289 | # "avg_price": "0", |
| 1290 | # "trigger_price": "0", |
| 1291 | # "ref_price": "0", |
| 1292 | # "cumulative_quantity": "0", |
| 1293 | # "cumulative_value": "0", |
| 1294 | # "cumulative_fee": "0", |
| 1295 | # "status": "ACTIVE", |
| 1296 | # "update_user_id": "ae075bef-1234-4321-bd6g-bb9007252a63", |
| 1297 | # "order_date": "2023-06-15", |
| 1298 | # "instrument_name": "BTC_USD", |
| 1299 | # "fee_instrument_name": "BTC", |
| 1300 | # "create_time": 1686870220684, |
| 1301 | # "create_time_ns": "1686870220684239675", |
| 1302 | # "update_time": 1686870220684 |
| 1303 | # } |
| 1304 | # } |
| 1305 | # |
| 1306 | order = self.safe_dict(response, 'result', {}) |
| 1307 | return self.parse_order(order, market) |
| 1308 | |
| 1309 | def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}): |
| 1310 | market = self.market(symbol) |
nothing calls this directly
no test coverage detected