Package com.xeiam.xchange.coinsetter.service.polling

Examples of com.xeiam.xchange.coinsetter.service.polling.CoinsetterClientSessionServiceRaw


    String username = args[0];
    String password = args[1];
    String ipAddress = args[2];

    Exchange coinsetter = CoinsetterExamplesUtils.getExchange();
    CoinsetterClientSessionServiceRaw clientSessionService = new CoinsetterClientSessionServiceRaw(coinsetter.getExchangeSpecification());
    CoinsetterNewsAlertServiceRaw newsAlertService = new CoinsetterNewsAlertServiceRaw(coinsetter.getExchangeSpecification());

    CoinsetterClientSession clientSession = clientSessionService.login(username, password, ipAddress);
    log.info("Client session: {}", clientSession);

    CoinsetterNewsAlertList newsAlerts = newsAlertService.list(clientSession.getUuid());

    for (CoinsetterNewsAlert alert : newsAlerts.getMessageList()) {
      log.info("{}", alert);
    }

    clientSessionService.logout(clientSession.getUuid());
  }
View Full Code Here


    String username = args[0];
    String password = args[1];
    String ipAddress = args[2];

    Exchange coinsetter = CoinsetterExamplesUtils.getExchange();
    CoinsetterClientSessionServiceRaw clientSessionService = new CoinsetterClientSessionServiceRaw(coinsetter.getExchangeSpecification());
    CoinsetterAccountServiceRaw accountService = new CoinsetterAccountServiceRaw(coinsetter.getExchangeSpecification());
    CoinsetterFinancialTransactionServiceRaw financialTransactionService = new CoinsetterFinancialTransactionServiceRaw(coinsetter.getExchangeSpecification());

    CoinsetterClientSession clientSession = clientSessionService.login(username, password, ipAddress);
    log.info("Client session: {}", clientSession);

    CoinsetterAccountList coinsetterAccounts = accountService.list(clientSession.getUuid());
    for (CoinsetterAccount account : coinsetterAccounts.getAccountList()) {
      log.info("account: {}", account.getAccountUuid());

      CoinsetterAccount a = accountService.get(clientSession.getUuid(), account.getAccountUuid());
      log.info("account: {}", a);

      CoinsetterFinancialTransactionList financialTransactions = financialTransactionService.list(clientSession.getUuid(), account.getAccountUuid());
      for (CoinsetterFinancialTransaction transaction : financialTransactions.getFinancialTransactionList()) {
        CoinsetterFinancialTransaction t = financialTransactionService.get(clientSession.getUuid(), transaction.getUuid());
        log.info("Transaction: {}", t);
      }
    }

    clientSessionService.logout(clientSession.getUuid());
  }
View Full Code Here

    String username = args[0];
    String password = args[1];
    String ipAddress = args[2];

    Exchange coinsetter = CoinsetterExamplesUtils.getExchange();
    CoinsetterClientSessionServiceRaw clientSessionService = new CoinsetterClientSessionServiceRaw(coinsetter.getExchangeSpecification());
    CoinsetterClientSession clientSession = clientSessionService.login(username, password, ipAddress);
    log.info("Client session: {}", clientSession);

    for (int i = 0; i < 2; i++) {
      TimeUnit.SECONDS.sleep(30);
      CoinsetterResponse heartbeatResponse = clientSessionService.heartbeat(clientSession.getUuid());
      log.info("hearbeat: {}", heartbeatResponse);
    }

    CoinsetterResponse logoutResponse = clientSessionService.logout(clientSession.getUuid());
    log.info("logout: {}", logoutResponse);

    try {
      CoinsetterResponse heartbeatResponse = clientSessionService.heartbeat(clientSession.getUuid());
      log.info("hearbeat: {}", heartbeatResponse);
    } catch (CoinsetterException e) {
      log.info("{}", e.getMessage());
    }
  }
