MCPcopy Create free account
hub / github.com/ccxt/ccxt / createOrdersRequest

Method createOrdersRequest

js/src/pacifica.js:1474–1499  ·  view source on GitHub ↗
(orders, params = {})

Source from the content-addressed store, hash-verified

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

Callers 1

createOrdersMethod · 0.95

Calls 7

createOrderRequestMethod · 0.95
batchOrdersRequestMethod · 0.95
pushMethod · 0.80
millisecondsMethod · 0.45
safeStringMethod · 0.45
safeDictMethod · 0.45
parseNumberMethod · 0.45

Tested by

no test coverage detected