public LunoAPIImpl(String key, String secret, String uri, ClientConfig clientConfig) { luno = RestProxyFactory.createProxy(LunoAuthenticated.class, uri, clientConfig); auth = new BasicAuthCredentials(key, secret); }
public void setError(String value) { if (value != null) { throw new ExceptionalReturnContentException(value); } } }
@Override public String digestParams(RestInvocation restInvocation) { return restInvocation.getPath(); } }
protected BitcoinCoreAccountServiceRaw(Exchange exchange) { super(exchange); ExchangeSpecification specification = exchange.getExchangeSpecification(); ClientConfig config = getClientConfig(); String user = specification.getUserName(); ClientConfigUtil.addBasicAuthCredentials( config, user == null ? "" : user, specification.getPassword()); bitcoinCore = RestProxyFactory.createProxy(BitcoinCore.class, specification.getPlainTextUri(), config); }
public ReturnNextNonceApi getNextNonceApi() { if (null == nextNonceApi) { nextNonceApi = RestProxyFactory.createProxy(ReturnNextNonceApi.class, exchangeSpecification.getSslUri()); } return nextNonceApi; }
protected TrueFxMarketDataServiceRaw(Exchange exchange) { super(exchange); final ClientConfig config = getClientConfig(); config.setJacksonObjectMapperFactory(factory); trueFx = RestProxyFactory.createProxy( TrueFxPublic.class, exchange.getExchangeSpecification().getPlainTextUri(), config); }
public CoinEggTradeAdd getCoinEggTradeAdd( BigDecimal amount, BigDecimal price, String type, String coin) throws IOException { return coinEggAuthenticated.getTradeAdd( apiKey, signer, nonceFactory.createValue(), amount, price, type, coin); }
@Override public String digestParams(RestInvocation restInvocation) { String path = "/" + restInvocation.getMethodPath(); String queryString = restInvocation.getQueryString(); if (queryString != null && queryString.length() > 0) path += "?" + restInvocation.getQueryString(); return builder .withClaim("path", path) .withClaim("nonce", String.valueOf(nonceFactory.createValue())) .withClaim("token_id", tokenID) .sign(Algorithm.HMAC256(userSecret)); } }
protected RuntimeException handleHttpError(HttpStatusIOException exception) throws IOException { if (exception.getHttpStatusCode() == 304) { return new NonceException(exception.getHttpBody()); } else { throw exception; } }
/** C-tor used by ExchangeFactory */ @SuppressWarnings("unused") public BleutradeExchange() { this(new RestProxyFactoryImpl()); }
@Override public String toString() { return String.format( "%s errorType[%s] error[%s] message[%s]", super.toString(), errorType, error, message); } }
protected HitbtcBaseService(Exchange exchange) { super(exchange); String apiKey = exchange.getExchangeSpecification().getApiKey(); String secretKey = exchange.getExchangeSpecification().getSecretKey(); ClientConfig config = getClientConfig(); ClientConfigUtil.addBasicAuthCredentials(config, apiKey, secretKey); hitbtc = RestProxyFactory.createProxy( HitbtcAuthenticated.class, exchange.getExchangeSpecification().getSslUri(), config); } }
public CoinEggTradeView getCoinEggTradeView(String tradeID, String coin) throws IOException { return coinEggAuthenticated.getTradeView( apiKey, signer, nonceFactory.createValue(), tradeID, coin); } }
public LivecoinBaseResponse(@JsonProperty("success") Boolean success) { if (success != null && !success) { throw new ExceptionalReturnContentException("Success set to false in response"); } } }
public BitMarketExchange() { this(new RestProxyFactoryImpl()); }
public CoinEggBalance getCoinEggBalance() throws IOException { return coinEggAuthenticated.getBalance(apiKey, nonceFactory.createValue(), signer); } }
public TransferResponse( @JsonProperty("success") int success, @JsonProperty("message") String message) { if (success != 1) { throw new ExceptionalReturnContentException("Error returned: " + success); } this.message = message; }
public CoinEggTradeCancel getCoinEggTradeCancel(String id, String coin) throws IOException { return coinEggAuthenticated.getTradeCancel( apiKey, signer, nonceFactory.createValue(), id, coin); }
public WithdrawalResponse( @JsonProperty("response") String response, @JsonProperty("error") String error) { if (error != null) { throw new ExceptionalReturnContentException("Error returned: " + error); } this.response = response; }
public BittrexBaseResponse( @JsonProperty("success") Boolean success, @JsonProperty("message") String message, @JsonProperty("result") T result) { if (!success) { throw new ExceptionalReturnContentException(message); } this.result = result; }