com.xeiam.xchange.examples.kraken.account.KrakenAccountDemo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-examples Show documentation
Show all versions of xchange-examples Show documentation
Provides a set of examples that demonstrate how to use XChange in client applications
The newest version!
package com.xeiam.xchange.examples.kraken.account;
import java.io.IOException;
import com.xeiam.xchange.Exchange;
import com.xeiam.xchange.dto.account.AccountInfo;
import com.xeiam.xchange.examples.kraken.KrakenExampleUtils;
import com.xeiam.xchange.kraken.service.polling.KrakenAccountServiceRaw;
/**
*
* Example showing the following:
*
*
* - Connect to Kraken exchange with authentication
* - View account balance
*
*/
public class KrakenAccountDemo {
public static void main(String[] args) throws IOException {
Exchange krakenExchange = KrakenExampleUtils.createTestExchange();
generic(krakenExchange);
raw(krakenExchange);
}
private static void generic(Exchange krakenExchange) throws IOException {
AccountInfo accountInfo = krakenExchange.getPollingAccountService().getAccountInfo();
System.out.println("Account Info: " + accountInfo.toString());
}
private static void raw(Exchange krakenExchange) throws IOException {
KrakenAccountServiceRaw rawKrakenAcctService = (KrakenAccountServiceRaw) krakenExchange.getPollingAccountService();
System.out.println("Balance Info: " + rawKrakenAcctService.getKrakenBalance());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy