package org.knowm.xchange.huobi.service;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import org.knowm.xchange.Exchange;
import org.knowm.xchange.currency.Currency;
import org.knowm.xchange.dto.account.AccountInfo;
import org.knowm.xchange.dto.account.FundingRecord;
import org.knowm.xchange.exceptions.ExchangeException;
import org.knowm.xchange.huobi.HuobiAdapters;
import org.knowm.xchange.huobi.dto.account.HuobiAccount;
import org.knowm.xchange.service.account.AccountService;
import org.knowm.xchange.service.trade.params.TradeHistoryParams;
import org.knowm.xchange.service.trade.params.WithdrawFundsParams;

public class HuobiAccountService extends HuobiAccountServiceRaw implements AccountService {

  public HuobiAccountService(Exchange exchange) {
    super(exchange);
  }

  @Override
  public String withdrawFunds(WithdrawFundsParams withdrawFundsParams) throws IOException {
    return null;
  }

  @Override
  public String withdrawFunds(Currency currency, BigDecimal amount, String s) throws IOException {
    return String.valueOf(createWithdraw(currency.toString(), amount, null, s, null));
  }

  @Override
  public AccountInfo getAccountInfo() throws IOException {
    HuobiAccount[] accounts = getAccounts();
    if (accounts.length == 0) {
      throw new ExchangeException("Account is not recognized.");
    }
    String accountID = String.valueOf(accounts[0].getId());
    return new AccountInfo(
        accountID,
        HuobiAdapters.adaptWallet(
            HuobiAdapters.adaptBalance(getHuobiBalance(accountID).getList())));
  }

  @Override
  public TradeHistoryParams createFundingHistoryParams() {
    return null;
  }

  @Override
  public List<FundingRecord> getFundingHistory(TradeHistoryParams tradeHistoryParams)
      throws IOException {
    return null;
  }

  @Override
  public String requestDepositAddress(Currency currency, String... strings) throws IOException {
    return getDepositAddress(currency.toString());
  }
}

@@ -511,16 +511,90 @@
 ervice;%0A
+import org.knowm.xchange.service.trade.params.DefaultWithdrawFundsParams;%0A
 import o
@@ -954,65 +954,386 @@
 ams 
-withdrawFundsParams) throws IOException %7B%0A    return null
+params) throws IOException %7B%0A%09if (params instanceof DefaultWithdrawFundsParams) %7B%0A%09  DefaultWithdrawFundsParams defaultParams = (DefaultWithdrawFundsParams) params;%0A%09    return withdrawFunds(%0A%09      defaultParams.getCurrency(), %0A%09      defaultParams.getAmount(), %0A%09      defaultParams.getAddress());%0A%09  %7D%0A%09throw new IllegalStateException(%22Don't know how to withdraw: %22 + params)
 ;%0A  
@@ -1422,16 +1422,22 @@
  String 
+addres
 s) throw
@@ -1528,16 +1528,22 @@
 , null, 
+addres
 s, null)

Implement withdrawFunds with params