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

Method editOrderRequest

ts/src/cryptocom.ts:1684–1703  ·  view source on GitHub ↗
(id: string, symbol: string, amount: number, price: Num = undefined, params = {})

Source from the content-addressed store, hash-verified

1682 }
1683
1684 editOrderRequest (id: string, symbol: string, amount: number, price: Num = undefined, params = {}) {
1685 const request: Dict = {};
1686 if (id !== undefined) {
1687 request['order_id'] = id;
1688 } else {
1689 const originalClientOrderId = this.safeString2 (params, 'orig_client_oid', 'clientOrderId');
1690 if (originalClientOrderId === undefined) {
1691 throw new ArgumentsRequired (this.id + ' editOrder() requires an id argument or orig_client_oid parameter');
1692 } else {
1693 request['orig_client_oid'] = originalClientOrderId;
1694 params = this.omit (params, [ 'orig_client_oid', 'clientOrderId' ]);
1695 }
1696 }
1697 if ((amount === undefined) || (price === undefined)) {
1698 throw new ArgumentsRequired (this.id + ' editOrder() requires both amount and price arguments. If you do not want to change the amount or price, you should pass the original values');
1699 }
1700 request['new_quantity'] = this.amountToPrecision (symbol, amount);
1701 request['new_price'] = this.priceToPrecision (symbol, price);
1702 return this.extend (request, params);
1703 }
1704
1705 /**
1706 * @method

Callers 2

editOrderMethod · 0.95
editOrderWsMethod · 0.95

Calls 5

safeString2Method · 0.45
omitMethod · 0.45
amountToPrecisionMethod · 0.45
priceToPrecisionMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected