Search in sources :

Example 1 with BitbayWithdrawFundsSwiftParams

use of org.knowm.xchange.bitbay.service.account.params.BitbayWithdrawFundsSwiftParams in project XChange by knowm.

the class BitbayAccountService method withdrawFunds.

@Override
public String withdrawFunds(WithdrawFundsParams params) throws IOException {
    if (params instanceof DefaultWithdrawFundsParams) {
        DefaultWithdrawFundsParams defaultParams = (DefaultWithdrawFundsParams) params;
        transfer(defaultParams.getCurrency(), defaultParams.getAmount(), defaultParams.getAddress());
        return "Success";
    } else if (params instanceof BitbayWithdrawFundsSwiftParams) {
        BitbayWithdrawFundsSwiftParams bicParams = (BitbayWithdrawFundsSwiftParams) params;
        withdraw(bicParams.getCurrency(), bicParams.getAmount(), bicParams.getAccount(), bicParams.isExpress(), bicParams.getBic());
        return "Success";
    }
    throw new NotAvailableFromExchangeException();
}
Also used : NotAvailableFromExchangeException(org.knowm.xchange.exceptions.NotAvailableFromExchangeException) DefaultWithdrawFundsParams(org.knowm.xchange.service.trade.params.DefaultWithdrawFundsParams) BitbayWithdrawFundsSwiftParams(org.knowm.xchange.bitbay.service.account.params.BitbayWithdrawFundsSwiftParams)

Aggregations

BitbayWithdrawFundsSwiftParams (org.knowm.xchange.bitbay.service.account.params.BitbayWithdrawFundsSwiftParams)1 NotAvailableFromExchangeException (org.knowm.xchange.exceptions.NotAvailableFromExchangeException)1 DefaultWithdrawFundsParams (org.knowm.xchange.service.trade.params.DefaultWithdrawFundsParams)1