-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,249 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
xchange-ccex/src/main/java/org/knowm/xchange/ccex/CCEXUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.knowm.xchange.ccex; | ||
|
||
import java.text.ParseException; | ||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
import java.util.TimeZone; | ||
|
||
import org.knowm.xchange.currency.CurrencyPair; | ||
|
||
public class CCEXUtils { | ||
|
||
private static final Date EPOCH = new Date(0); | ||
|
||
private CCEXUtils() { | ||
|
||
} | ||
|
||
public static String toPairString(CurrencyPair currencyPair) { | ||
|
||
return currencyPair.counter.getCurrencyCode().toLowerCase() + "-" | ||
+ currencyPair.base.getCurrencyCode().toLowerCase(); | ||
} | ||
|
||
public static Date toDate(String datetime) { | ||
SimpleDateFormat sdf; | ||
|
||
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
|
||
sdf.setTimeZone(TimeZone.getTimeZone("UTC")); | ||
|
||
try { | ||
return sdf.parse(datetime); | ||
} catch (ParseException e) { | ||
return EPOCH; | ||
} | ||
} | ||
} |
130 changes: 130 additions & 0 deletions
130
xchange-ccex/src/main/java/org/knowm/xchange/ccex/dto/ticker/CCEXPriceResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
package org.knowm.xchange.ccex.dto.ticker; | ||
|
||
import java.math.BigDecimal; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public class CCEXPriceResponse { | ||
|
||
private BigDecimal high; | ||
private BigDecimal low; | ||
private BigDecimal avg; | ||
private BigDecimal lastbuy; | ||
private BigDecimal lastsell; | ||
private BigDecimal buy; | ||
private BigDecimal sell; | ||
private BigDecimal lastprice; | ||
private BigDecimal buysupport; | ||
private int updated; | ||
|
||
public CCEXPriceResponse( | ||
@JsonProperty("high") BigDecimal high, | ||
@JsonProperty("low") BigDecimal low, | ||
@JsonProperty("avg") BigDecimal avg, | ||
@JsonProperty("lastbuy") BigDecimal lastbuy, | ||
@JsonProperty("lastsell") BigDecimal lastsell, | ||
@JsonProperty("buy") BigDecimal buy, | ||
@JsonProperty("sell") BigDecimal sell, | ||
@JsonProperty("lastprice") BigDecimal lastprice, | ||
@JsonProperty("buysupport") BigDecimal buysupport, | ||
@JsonProperty("updated") int updated) { | ||
super(); | ||
this.high = high; | ||
this.low = low; | ||
this.avg = avg; | ||
this.lastbuy = lastbuy; | ||
this.lastsell = lastsell; | ||
this.buy = buy; | ||
this.sell = sell; | ||
this.lastprice = lastprice; | ||
this.buysupport = buysupport; | ||
this.updated = updated; | ||
} | ||
|
||
public BigDecimal getHigh() { | ||
return high; | ||
} | ||
|
||
public void setHigh(BigDecimal high) { | ||
this.high = high; | ||
} | ||
|
||
public BigDecimal getLow() { | ||
return low; | ||
} | ||
|
||
public void setLow(BigDecimal low) { | ||
this.low = low; | ||
} | ||
|
||
public BigDecimal getAvg() { | ||
return avg; | ||
} | ||
|
||
public void setAvg(BigDecimal avg) { | ||
this.avg = avg; | ||
} | ||
|
||
public BigDecimal getLastbuy() { | ||
return lastbuy; | ||
} | ||
|
||
public void setLastbuy(BigDecimal lastbuy) { | ||
this.lastbuy = lastbuy; | ||
} | ||
|
||
public BigDecimal getLastsell() { | ||
return lastsell; | ||
} | ||
|
||
public void setLastsell(BigDecimal lastsell) { | ||
this.lastsell = lastsell; | ||
} | ||
|
||
public BigDecimal getBuy() { | ||
return buy; | ||
} | ||
|
||
public void setBuy(BigDecimal buy) { | ||
this.buy = buy; | ||
} | ||
|
||
public BigDecimal getSell() { | ||
return sell; | ||
} | ||
|
||
public void setSell(BigDecimal sell) { | ||
this.sell = sell; | ||
} | ||
|
||
public BigDecimal getLastprice() { | ||
return lastprice; | ||
} | ||
|
||
public void setLastprice(BigDecimal lastprice) { | ||
this.lastprice = lastprice; | ||
} | ||
|
||
public BigDecimal getBuysupport() { | ||
return buysupport; | ||
} | ||
|
||
public void setBuysupport(BigDecimal buysupport) { | ||
this.buysupport = buysupport; | ||
} | ||
|
||
public int getUpdated() { | ||
return updated; | ||
} | ||
|
||
public void setUpdated(int updated) { | ||
this.updated = updated; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CCEXPriceResponse [high=" + high + ", low=" + low + ", avg=" + avg + ", lastbuy=" + lastbuy | ||
+ ", lastsell=" + lastsell + ", buy=" + buy + ", sell=" + sell + ", lastprice=" + lastprice | ||
+ ", buysupport=" + buysupport + ", updated=" + updated + "]"; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
xchange-ccex/src/main/java/org/knowm/xchange/ccex/dto/ticker/CCEXTickerResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.knowm.xchange.ccex.dto.ticker; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
public class CCEXTickerResponse { | ||
|
||
private CCEXPriceResponse ticker; | ||
|
||
public CCEXTickerResponse(@JsonProperty("ticker") CCEXPriceResponse ticker) { | ||
super(); | ||
this.ticker = ticker; | ||
} | ||
|
||
public CCEXPriceResponse getTicker() { | ||
return ticker; | ||
} | ||
|
||
public void setTicker(CCEXPriceResponse ticker) { | ||
this.ticker = ticker; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CCEXTickerResponse [ticker=" + ticker + "]"; | ||
} | ||
} |
Oops, something went wrong.