(id: string, symbol: string, amount: number, price: Num = undefined, params = {})
| 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 |
no test coverage detected