MCPcopy Index your code
hub / github.com/ccxt/node-binance-api / deliveryOrder

Function deliveryOrder

deprecated/node-binance-api.js:530–554  ·  view source on GitHub ↗
(side, symbol, quantity, price = false, params = {})

Source from the content-addressed store, hash-verified

528 return promiseRequest('v1/order', params, { base: fapi, type: 'TRADE', method: 'POST' });
529 };
530 const deliveryOrder = async (side, symbol, quantity, price = false, params = {}) => {
531 params.symbol = symbol;
532 params.side = side;
533 params.quantity = quantity;
534 // if in the binance futures setting Hedged mode is active, positionSide parameter is mandatory
535 if (Binance.options.hedgeMode) {
536 params.positionSide = side === 'BUY' ? 'LONG' : 'SHORT';
537 }
538 // LIMIT STOP MARKET STOP_MARKET TAKE_PROFIT TAKE_PROFIT_MARKET
539 // reduceOnly stopPrice
540 if (price) {
541 params.price = price;
542 if (typeof params.type === 'undefined') params.type = 'LIMIT';
543 } else {
544 if (typeof params.type === 'undefined') params.type = 'MARKET';
545 }
546 if (!params.timeInForce && (params.type.includes('LIMIT') || params.type === 'STOP' || params.type === 'TAKE_PROFIT')) {
547 params.timeInForce = 'GTX'; // Post only by default. Use GTC for limit orders.
548 }
549
550 if (!params.newClientOrderId) {
551 params.newClientOrderId = CONTRACT_PREFIX + uuid22();
552 }
553 return promiseRequest('v1/order', params, { base: dapi, type: 'TRADE', method: 'POST' });
554 };
555 const promiseRequest = async (url, data = {}, flags = {}) => {
556 return new Promise((resolve, reject) => {
557 let query = '', headers = {

Callers 1

apiFunction · 0.85

Calls 2

uuid22Function · 0.85
promiseRequestFunction · 0.85

Tested by

no test coverage detected