com.xeiam.xchange.quoine.service.polling.QuoineAccountService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xchange-quoine Show documentation
Show all versions of xchange-quoine Show documentation
XChange implementation for the Quoine Exchange
The newest version!
package com.xeiam.xchange.quoine.service.polling;
import java.io.IOException;
import java.math.BigDecimal;
import com.xeiam.xchange.BaseExchange;
import com.xeiam.xchange.dto.account.AccountInfo;
import com.xeiam.xchange.exceptions.NotAvailableFromExchangeException;
import com.xeiam.xchange.quoine.QuoineAdapters;
import com.xeiam.xchange.quoine.dto.account.QuoineAccountInfo;
import com.xeiam.xchange.quoine.dto.account.QuoineTradingAccountInfo;
import com.xeiam.xchange.service.polling.account.PollingAccountService;
/**
*
* XChange service to provide the following to {@link com.xeiam.xchange.Exchange}:
*
*
* - ANX specific methods to handle account-related operations
*
*/
public class QuoineAccountService extends QuoineAccountServiceRaw implements PollingAccountService {
private final boolean useMargin;
/**
* Constructor
*/
public QuoineAccountService(BaseExchange baseExchange, boolean useMargin) {
super(baseExchange);
this.useMargin = useMargin;
}
@Override
public AccountInfo getAccountInfo() throws IOException {
if (useMargin) {
QuoineTradingAccountInfo[] quoineTradingAccountInfo = getQuoineTradingAccountInfo();
return QuoineAdapters.adaptTradingAccountInfo(quoineTradingAccountInfo);
} else {
QuoineAccountInfo quoineAccountInfo = getQuoineAccountInfo();
return QuoineAdapters.adaptAccountinfo(quoineAccountInfo);
}
}
@Override
public String withdrawFunds(String currency, BigDecimal amount, String address) throws IOException {
throw new NotAvailableFromExchangeException();
}
@Override
public String requestDepositAddress(String currency, String... args) throws IOException {
throw new NotAvailableFromExchangeException();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy