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

Method editOrderRequest

js/src/pacifica.js:1783–1810  ·  view source on GitHub ↗
(id, symbol, type, side, amount, price, market, params = {})

Source from the content-addressed store, hash-verified

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!');
1786 }
1787 if (price === undefined) {
1788 throw new ArgumentsRequired(this.id + ' editOrder() requires a price');
1789 }
1790 const operationType = 'edit_order';
1791 const clientOrderId = this.safeString(params, 'clientOrderId');
1792 const priceNormalized = this.priceToPrecision(symbol, price);
1793 const amountNormalized = this.amountToPrecision(symbol, amount);
1794 const sigPayload = {
1795 'symbol': this.safeString(market, 'id'),
1796 'price': priceNormalized,
1797 'amount': amountNormalized,
1798 };
1799 if ((clientOrderId === undefined) && (id === undefined)) {
1800 throw new ArgumentsRequired('this.id' + 'editOrder() requires either "id" or "clientOrderId"');
1801 }
1802 if (clientOrderId !== undefined) {
1803 sigPayload['client_order_id'] = clientOrderId;
1804 }
1805 else {
1806 sigPayload['order_id'] = this.parseToInt(id);
1807 }
1808 const request = this.postActionRequest(operationType, sigPayload, params);
1809 return request;
1810 }
1811 /**
1812 * @method
1813 * @name pacifica#fetchFundingRateHistory

Callers 2

editOrderMethod · 0.95
editOrderWsMethod · 0.95

Calls 5

postActionRequestMethod · 0.95
safeStringMethod · 0.45
priceToPrecisionMethod · 0.45
amountToPrecisionMethod · 0.45
parseToIntMethod · 0.45

Tested by

no test coverage detected