use of org.knowm.xchange.Exchange in project XChange by knowm.
the class TheRockExampleUtils method createTestExchange.
public static Exchange createTestExchange() {
Exchange exchange = ExchangeFactory.INSTANCE.createExchange(TheRockExchange.class);
exchange.getExchangeSpecification().setApiKey("API Key");
exchange.getExchangeSpecification().setSecretKey("Secret==");
exchange.getExchangeSpecification().setUserName("user");
exchange.applySpecification(exchange.getExchangeSpecification());
return exchange;
}
use of org.knowm.xchange.Exchange in project XChange by knowm.
the class TheRockAccountDemo method main.
public static void main(String[] args) throws IOException {
Exchange loyalbitExchange = TheRockExampleUtils.createTestExchange();
generic(loyalbitExchange);
raw(loyalbitExchange);
}
use of org.knowm.xchange.Exchange in project XChange by knowm.
the class MarketDataServiceIntegration method getTicker.
private static void getTicker() throws IOException {
Exchange exchange = getExchange();
MarketDataService marketDataService = exchange.getMarketDataService();
try {
Ticker coinsuperTicker = marketDataService.getTicker(CurrencyPair.ETH_BTC);
System.out.println("======get ticker======");
System.out.println(coinsuperTicker);
System.out.println("getVolume=" + coinsuperTicker.getVolume());
System.out.println("getTimestamp=" + coinsuperTicker.getTimestamp());
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.knowm.xchange.Exchange in project XChange by knowm.
the class MarketDataServiceIntegration method getTickers.
private static void getTickers() throws IOException {
Exchange exchange = getExchange();
MarketDataService marketDataService = exchange.getMarketDataService();
try {
Params params = null;
List<Ticker> tickers = marketDataService.getTickers(params);
System.out.println("======get tickers======");
System.out.println(tickers);
} catch (IOException e) {
e.printStackTrace();
}
}
use of org.knowm.xchange.Exchange in project XChange by knowm.
the class MarketDataServiceIntegration method getOrderbook.
private static void getOrderbook() throws IOException {
Exchange coinsuper = getExchange();
MarketDataService marketDataService = coinsuper.getMarketDataService();
try {
OrderBook orderBook = marketDataService.getOrderBook(CurrencyPair.ETH_BTC);
System.out.println("Current Order Book size for ETH_USD: " + (orderBook.getAsks().size() + orderBook.getBids().size()));
System.out.println("First Ask: " + orderBook.getAsks().get(0).toString());
System.out.println("Last Ask: " + orderBook.getAsks().get(orderBook.getAsks().size() - 1).toString());
System.out.println("First Bid: " + orderBook.getBids().get(0).toString());
System.out.println("Last Bid: " + orderBook.getBids().get(orderBook.getBids().size() - 1).toString());
System.out.println(orderBook);
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations