Search in sources :

Example 1 with AuthAggregate

use of org.knowm.xchange.independentreserve.dto.auth.AuthAggregate in project XChange by knowm.

the class IndependentReserveAccountServiceRaw method getIndependentReserveBalance.

public IndependentReserveBalance getIndependentReserveBalance() throws IOException {
    Long nonce = exchange.getNonceFactory().createValue();
    String apiKey = exchange.getExchangeSpecification().getApiKey();
    AuthAggregate authAggregate = new AuthAggregate(apiKey, nonce);
    authAggregate.setSignature(signatureCreator.digestParamsToString(ExchangeEndpoint.GET_ACCOUNTS, nonce, authAggregate.getParameters()));
    IndependentReserveBalance independentReserveBalance = independentReserveAuthenticated.getBalance(authAggregate);
    if (independentReserveBalance == null) {
        throw new ExchangeException("Error getting balance");
    }
    return independentReserveBalance;
}
Also used : AuthAggregate(org.knowm.xchange.independentreserve.dto.auth.AuthAggregate) ExchangeException(org.knowm.xchange.exceptions.ExchangeException) IndependentReserveBalance(org.knowm.xchange.independentreserve.dto.account.IndependentReserveBalance)

Aggregations

ExchangeException (org.knowm.xchange.exceptions.ExchangeException)1 IndependentReserveBalance (org.knowm.xchange.independentreserve.dto.account.IndependentReserveBalance)1 AuthAggregate (org.knowm.xchange.independentreserve.dto.auth.AuthAggregate)1