org.knowm.xchange.examples.bittrex.account.BittrexAccountDemo 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 org.knowm.xchange.examples.bittrex.account;
import java.io.IOException;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.bittrex.dto.account.BittrexAddress;
import org.knowm.xchange.bittrex.dto.account.BittrexBalance;
import org.knowm.xchange.bittrex.service.BittrexAccountServiceRaw;
import org.knowm.xchange.currency.Currency;
import org.knowm.xchange.dto.account.Balance;
import org.knowm.xchange.examples.bittrex.BittrexExamplesUtils;
import org.knowm.xchange.service.account.AccountService;
public class BittrexAccountDemo {
public static void main(String[] args) throws IOException {
Exchange exchange = BittrexExamplesUtils.getExchange();
AccountService accountService = exchange.getAccountService();
generic(accountService);
raw((BittrexAccountServiceRaw) accountService);
}
private static void generic(AccountService accountService) throws IOException {
System.out.println("----------GENERIC---------");
Map balances = accountService.getAccountInfo().getWallet().getBalances();
System.out.println(balances);
System.out.println(accountService.requestDepositAddress(Currency.BTC));
}
private static void raw(BittrexAccountServiceRaw accountService) throws IOException {
System.out.println("------------RAW-----------");
Collection balances = accountService.getBittrexBalances();
System.out.println(balances);
List depositAddress = accountService.getBittrexDepositAddresses("BTC");
System.out.println(depositAddress);
BittrexBalance balance = accountService.getBittrexBalance(Currency.getInstance("BCC"));
System.out.println(balance);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy