use of org.knowm.xchange.okcoin.v3.dto.trade.OrderCancellationResponse in project XChange by knowm.
the class OkexTradeService method cancelOrder.
@Override
public boolean cancelOrder(CancelOrderParams orderParams) throws IOException {
if (!(orderParams instanceof CancelOrderByIdParams) || !(orderParams instanceof CancelOrderByCurrencyPair)) {
throw new UnsupportedOperationException("Cancelling an order is only available for a single market and a single id.");
}
String id = ((CancelOrderByIdParams) orderParams).getOrderId();
String instrumentId = OkexAdaptersV3.toSpotInstrument(((CancelOrderByCurrencyPair) orderParams).getCurrencyPair());
OrderCancellationRequest req = OrderCancellationRequest.builder().instrumentId(instrumentId).build();
OrderCancellationResponse o = spotCancelOrder(id, req);
return true;
}
use of org.knowm.xchange.okcoin.v3.dto.trade.OrderCancellationResponse in project XChange by knowm.
the class OkexTradeServiceRaw method spotCancelOrder.
public OrderCancellationResponse spotCancelOrder(String orderId, OrderCancellationRequest req) throws IOException {
OrderCancellationResponse res = okex.spotCancelOrder(apikey, digest, timestamp(), passphrase, orderId, req);
res.checkResult();
return res;
}
use of org.knowm.xchange.okcoin.v3.dto.trade.OrderCancellationResponse in project XChange by knowm.
the class OkexTradeServiceRaw method futuresCancelOrder.
public OrderCancellationResponse futuresCancelOrder(String instrumentId, String orderId) throws IOException {
OrderCancellationResponse res = okex.futuresCancelOrder(apikey, digest, timestamp(), passphrase, instrumentId, orderId);
res.checkResult();
return res;
}
use of org.knowm.xchange.okcoin.v3.dto.trade.OrderCancellationResponse in project XChange by knowm.
the class OkexTradeServiceRaw method swapCancelOrder.
public OrderCancellationResponse swapCancelOrder(String instrumentId, String orderId) throws IOException {
OrderCancellationResponse res = okex.swapCancelOrder(apikey, digest, timestamp(), passphrase, instrumentId, orderId);
res.checkResult();
return res;
}
Aggregations