Package com.xeiam.xchange

Examples of com.xeiam.xchange.Exchange


  private static final Logger log = LoggerFactory.getLogger(BTCChinaSocketIOServiceDemo.class);

  public static void main(String[] args) throws InterruptedException {

    final BTCChinaStreamingConfiguration configuration = new BTCChinaStreamingConfiguration(true, true, true, true, CurrencyPair.BTC_CNY, CurrencyPair.LTC_CNY, CurrencyPair.LTC_BTC);
    final Exchange exchange = BTCChinaExamplesUtils.getExchange();
    final StreamingExchangeService service = exchange.getStreamingExchangeService(configuration);

    Thread consumer = new Thread("consumer") {

      @Override
      public void run() {
View Full Code Here


    ExchangeSpecification exchangeSpecification = new ExchangeSpecification(BitcoiniumExchange.class.getName());
    // exchangeSpecification.setPlainTextUri("http://openexchangerates.org");
    exchangeSpecification.setApiKey("42djci5kmbtyzrvglfdw3e2dgmh5mr37");
    exchangeSpecification.setPlainTextUri("http://173.10.241.154:9090");
    System.out.println(exchangeSpecification.toString());
    Exchange bitcoiniumExchange = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification);

    // Interested in the public polling market data feed (no authentication)
    bitcoiniumMarketDataService = (BitcoiniumMarketDataServiceRaw) bitcoiniumExchange.getPollingMarketDataService();

    // Setup the panel
    final XChartPanel chartPanel = buildPanel();
    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
View Full Code Here

public class ItBitTradesDemo {

  public static void main(String[] args) throws Exception {

    // Use the factory to get BTC-E exchange API using default settings
    Exchange bitfinex = ExchangeFactory.INSTANCE.createExchange(ItBitExchange.class.getName());
    ExchangeSpecification defaultExchangeSpecification = bitfinex.getDefaultExchangeSpecification();

    defaultExchangeSpecification.setUserName("xxx");
    defaultExchangeSpecification.setApiKey("xxx");
    defaultExchangeSpecification.setSecretKey("xxx");

    defaultExchangeSpecification.setExchangeSpecificParametersItem("walletId", "xx");
    defaultExchangeSpecification.setExchangeSpecificParametersItem("userId", "xxx");

    bitfinex.applySpecification(defaultExchangeSpecification);

    // get all services
    PollingMarketDataService marketDataService = bitfinex.getPollingMarketDataService();
    PollingAccountService accout = bitfinex.getPollingAccountService();
    PollingTradeService trades = bitfinex.getPollingTradeService();

    OrderBook orderBook = marketDataService.getOrderBook(new CurrencyPair("XBT", "USD"));
    System.out.println("BIDS: " + orderBook.getBids());
    System.out.println("ASKS: " + orderBook.getAsks());
View Full Code Here

*/
public class MintPalMarketDataDemo {

  public static void main(String[] args) throws IOException {

    Exchange mintPalExchange = MintPalDemoUtils.createExchange();
    generic(mintPalExchange);
    raw(mintPalExchange);
  }
View Full Code Here

    exSpec.setPlainTextUriStreaming("ws://api.coinfloor.co.uk");
    exSpec.setSslUriStreaming("wss://api.coinfloor.co.uk");
    exSpec.setHost("coinfloor.co.uk");
    exSpec.setPort(80);

    Exchange coinfloorExchange = ExchangeFactory.INSTANCE.createExchange(exSpec);

    // Streaming exchange service can be instantiated in one of two ways:
    // //Using default vars (commented out to prevent conflicts for this demo)
    // StreamingExchangeService streamingExchangeServiceDefault = ((CoinfloorExchange)coinfloorExchange).getStreamingExchangeService();

    // //Or with new vars:
    ExchangeStreamingConfiguration exchangeStreamingConfiguration = new CoinfloorStreamingConfiguration(10, 10000, 30000, false, true, false);
    final StreamingExchangeService streamingExchangeService = coinfloorExchange.getStreamingExchangeService(exchangeStreamingConfiguration);

    // connect, and authenicate using username/cookie/password provided in exSpec
    streamingExchangeService.connect();
    Map<String, Object> resultMap;
View Full Code Here

*/
public class BlockchainAddressDemo {

  public static void main(String[] args) throws IOException {

    Exchange blockchainExchangexchange = ExchangeFactory.INSTANCE.createExchange(BlockchainExchange.class.getName());
    Blockchain blockchain = RestProxyFactory.createProxy(Blockchain.class, blockchainExchangexchange.getExchangeSpecification().getPlainTextUri());

    BitcoinAddress bitcoinAddress = blockchain.getBitcoinAddress("17dQktcAmU4urXz7tGk2sbuiCqykm3WLs6");
    System.out.println(bitcoinAddress.toString());

    BitcoinAddresses bitcoinAddresses = blockchain.getBitcoinAddresses("17dQktcAmU4urXz7tGk2sbuiCqykm3WLs6|15MvtM8e3bzepmZ5vTe8cHvrEZg6eDzw2w");
View Full Code Here

    ExchangeSpecification exchangeSpecification = new ExchangeSpecification(BitcoiniumExchange.class.getName());
    // exchangeSpecification.setPlainTextUri("http://openexchangerates.org");
    exchangeSpecification.setApiKey("42djci5kmbtyzrvglfdw3e2dgmh5mr37");
    exchangeSpecification.setPlainTextUri("http://173.10.241.154:9090");
    System.out.println(exchangeSpecification.toString());
    Exchange bitcoiniumExchange = ExchangeFactory.INSTANCE.createExchange(exchangeSpecification);

    // Interested in the public polling market data feed (no authentication)
    bitcoiniumMarketDataService = (BitcoiniumMarketDataServiceRaw) bitcoiniumExchange.getPollingMarketDataService();

    // Setup the panel
    final XChartPanel chartPanel = buildPanel();
    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
View Full Code Here

public class BTERAccountDemo {

  public static void main(String[] args) throws IOException {

    Exchange exchange = BTERDemoUtils.createExchange();
    PollingAccountService accountService = exchange.getPollingAccountService();

    generic(accountService);
    raw((BTERPollingAccountServiceRaw) accountService);
  }
View Full Code Here

*/
public class BitstampAccountDemo {

  public static void main(String[] args) throws IOException {

    Exchange bitstamp = BitstampDemoUtils.createExchange();
    PollingAccountService accountService = bitstamp.getPollingAccountService();

    generic(accountService);
    raw((BitstampAccountServiceRaw) accountService);
  }
View Full Code Here

  private static final Logger log = LoggerFactory.getLogger(CoinsetterPingDemo.class);

  public static void main(String[] args) throws IOException {

    Exchange coinsetter = CoinsetterExamplesUtils.getExchange();
    CoinsetterPingServiceRaw pingService = new CoinsetterPingServiceRaw(coinsetter.getExchangeSpecification());

    String text = pingService.ping("HelloWorld");
    log.info("ping result: {}", text);
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.Exchange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.