Search in sources :

Example 1 with CoingiWithdrawalRequest

use of org.knowm.xchange.coingi.dto.account.CoingiWithdrawalRequest in project XChange by knowm.

the class CoingiAccountService method withdrawFunds.

@Override
public String withdrawFunds(WithdrawFundsParams p) throws IOException, NotAvailableFromExchangeException, NotYetImplementedForExchangeException {
    try {
        if (p instanceof DefaultWithdrawFundsParams) {
            DefaultWithdrawFundsParams params = (DefaultWithdrawFundsParams) p;
            CoingiWithdrawalRequest request = new CoingiWithdrawalRequest().setAddress(params.address).setAmount(params.amount).setCurrency(params.currency.getCurrencyCode().toUpperCase());
            return withdraw(request).toString();
        }
        throw new NotYetImplementedForExchangeException();
    } catch (CoingiException e) {
        throw CoingiErrorAdapter.adapt(e);
    }
}
Also used : DefaultWithdrawFundsParams(org.knowm.xchange.service.trade.params.DefaultWithdrawFundsParams) CoingiException(org.knowm.xchange.coingi.dto.CoingiException) CoingiWithdrawalRequest(org.knowm.xchange.coingi.dto.account.CoingiWithdrawalRequest) NotYetImplementedForExchangeException(org.knowm.xchange.exceptions.NotYetImplementedForExchangeException)

Aggregations

CoingiException (org.knowm.xchange.coingi.dto.CoingiException)1 CoingiWithdrawalRequest (org.knowm.xchange.coingi.dto.account.CoingiWithdrawalRequest)1 NotYetImplementedForExchangeException (org.knowm.xchange.exceptions.NotYetImplementedForExchangeException)1 DefaultWithdrawFundsParams (org.knowm.xchange.service.trade.params.DefaultWithdrawFundsParams)1