use of org.knowm.xchange.Exchange in project XChange by knowm.
the class InteractiveAuthenticatedExchange method createInstanceFromDefaultInput.
public static Exchange createInstanceFromDefaultInput() {
Exchange mercadoBitcoin = ExchangeFactory.INSTANCE.createExchange(MercadoBitcoinExchange.class);
ExchangeSpecification exchangeSpecification = mercadoBitcoin.getExchangeSpecification();
Scanner s = new Scanner(System.in);
System.out.println("Enter your API key (chave):");
exchangeSpecification.setApiKey(s.next().trim().toLowerCase());
System.out.println("Enter your secret code (código):");
exchangeSpecification.setSecretKey(s.next().trim().toLowerCase());
System.out.println("Enter your PIN (IMPORTANT: This is your PIN, not your user password):");
exchangeSpecification.setPassword(s.next().trim().toLowerCase());
exchangeSpecification.setUserName("<optional username>");
System.out.println("Please wait...");
return mercadoBitcoin;
}
use of org.knowm.xchange.Exchange in project XChange by knowm.
the class MercadoBitcoinAccountDemo method main.
public static void main(String[] args) throws IOException {
Exchange mercadoBitcoin = InteractiveAuthenticatedExchange.createInstanceFromDefaultInput();
AccountService accountService = mercadoBitcoin.getAccountService();
generic(accountService);
raw((MercadoBitcoinAccountServiceRaw) accountService);
}
use of org.knowm.xchange.Exchange in project XChange by knowm.
the class DepthDemo method main.
public static void main(String[] args) throws IOException {
// Use the factory to get Mercado Bitcoin exchange API using default settings
Exchange mercadoBitcoin = ExchangeFactory.INSTANCE.createExchange(MercadoBitcoinExchange.class);
// Interested in the public market data feed (no authentication)
MarketDataService marketDataService = mercadoBitcoin.getMarketDataService();
generic(marketDataService);
raw((MercadoBitcoinMarketDataServiceRaw) marketDataService);
}
use of org.knowm.xchange.Exchange in project XChange by knowm.
the class TradesDemo method main.
public static void main(String[] args) throws IOException {
// Use the factory to get Mercado Bitcoin exchange API using default settings
Exchange mercadoBitcoin = ExchangeFactory.INSTANCE.createExchange(MercadoBitcoinExchange.class);
// Interested in the public market data feed (no authentication)
MarketDataService marketDataService = mercadoBitcoin.getMarketDataService();
Long now = new Date().getTime();
generic(now, marketDataService);
raw(now, (MercadoBitcoinMarketDataServiceRaw) marketDataService);
}
use of org.knowm.xchange.Exchange in project XChange by knowm.
the class LakeBTCTickersDemo method main.
public static void main(String[] args) throws IOException {
Exchange lakebtcExchange = LakeBTCExamplesUtils.createTestExchange();
generic(lakebtcExchange);
raw(lakebtcExchange);
}
Aggregations