All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.xeiam.xchange.examples.poloniex.account.PoloniexAccountDemo Maven / Gradle / Ivy

Go to download

Provides a set of examples that demonstrate how to use XChange in client applications

The newest version!
package com.xeiam.xchange.examples.poloniex.account;

import java.io.IOException;

import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.examples.poloniex.PoloniexExamplesUtils;
import com.xeiam.xchange.poloniex.service.polling.PoloniexAccountServiceRaw;
import com.xeiam.xchange.service.polling.account.PollingAccountService;
import com.xeiam.xchange.utils.CertHelper;

/**
 * @author Zach Holmes
 */

public class PoloniexAccountDemo {

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

    CertHelper.trustAllCerts();

    Exchange poloniex = PoloniexExamplesUtils.getExchange();
    PollingAccountService accountService = poloniex.getPollingAccountService();

    generic(accountService);
    raw((PoloniexAccountServiceRaw) accountService);
  }

  private static void generic(PollingAccountService accountService) throws IOException {

    System.out.println("----------GENERIC----------");
    System.out.println(accountService.requestDepositAddress("BTC"));
    System.out.println(accountService.getAccountInfo());
  }

  private static void raw(PoloniexAccountServiceRaw accountService) throws IOException {

    System.out.println("------------RAW------------");
    System.out.println(accountService.getDepositAddress("BTC"));
    System.out.println(accountService.getWallets());
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy