use of org.knowm.xchange.service.trade.params.orders.OpenOrdersParamInstrument in project XChange by knowm.
the class DeribitTradeService method getOpenOrders.
@Override
public OpenOrders getOpenOrders(OpenOrdersParams params) throws IOException {
List<org.knowm.xchange.deribit.v2.dto.trade.Order> openOrders;
if (params instanceof OpenOrdersParamCurrencyPair) {
OpenOrdersParamCurrencyPair pairParams = (OpenOrdersParamCurrencyPair) params;
CurrencyPair pair = pairParams.getCurrencyPair();
openOrders = super.getOpenOrdersByCurrency(pair.base.getCurrencyCode(), null, null);
} else if (params instanceof OpenOrdersParamInstrument) {
OpenOrdersParamInstrument instrumentParams = (OpenOrdersParamInstrument) params;
Instrument instrument = instrumentParams.getInstrument();
openOrders = super.getOpenOrdersByInstrument(DeribitAdapters.adaptInstrumentName(instrument), null);
} else {
openOrders = openOrders();
}
return DeribitAdapters.adaptOpenOrders(openOrders);
}
Aggregations