src/main/java/BittrexApiClient.java
private String makeRequest(
        boolean signed,
        String operation,
        NameValuePair ...parameters ) throws ApiException, URISyntaxException, IOException, AuthenticationException {

        if( signed && ( StringUtils.isEmpty( apiKey ) || StringUtils.isEmpty( apiSecret ) ) ) {
            throw new AuthenticationException( operation );
        }

        URIBuilder apiEndpointUriBuilder = new URIBuilder()
            .setScheme( API_SCHEME )
            .setHost( API_HOST )
            .setPath( API_PATH_ROOT + operation );

        for( NameValuePair parameter : parameters ) {

            if( StringUtils.isEmpty( parameter.getValue() ) ) {
                continue;
            }
            apiEndpointUriBuilder.addParameter(
                parameter.getName(),
                parameter.getValue()
            );

        }

        String signature = null;
        if( signed ) {

            apiEndpointUriBuilder.addParameter( API_PARAM_API_KEY, apiKey );
            apiEndpointUriBuilder.addParameter(
                API_PARAM_TIMESTAMP,
                String.valueOf( new Date().getTime() )
            );

            signature = new HmacUtils( HmacAlgorithms.HMAC_SHA_512, apiSecret ).hmacHex(
                apiEndpointUriBuilder.build().toString()
            );

        }

        HttpGet httpGet = new HttpGet( apiEndpointUriBuilder.build().toString() );
        if( signed ) {
            httpGet.addHeader( API_PARAM_API_SIGN, signature );
        }

        HttpResponse rawResponse = HttpClientBuilder
            .create()
            .setServiceUnavailableRetryStrategy( new BittrexRetryHandler() )
            .build()
            .execute( httpGet );
        BittrexResponse parsedResponse = MAPPER.readValue(
            rawResponse.getEntity().getContent(),
            BittrexResponse.class
        );
        if( parsedResponse.isSuccess() ) {
            return parsedResponse.getResult();
        }
        throw new ApiException( parsedResponse );

    }
/**
     * Utility method that sends a request to the Bittrex's API, handling the
     * authentication through the API key and API secret possibly given when
     * instantiating the client itself.
     *
     * @param signed     Used to tell if the operation must be signed using the
     *                   {@link #apiKey} and {@link #apiSecret} or not.
     * @param operation  The Bittrex's API operation that we would like to call.
     * @param parameters The parameters which the operation takes in.
     *
     * @return A serialized representation of Bittrex's response JSON response.
     */
Utility method that sends a request to the Bittrex's API, handling the
authentication through the API key and API secret possibly given when
instantiating the client itself.

@param signed     Used to tell if the operation must be signed using the
#apiKey and  #apiSecret or not.
@param operation  The Bittrex's API operation that we would like to call.
@param parameters The parameters which the operation takes in.

@return A serialized representation of Bittrex's response JSON response.
Utility method that sends a request to the Bittrex ' s API handling the authentication through the API key and API secret possibly given when instantiating the client itself . @param signed Used to tell if the operation must be signed using the #apiKey and #apiSecret or not . @param operation The Bittrex ' s API operation that we would like to call . @param parameters The parameters which the operation takes in . @return A serialized representation of Bittrex ' s response JSON response .
private String makeRequest(
        boolean signed,
        String operation,
        NameValuePair ...parameters ) throws ApiException, URISyntaxException, IOException, AuthenticationException {
        if( signed && ( StringUtils.isEmpty( apiKey ) || StringUtils.isEmpty( apiSecret ) ) ) {
            throw new AuthenticationException( operation );
        }
        URIBuilder apiEndpointUriBuilder = new URIBuilder()
            .setScheme( API_SCHEME )
            .setHost( API_HOST )
            .setPath( API_PATH_ROOT + operation );
        for( NameValuePair parameter : parameters ) {
            if( StringUtils.isEmpty( parameter.getValue() ) ) {
                continue;
            }
            apiEndpointUriBuilder.addParameter(
                parameter.getName(),
                parameter.getValue()
            );
        }
        String signature = null;
        if( signed ) {
            apiEndpointUriBuilder.addParameter( API_PARAM_API_KEY, apiKey );
            apiEndpointUriBuilder.addParameter(
                API_PARAM_TIMESTAMP,
                String.valueOf( new Date().getTime() )
            );
            signature = new HmacUtils( HmacAlgorithms.HMAC_SHA_512, apiSecret ).hmacHex(
                apiEndpointUriBuilder.build().toString()
            );
        }
        HttpGet httpGet = new HttpGet( apiEndpointUriBuilder.build().toString() );
        if( signed ) {
            httpGet.addHeader( API_PARAM_API_SIGN, signature );
        }
        HttpResponse rawResponse = HttpClientBuilder
            .create()
            .setServiceUnavailableRetryStrategy( new BittrexRetryHandler() )
            .build()
            .execute( httpGet );
        BittrexResponse parsedResponse = MAPPER.readValue(
            rawResponse.getEntity().getContent(),
            BittrexResponse.class
        );
        if( parsedResponse.isSuccess() ) {
            return parsedResponse.getResult();
        }
        throw new ApiException( parsedResponse );
    }
private String makeRequest ( boolean signed , String operation , NameValuePair ... parameters ) throws ApiException , URISyntaxException , IOException , AuthenticationException { if ( signed && ( StringUtils . isEmpty ( apiKey ) || StringUtils . isEmpty ( apiSecret ) ) ) { throw new AuthenticationException ( operation ) ; } URIBuilder apiEndpointUriBuilder = new URIBuilder ( ) . setScheme ( API_SCHEME ) . setHost ( API_HOST ) . setPath ( API_PATH_ROOT + operation ) ; for ( NameValuePair parameter : parameters ) { if ( StringUtils . isEmpty ( parameter . getValue ( ) ) ) { continue ; } apiEndpointUriBuilder . addParameter ( parameter . getName ( ) , parameter . getValue ( ) ) ; } String signature = null ; if ( signed ) { apiEndpointUriBuilder . addParameter ( API_PARAM_API_KEY , apiKey ) ; apiEndpointUriBuilder . addParameter ( API_PARAM_TIMESTAMP , String . valueOf ( new Date ( ) . getTime ( ) ) ) ; signature = new HmacUtils ( HmacAlgorithms . HMAC_SHA_512 , apiSecret ) . hmacHex ( apiEndpointUriBuilder . build ( ) . toString ( ) ) ; } HttpGet httpGet = new HttpGet ( apiEndpointUriBuilder . build ( ) . toString ( ) ) ; if ( signed ) { httpGet . addHeader ( API_PARAM_API_SIGN , signature ) ; } HttpResponse rawResponse = HttpClientBuilder . create ( ) . setServiceUnavailableRetryStrategy ( new BittrexRetryHandler ( ) ) . build ( ) . execute ( httpGet ) ; BittrexResponse parsedResponse = MAPPER . readValue ( rawResponse . getEntity ( ) . getContent ( ) , BittrexResponse . class ) ; if ( parsedResponse . isSuccess ( ) ) { return parsedResponse . getResult ( ) ; } throw new ApiException ( parsedResponse ) ; }
Utility method that sends a request to the Bittrex's API, handling the
 authentication through the API key and API secret possibly given when
 instantiating the client itself.
Utility method that sends a request to the Bittrex ' s API handling the authentication through the API key and API secret possibly given when instantiating the client itself .