org.knowm.xchange.exx.service.EXXMarketDataServiceRaw Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-exx Show documentation
Show all versions of xchange-exx Show documentation
Development fork. Not for general use.
package org.knowm.xchange.exx.service;
import java.io.IOException;
import java.util.Map;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.exx.EXX;
import org.knowm.xchange.exx.EXXAdapters;
import org.knowm.xchange.exx.dto.marketdata.EXXOrderbook;
import org.knowm.xchange.exx.dto.marketdata.EXXTicker;
import org.knowm.xchange.exx.dto.marketdata.EXXTickerResponse;
import org.knowm.xchange.exx.dto.marketdata.EXXTransaction;
import si.mazi.rescu.RestProxyFactory;
import si.mazi.rescu.SynchronizedValueFactory;
public class EXXMarketDataServiceRaw extends EXXBaseService {
private final EXX exx;
private String apiKey;
private String secretKey;
private SynchronizedValueFactory nonceFactory;
public EXXMarketDataServiceRaw(Exchange exchange) {
super(exchange);
this.exx =
RestProxyFactory.createProxy(
EXX.class, exchange.getExchangeSpecification().getSslUri(), getClientConfig());
this.apiKey = super.apiKey;
this.secretKey = super.secretKey;
this.nonceFactory = exchange.getNonceFactory();
}
/**
* @return Object
* @throws IOException
*/
public EXXOrderbook getExxOrderBook(CurrencyPair currencyPair) throws IOException {
return exx.getOrderBook(EXXAdapters.toSymbol(currencyPair));
}
/**
* getEXXTicker
*
* @return Object
* @throws IOException
*/
public EXXTickerResponse getExxTicker(CurrencyPair currencyPair) throws IOException {
return exx.getTicker(EXXAdapters.toSymbol(currencyPair));
}
protected Map getExxTickers() throws IOException {
Map data = exx.getTickers();
return data;
}
/**
* @param currencyPair
* @return
* @throws IOException
*/
public EXXTransaction[] getTransactions(CurrencyPair currencyPair) throws IOException {
try {
return exx.getTransactions(EXXAdapters.toSymbol(currencyPair));
} catch (IOException e) {
System.out.println(e.getMessage());
}
return null;
}
}