hitbtc-com / hitbtc-api

HitBTC API
GNU Lesser General Public License v3.0
324 stars 153 forks source link

canceled response to cancelReplace request #125

Closed alexanderborsch closed 6 years ago

alexanderborsch commented 6 years ago

Request: {'params': {'clientOrderId': 'ryaKWfF3EVfBALaWQvnAwaYt9rn5Zlkj', 'requestClientId': 'Nuf3tycefJrVCZuXOOSHxG8O60SoO1AH', 'price': 5.077559999999999, 'quantity': 2.73}, 'method': 'cancelReplaceOrder', 'id': 15181913629473} Response: {u'jsonrpc': u'2.0', u'result': {u'status': u'canceled', u'clientOrderId': u'ryaKWfF3EVfBALaWQvnAwaYt9rn5Zlkj', u'cumQuantity': u'0.00', u'symbol': u'BNTUSD', u'side': u'buy', u'timeInForce': u'GTC', u'reportType': u'canceled', u'updatedAt': u'2018-02-09T15:49:22.956Z', u'price': u'5.07754', u'type': u'limit', u'id': u'16486022697', u'createdAt': u'2018-02-09T15:49:15.100Z', u'quantity': u'0.76'}, u'id': 15181913629473}

hitbtc-com commented 6 years ago

If, for example, you don't have enough money for order with new quantity and price, then origin order canceled. "cancelReplace" - request first cancel origin order and replace it (if it can be available) new order cumQuantity inherited origin order. Also cancel and place new order - atomic operation