use of org.knowm.xchange.exx.dto.params.EXXCancelOrderByCurrencyPair in project XChange by knowm.
the class EXXTradeService method cancelOrder.
@Override
public boolean cancelOrder(CancelOrderParams cancelOrderParams) throws IOException {
if (!(cancelOrderParams instanceof CancelOrderParams) && !(cancelOrderParams instanceof EXXCancelOrderByCurrencyPair)) {
throw new ExchangeException("You need to provide the currency pair and the order id to cancel an order.");
}
EXXCancelOrderByCurrencyPair params = (EXXCancelOrderByCurrencyPair) cancelOrderParams;
CurrencyPair currencyPair = params.getCurrencyPair();
// etp_btc
String currency = currencyPairFormat(currencyPair);
return cancelExxOrder(params.getId(), currency);
}
use of org.knowm.xchange.exx.dto.params.EXXCancelOrderByCurrencyPair in project XChange by knowm.
the class TradeServiceIntegration method cancelOrder.
private static void cancelOrder() throws IOException {
Exchange exx = getExchange();
TradeService tradeService = exx.getTradeService();
try {
EXXCancelOrderByCurrencyPair exxCancelOrderByCurrencyPair = new EXXCancelOrderByCurrencyPair();
exxCancelOrderByCurrencyPair.setCurrencyPair(CurrencyPair.ETH_BTC);
exxCancelOrderByCurrencyPair.setId("634");
boolean result = tradeService.cancelOrder(exxCancelOrderByCurrencyPair);
System.out.println("cancelOrder result: " + result);
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations