* @method * @name pacifica#editOrder * @description edit a trade order * @see https://docs.pacifica.fi/api-documentation/api/rest-api/orders/edit-order * @param {string} id edit order id * @param {string} symbol unified symbol of the market to edit an order in * @param
(id, symbol, type, side, amount = undefined, price = undefined, params = {})
| 1763 | * @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure} |
| 1764 | */ |
| 1765 | async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) { |
| 1766 | await this.loadMarkets(); |
| 1767 | await this.initializeClient(); |
| 1768 | const market = this.market(symbol); |
| 1769 | const request = this.editOrderRequest(id, symbol, type, side, amount, price, market, params); |
| 1770 | params = this.omit(params, ['expiryWindow', 'clientOrderId']); |
| 1771 | const response = await this.privatePostOrdersEdit(this.extend(request, params)); |
| 1772 | // |
| 1773 | // { |
| 1774 | // 'data': { |
| 1775 | // "order_id": 123498765 |
| 1776 | // } |
| 1777 | // } |
| 1778 | // |
| 1779 | const data = this.safeDict(response, 'data', {}); |
| 1780 | const orderId = this.safeString(data, 'order_id'); |
| 1781 | return this.safeOrder({ 'id': orderId, 'info': response, 'symbol': symbol }); |
| 1782 | } |
| 1783 | editOrderRequest(id, symbol, type, side, amount, price, market, params = {}) { |
| 1784 | if (amount === undefined) { |
| 1785 | throw new ArgumentsRequired(this.id + ' editOrder() requires an amount!'); |
nothing calls this directly
no test coverage detected