View Full Code Here

    String username = args[0];
    String password = args[1];
    String ipAddress = args[2];

    Exchange coinsetter = CoinsetterExamplesUtils.getExchange();
    CoinsetterClientSessionServiceRaw clientSessionService = new CoinsetterClientSessionServiceRaw(coinsetter.getExchangeSpecification());
    CoinsetterAccountServiceRaw accountService = new CoinsetterAccountServiceRaw(coinsetter.getExchangeSpecification());
    CoinsetterOrderServiceRaw orderService = new CoinsetterOrderServiceRaw(coinsetter.getExchangeSpecification());

    CoinsetterClientSession clientSession = clientSessionService.login(username, password, ipAddress);
    log.info("Client session: {}", clientSession);

    CoinsetterAccount tradeAccount = null;
    CoinsetterAccountList coinsetterAccounts = accountService.list(clientSession.getUuid());
    for (CoinsetterAccount account : coinsetterAccounts.getAccountList()) {
      log.info("account: {}", account.getAccountUuid());

      CoinsetterAccount a = accountService.get(clientSession.getUuid(), account.getAccountUuid());
      log.info("account: {}", a);

      tradeAccount = a;
    }

    // Add order
    log.info("Adding order...");
    CoinsetterOrderRequest request =
        new CoinsetterOrderRequest(clientSession.getCustomerUuid(), tradeAccount.getAccountUuid(), "BTCUSD", "BUY", "LIMIT", new BigDecimal("0.01"), 2, new BigDecimal("0.01"));
    CoinsetterOrderResponse orderResponse = orderService.add(clientSession.getUuid(), request);
    log.info("add order response: {}", orderResponse);

    // Get order
    log.info("Getting order...");
    CoinsetterOrder orderStatus = orderService.get(clientSession.getUuid(), orderResponse.getUuid());
    log.info("order {}: {}", orderStatus.getUuid(), orderStatus.getStage());

    // List order
    log.info("Listing order...");
    CoinsetterOrderList orderList = orderService.list(clientSession.getUuid(), tradeAccount.getAccountUuid(), "NEW-FILL");
    for (CoinsetterOrder order : orderList.getOrderList()) {
      log.info("order {}: {}", order.getUuid(), order.getStage());
    }

    // Cancel order
    log.info("Cancelling order...");
    orderResponse = orderService.cancel(clientSession.getUuid(), orderResponse.getUuid());
    log.info("cancel order response: {}", orderResponse);

    clientSessionService.logout(clientSession.getUuid());
  }
View Full Code Here

    String username = args[0];
    String password = args[1];
    String ipAddress = args[2];

    Exchange coinsetter = CoinsetterExamplesUtils.getExchange();
    CoinsetterClientSessionServiceRaw clientSessionService = new CoinsetterClientSessionServiceRaw(coinsetter.getExchangeSpecification());
    CoinsetterAccountServiceRaw accountService = new CoinsetterAccountServiceRaw(coinsetter.getExchangeSpecification());

    CoinsetterClientSession clientSession = clientSessionService.login(username, password, ipAddress);
    log.info("Client session: {}", clientSession);

    CoinsetterAccountList coinsetterAccounts = accountService.list(clientSession.getUuid());
    for (CoinsetterAccount account : coinsetterAccounts.getAccountList()) {
      log.info("account: {}", account.getAccountUuid());

      CoinsetterAccount a = accountService.get(clientSession.getUuid(), account.getAccountUuid());
      log.info("account: {}", a);
    }

    clientSessionService.logout(clientSession.getUuid());
  }
View Full Code Here

    String username = args[0];
    String password = args[1];
    String ipAddress = args[2];

    Exchange coinsetter = CoinsetterExamplesUtils.getExchange();
    CoinsetterClientSessionServiceRaw clientSessionService = new CoinsetterClientSessionServiceRaw(coinsetter.getExchangeSpecification());
    CoinsetterPriceAlertServiceRaw priceAlertService = new CoinsetterPriceAlertServiceRaw(coinsetter.getExchangeSpecification());

    CoinsetterClientSession clientSession = clientSessionService.login(username, password, ipAddress);
    log.info("Client session: {}", clientSession);

    // Add
    CoinsetterPriceAlertRequest request = new CoinsetterPriceAlertRequest("EMAIL", "CROSSES", new BigDecimal("123.12"), "BTCUSD");
    CoinsetterPriceAlertResponse addResponse = priceAlertService.add(clientSession.getUuid(), request);
    log.info("add price alert response: {}", addResponse);

    // List
    CoinsetterPriceAlertList priceAlerts = priceAlertService.list(clientSession.getUuid());

    for (CoinsetterPriceAlert alert : priceAlerts.getPriceAlerts()) {
      log.info("{}", alert);
    }

    // Remove
    CoinsetterRemovePriceAlertResponse removeResponse = priceAlertService.remove(clientSession.getUuid(), addResponse.getUuid());
    log.info("remove price alert response: {}", removeResponse);

    clientSessionService.logout(clientSession.getUuid());
  }
View Full Code Here

TOP

Related Classes of com.xeiam.xchange.coinsetter.service.polling.CoinsetterClientSessionServiceRaw

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.