Search in sources :

Example 1 with GeminiWithdrawalRequest

use of org.knowm.xchange.gemini.v1.dto.account.GeminiWithdrawalRequest in project XChange by knowm.

the class GeminiAccountServiceRaw method withdraw.

public String withdraw(Currency currency, BigDecimal amount, String address) throws IOException {
    try {
        String ccy = convertToGeminiCcyName(currency.getCurrencyCode());
        GeminiWithdrawalRequest request = new GeminiWithdrawalRequest(String.valueOf(exchange.getNonceFactory().createValue()), ccy, amount, address);
        GeminiWithdrawalResponse withdrawRepsonse = gemini.withdraw(apiKey, payloadCreator, signatureCreator, ccy, request);
        return withdrawRepsonse.txHash;
    } catch (GeminiException e) {
        throw handleException(e);
    }
}
Also used : GeminiWithdrawalResponse(org.knowm.xchange.gemini.v1.dto.account.GeminiWithdrawalResponse) GeminiWithdrawalRequest(org.knowm.xchange.gemini.v1.dto.account.GeminiWithdrawalRequest) GeminiException(org.knowm.xchange.gemini.v1.dto.GeminiException)

Aggregations

GeminiException (org.knowm.xchange.gemini.v1.dto.GeminiException)1 GeminiWithdrawalRequest (org.knowm.xchange.gemini.v1.dto.account.GeminiWithdrawalRequest)1 GeminiWithdrawalResponse (org.knowm.xchange.gemini.v1.dto.account.GeminiWithdrawalResponse)1