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

Method editOrder

js/src/gate.js:4799–4843  ·  view source on GitHub ↗

* @method * @name gate#editOrder * @description edit a trade order, gate currently only supports the modification of the price or amount fields * @see https://www.gate.com/docs/developers/apiv4/en/#amend-single-order * @see https://www.gate.com/docs/developers/apiv4/en/#amend-sin

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

Source from the content-addressed store, hash-verified

4797 * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
4798 */
4799 async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
4800 await this.loadMarkets();
4801 await this.loadUnifiedStatus();
4802 const market = this.market(symbol);
4803 const extendedRequest = this.editOrderRequest(id, symbol, type, side, amount, price, params);
4804 let response;
4805 if (market['spot']) {
4806 response = await this.privateSpotPatchOrdersOrderId(extendedRequest);
4807 }
4808 else {
4809 response = await this.privateFuturesPutSettleOrdersOrderId(extendedRequest);
4810 }
4811 //
4812 // {
4813 // "id": "243233276443",
4814 // "text": "apiv4",
4815 // "create_time": "1670908873",
4816 // "update_time": "1670914102",
4817 // "create_time_ms": 1670908873077,
4818 // "update_time_ms": 1670914102241,
4819 // "status": "open",
4820 // "currency_pair": "ADA_USDT",
4821 // "type": "limit",
4822 // "account": "spot",
4823 // "side": "sell",
4824 // "amount": "10",
4825 // "price": "0.6",
4826 // "time_in_force": "gtc",
4827 // "iceberg": "0",
4828 // "left": "10",
4829 // "fill_price": "0",
4830 // "filled_total": "0",
4831 // "fee": "0",
4832 // "fee_currency": "USDT",
4833 // "point_fee": "0",
4834 // "gt_fee": "0",
4835 // "gt_maker_fee": "0",
4836 // "gt_taker_fee": "0",
4837 // "gt_discount": false,
4838 // "rebated_fee": "0",
4839 // "rebated_fee_currency": "ADA"
4840 // }
4841 //
4842 return this.parseOrder(response, market);
4843 }
4844 parseOrderStatus(status) {
4845 const statuses = {
4846 'open': 'open',

Callers

nothing calls this directly

Calls 7

loadUnifiedStatusMethod · 0.95
editOrderRequestMethod · 0.95
parseOrderMethod · 0.95
loadMarketsMethod · 0.45
marketMethod · 0.45

Tested by

no test coverage detected