Package com.xeiam.xchange.coinsetter.service.polling

Source Code of com.xeiam.xchange.coinsetter.service.polling.CoinsetterAccountService

package com.xeiam.xchange.coinsetter.service.polling;

import java.io.IOException;
import java.math.BigDecimal;

import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.NotAvailableFromExchangeException;
import com.xeiam.xchange.coinsetter.CoinsetterAdapters;
import com.xeiam.xchange.coinsetter.dto.account.CoinsetterAccount;
import com.xeiam.xchange.coinsetter.dto.clientsession.response.CoinsetterClientSession;
import com.xeiam.xchange.dto.account.AccountInfo;
import com.xeiam.xchange.service.polling.PollingAccountService;

/**
* Account service.
*/
public class CoinsetterAccountService extends CoinsetterBasePollingService implements PollingAccountService {

  private final CoinsetterAccountServiceRaw accountServiceRaw;

  /**
   * @param exchangeSpecification
   */
  public CoinsetterAccountService(ExchangeSpecification exchangeSpecification) {

    super(exchangeSpecification);
    accountServiceRaw = new CoinsetterAccountServiceRaw(exchangeSpecification);
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public AccountInfo getAccountInfo() throws IOException {

    CoinsetterClientSession session = getSession();
    CoinsetterAccount account = accountServiceRaw.get(session.getUuid(), getAccountUuid());
    return CoinsetterAdapters.adaptAccountInfo(session.getUsername(), account);
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public String withdrawFunds(String currency, BigDecimal amount, String address) throws IOException {

    throw new NotAvailableFromExchangeException();
  }

  /**
   * {@inheritDoc}
   */
  @Override
  public String requestDepositAddress(String currency, String... args) throws IOException {

    throw new NotAvailableFromExchangeException();
  }

}
TOP

Related Classes of com.xeiam.xchange.coinsetter.service.polling.CoinsetterAccountService

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.