Package com.xeiam.xchange.vaultofsatoshi.service.polling

Source Code of com.xeiam.xchange.vaultofsatoshi.service.polling.VaultOfSatoshiAccountService

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

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

import com.xeiam.xchange.ExchangeSpecification;
import com.xeiam.xchange.NotAvailableFromExchangeException;
import com.xeiam.xchange.dto.account.AccountInfo;
import com.xeiam.xchange.service.polling.PollingAccountService;
import com.xeiam.xchange.vaultofsatoshi.VaultOfSatoshiAdapters;

/**
* @author veken0m
*/
public class VaultOfSatoshiAccountService extends VaultOfSatoshiAccountServiceRaw implements PollingAccountService {

  /**
   * Constructor
   *
   * @param exchangeSpecification
   *          The {@link ExchangeSpecification}
   */
  public VaultOfSatoshiAccountService(ExchangeSpecification exchangeSpecification) {

    super(exchangeSpecification);
  }

  @Override
  public AccountInfo getAccountInfo() throws IOException {

    return VaultOfSatoshiAdapters.adaptAccountInfo(getAccount(), exchangeSpecification.getUserName());
  }

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

    // TODO: implement withdraw
    throw new NotAvailableFromExchangeException();
  }

  /**
   * This returns the currently set deposit address. It will not generate a
   * new address (ie. repeated calls will return the same address).
   */
  @Override
  public String requestDepositAddress(String currency, String... arguments) throws IOException {

    return getWalletAddress(currency).getWallet_address();

  }
}
TOP

Related Classes of com.xeiam.xchange.vaultofsatoshi.service.polling.VaultOfSatoshiAccountService

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.