(orders, params = {})
| 1472 | }; |
| 1473 | } |
| 1474 | createOrdersRequest(orders, params = {}) { |
| 1475 | const actions = []; |
| 1476 | const timestamp = this.milliseconds(); // unified sequence |
| 1477 | for (let i = 0; i < orders.length; i++) { |
| 1478 | const order = orders[i]; |
| 1479 | const symbol = this.safeString(order, 'symbol'); |
| 1480 | const side = this.safeString(order, 'side'); |
| 1481 | const price = this.safeString(order, 'price'); |
| 1482 | const type = this.safeString(order, 'type', 'limit'); |
| 1483 | const orderParams = this.safeDict(order, 'params', {}); |
| 1484 | orderParams['timestamp'] = timestamp; |
| 1485 | const amount = this.safeString(order, 'amount'); |
| 1486 | const amountNumber = this.parseNumber(amount); |
| 1487 | const priceNumber = this.parseNumber(price); |
| 1488 | if (type !== 'limit') { |
| 1489 | throw new NotSupported(this.id + ' createOrders() supports only type = "limit"! Your value type=' + type); |
| 1490 | } |
| 1491 | const requestList = this.createOrderRequest(symbol, type, side, amountNumber, priceNumber, orderParams); |
| 1492 | const action = { |
| 1493 | 'type': 'Create', |
| 1494 | 'data': requestList[0], |
| 1495 | }; |
| 1496 | actions.push(action); |
| 1497 | } |
| 1498 | return this.batchOrdersRequest(actions); |
| 1499 | } |
| 1500 | /** |
| 1501 | * @method |
| 1502 | * @name pacifica#createOrders |
no test coverage detected