package org.knowm.xchange.kraken.service; import java.io.IOException; import java.math.BigDecimal; import org.knowm.xchange.Exchange; import org.knowm.xchange.currency.Currency; import org.knowm.xchange.dto.account.AccountInfo; import org.knowm.xchange.kraken.KrakenAdapters; import org.knowm.xchange.kraken.dto.account.KrakenDepositAddress; import org.knowm.xchange.service.account.AccountService; public class KrakenAccountService extends KrakenAccountServiceRaw implements AccountService { /** * Constructor * * @param exchange */ public KrakenAccountService(Exchange exchange) { super(exchange); } @Override public AccountInfo getAccountInfo() throws IOException { return new AccountInfo(exchange.getExchangeSpecification().getUserName(), KrakenAdapters.adaptWallet(getKrakenBalance())); } @Override public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws IOException { return withdraw(null, currency.toString(), address, amount).getRefid(); } @Override public String requestDepositAddress(Currency currency, String... args) throws IOException { KrakenDepositAddress[] depositAddresses = getDepositAddresses(currency.toString(), "Bitcoin", false); return KrakenAdapters.adaptKrakenDepositAddress(depositAddresses); } // public WithdrawInfo[] getWithdrawInfo(String assetPairs, String assets, // String key, BigDecimal amount) // throws IOException { // return getWithdrawInfo(assetPairs, assets, key, amount); // } }