Skip to content

Commit

Permalink
Merge pull request #45 from revidee/develop
Browse files Browse the repository at this point in the history
Fixed new JSON Format for the https://bittrex.com/api/v2.0/pub/mark…
  • Loading branch information
CCob authored Sep 26, 2018
2 parents 0e887bb + 23e49ca commit 7088e2e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/github/ccob/bittrex4j/BittrexExchange.java
Original file line number Diff line number Diff line change
Expand Up @@ -605,11 +605,11 @@ public void run() {
}else{
log.warn("HTTP request failed with error code {} and reason {}",responseCode,httpResponse.getStatusLine().getReasonPhrase());
task.cancel();
return new Response<>(false,httpResponse.getStatusLine().getReasonPhrase(),null);
return new Response<>(false,httpResponse.getStatusLine().getReasonPhrase(),null, "");
}

} catch (NoSuchAlgorithmException | IOException | InvalidKeyException e) {
return new Response<>(false,e.getMessage(),null);
return new Response<>(false,e.getMessage(),null, "");
} finally {

if(httpResponse != null){
Expand Down
8 changes: 7 additions & 1 deletion src/main/java/com/github/ccob/bittrex4j/dao/Market.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ public class Market {
private String notice;
private boolean isSponsored;
private String logoUrl;
private boolean isRestricted;

@JsonCreator
public Market( @JsonProperty("MarketCurrency") String marketCurrency, @JsonProperty("BaseCurrency") String baseCurrency,
@JsonProperty("MarketCurrencyLong") String marketCurrencyLong, @JsonProperty("BaseCurrencyLong") String baseCurrencyLong, @JsonProperty("MinTradeSize") double minTradeSize,
@JsonProperty("MarketName") String marketName, @JsonProperty("IsActive") boolean isActive,
@JsonProperty("Created") ZonedDateTime created, @JsonProperty("Notice") String notice,
@JsonProperty("IsSponsored") boolean isSponsored, @JsonProperty("LogoUrl") String logoUrl) {
@JsonProperty("IsSponsored") boolean isSponsored, @JsonProperty("LogoUrl") String logoUrl, @JsonProperty("IsRestricted") boolean isRestricted) {
this.marketCurrency = marketCurrency;
this.baseCurrency = baseCurrency;
this.marketCurrencyLong = marketCurrencyLong;
Expand All @@ -51,6 +52,11 @@ public Market( @JsonProperty("MarketCurrency") String marketCurrency, @JsonPrope
this.notice = notice;
this.isSponsored = isSponsored;
this.logoUrl = logoUrl;
this.isRestricted = isRestricted;
}

public boolean isRestricted() {
return isRestricted;
}

public String getMarketCurrency() {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/github/ccob/bittrex4j/dao/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ public class Response<Result> {
boolean success;
String message;
Result result;
String explanation;

@JsonCreator
public Response(@JsonProperty("success") boolean success,
@JsonProperty("message") String message,
@JsonProperty("result") Result result) {
@JsonProperty("result") Result result, @JsonProperty("explanation") String explanation) {
this.success = success;
this.message = message;
this.result = result;
this.explanation = explanation;
}

public boolean isSuccess() {
Expand All @@ -40,4 +42,6 @@ public String getMessage() {
public Result getResult() {
return result;
}

public String getExplanation() {return explanation;}
}

0 comments on commit 7088e2e

Please sign in to comment.