create a list of trade orders. It is supports only limit orders and have a random jitter ~100-300ms! https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order :param Array orders: list of orders to create, each object should contain the parameters required
(self, orders: List[OrderRequest], params={})
| 1437 | return self.batch_orders_request(actions) |
| 1438 | |
| 1439 | async def create_orders(self, orders: List[OrderRequest], params={}): |
| 1440 | """ |
| 1441 | create a list of trade orders. It is supports only limit orders and have a random jitter ~100-300ms! |
| 1442 | |
| 1443 | https://docs.pacifica.fi/api-documentation/api/rest-api/orders/batch-order |
| 1444 | |
| 1445 | :param Array orders: list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type(optional or 'limit'), side, amount, price and params |
| 1446 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 1447 | :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>` |
| 1448 | """ |
| 1449 | await self.load_markets() |
| 1450 | await self.initialize_client() |
| 1451 | request = self.create_orders_request(orders) |
| 1452 | response = await self.privatePostOrdersBatch(self.extend(request, params)) |
| 1453 | # { |
| 1454 | # "success": True, |
| 1455 | # "data": { |
| 1456 | # "results": [ |
| 1457 | # { |
| 1458 | # "success": True, |
| 1459 | # "order_id": 470506, |
| 1460 | # "error": null |
| 1461 | # }, |
| 1462 | # { |
| 1463 | # "success": True, |
| 1464 | # } |
| 1465 | # ] |
| 1466 | # }, |
| 1467 | # "error": null, |
| 1468 | # "code": null |
| 1469 | # } |
| 1470 | # |
| 1471 | data = self.safe_dict(response, 'data', {}) |
| 1472 | results = self.safe_list(data, 'results', []) |
| 1473 | ordersToReturn = [] |
| 1474 | for i in range(0, len(results)): |
| 1475 | order = results[i] |
| 1476 | error = self.safe_string(order, 'error', None) |
| 1477 | success = self.safe_bool(order, 'success', False) |
| 1478 | status = None |
| 1479 | if (error is not None) or (not success): |
| 1480 | status = 'rejected' |
| 1481 | else: |
| 1482 | status = 'open' |
| 1483 | orderId = self.safe_string(order, 'order_id') |
| 1484 | ordersToReturn.append(self.safe_order({'info': order, 'id': orderId, 'status': status})) |
| 1485 | return ordersToReturn |
| 1486 | |
| 1487 | async def cancel_orders(self, ids: List[str], symbol: Str = None, params={}): |
| 1488 | """ |
nothing calls this directly
no test coverage detected