All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.knowm.xchange.empoex.service.polling.EmpoExAccountService Maven / Gradle / Ivy

There is a newer version: 4.3.6
Show newest version
package org.knowm.xchange.empoex.service.polling;

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.empoex.EmpoExAdapters;
import org.knowm.xchange.exceptions.NotAvailableFromExchangeException;
import org.knowm.xchange.service.polling.account.PollingAccountService;

public class EmpoExAccountService extends EmpoExAccountServiceRaw implements PollingAccountService {

  /**
   * Constructor
   *
   * @param exchange
   */
  public EmpoExAccountService(Exchange exchange) {

    super(exchange);
  }

  @Override
  public AccountInfo getAccountInfo() throws IOException {

    // TODO empoex also provides "pending" and "held" balances; perhaps they are depositing and frozen?
    return new AccountInfo(EmpoExAdapters.adaptBalances(super.getEmpoExBalances().get("available")));
  }

  @Override
  public String withdrawFunds(Currency currency, BigDecimal amount, String address) throws IOException {

    throw new NotAvailableFromExchangeException();
  }

  @Override
  public String requestDepositAddress(Currency currency, String... args) throws IOException {

    throw new NotAvailableFromExchangeException();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy