package org.knowm.xchange.coinfloor.service;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection;

import org.knowm.xchange.Exchange;
import org.knowm.xchange.coinfloor.CoinfloorAdapters;
import org.knowm.xchange.coinfloor.dto.account.CoinfloorBalance;
import org.knowm.xchange.currency.Currency;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.dto.account.AccountInfo;
import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
import org.knowm.xchange.service.account.AccountService;

public class CoinfloorAccountService extends CoinfloorAccountServiceRaw implements AccountService {
  public CoinfloorAccountService(Exchange exchange) {
    super(exchange);
  }

  @Override
  public AccountInfo getAccountInfo() throws IOException {

    Collection<CoinfloorBalance> rawBalances = new ArrayList<>();
    for (CurrencyPair pair : exchange.getExchangeSymbols()) {
      CoinfloorBalance balance = getCoinfloorBalance(pair);
      rawBalances.add(balance);
    }
    return CoinfloorAdapters.adaptAccountInfo(exchange.getExchangeMetaData().getCurrencies().keySet(), rawBalances);
  }

  @Override
  public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws NotAvailableFromExchangeException {
    throw new NotAvailableFromExchangeException();
  }

  @Override
  public String requestDepositAddress(Currency currency, String... args) throws NotAvailableFromExchangeException {
    throw new NotAvailableFromExchangeException();
  }
}

@@ -152,16 +152,39 @@
 lection;
+%0Aimport java.util.List;
 %0A%0Aimport
@@ -502,109 +502,357 @@
 nge.
-exceptions.NotAvailableFromExchangeException;%0Aimport org.knowm.xchange.service.account.AccountService
+dto.account.FundingRecord;%0Aimport org.knowm.xchange.exceptions.ExchangeException;%0Aimport org.knowm.xchange.exceptions.NotAvailableFromExchangeException;%0Aimport org.knowm.xchange.exceptions.NotYetImplementedForExchangeException;%0Aimport org.knowm.xchange.service.account.AccountService;%0Aimport org.knowm.xchange.service.trade.params.TradeHistoryParams
 ;%0A%0Ap
@@ -1827,11 +1827,402 @@
 n();%0A  %7D
+%0A%0A  @Override%0A  public TradeHistoryParams createFundingHistoryParams() %7B%0A    throw new NotYetImplementedForExchangeException();%0A  %7D%0A%0A  @Override%0A  public List%3CFundingRecord%3E getFundingHistory(TradeHistoryParams params) throws ExchangeException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException, IOException %7B%0A    throw new NotYetImplementedForExchangeException();%0A  %7D
 %0A%7D%0A

Add Generic API for funding information implementation to Coinfloor