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

Method createOrderWs

js/src/pro/gate.js:165–178  ·  view source on GitHub ↗

* @method * @name gate#createOrderWs * @see https://www.gate.io/docs/developers/apiv4/ws/en/#order-place * @see https://www.gate.io/docs/developers/futures/ws/en/#order-place * @description Create an order on the exchange * @param {string} symbol Unified CCXT market symbol

(symbol, type, side, amount, price = undefined, params = {})

Source from the content-addressed store, hash-verified

163 * @returns {object|undefined} [An order structure]{@link https://docs.ccxt.com/?id=order-structure}
164 */
165 async createOrderWs(symbol, type, side, amount, price = undefined, params = {}) {
166 await this.loadMarkets();
167 const market = this.market(symbol);
168 symbol = market['symbol'];
169 const messageType = this.getTypeByMarket(market);
170 const channel = messageType + '.order_place';
171 const url = this.getUrlByMarket(market);
172 params['textIsRequired'] = true;
173 const request = this.createOrderRequest(symbol, type, side, amount, price, params);
174 await this.authenticate(url, messageType);
175 const rawOrder = await this.requestPrivate(url, request, channel);
176 const order = this.parseOrder(rawOrder, market);
177 return order;
178 }
179 /**
180 * @method
181 * @name gate#createOrdersWs

Callers

nothing calls this directly

Calls 8

getTypeByMarketMethod · 0.95
getUrlByMarketMethod · 0.95
createOrderRequestMethod · 0.95
authenticateMethod · 0.95
requestPrivateMethod · 0.95
parseOrderMethod · 0.95
loadMarketsMethod · 0.45
marketMethod · 0.45

Tested by

no test coverage detected