forked from knowm/XChange
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of https://github.com/knowm/XChange into ftx-s…
…tream
- Loading branch information
Showing
28 changed files
with
824 additions
and
60 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
29 changes: 29 additions & 0 deletions
29
...main/java/org/knowm/xchange/btcmarkets/dto/v3/marketdata/BTCMarketsMarketTradeParams.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,29 @@ | ||
package org.knowm.xchange.btcmarkets.dto.v3.marketdata; | ||
|
||
import org.knowm.xchange.currency.CurrencyPair; | ||
import org.knowm.xchange.instrument.Instrument; | ||
import org.knowm.xchange.service.marketdata.params.Params; | ||
|
||
public class BTCMarketsMarketTradeParams implements Params { | ||
public Integer limit; | ||
public Long before; | ||
public Long after; | ||
public CurrencyPair currencyPair; | ||
|
||
public BTCMarketsMarketTradeParams( | ||
Instrument currencyPair, Integer limit, Long before, Long after) { | ||
super(); | ||
this.limit = limit; | ||
this.before = before; | ||
this.after = after; | ||
this.currencyPair = (CurrencyPair) currencyPair; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
|
||
return String.format( | ||
"BTCMarketsMarketTradeParams: {limit: %s, before: %s, after: %s, CurrencyPair: %s}", | ||
limit, before, after, currencyPair); | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
...markets/src/main/java/org/knowm/xchange/btcmarkets/dto/v3/marketdata/BTCMarketsTrade.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,66 @@ | ||
package org.knowm.xchange.btcmarkets.dto.v3.marketdata; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import java.math.BigDecimal; | ||
import java.util.Date; | ||
import org.knowm.xchange.utils.jackson.ISO8601DateDeserializer; | ||
|
||
public class BTCMarketsTrade { | ||
|
||
/* Sample message: | ||
"id": "4107372347", | ||
"price": "0.265", | ||
"amount": "11.25", | ||
"timestamp": "2019-09-02T12:49:42.874000Z", | ||
"side": "Ask" | ||
*/ | ||
|
||
private final Long id; | ||
private final BigDecimal price; | ||
private final BigDecimal amount; | ||
private final Date timestamp; | ||
private final String side; | ||
|
||
public BTCMarketsTrade( | ||
@JsonProperty("id") Long id, | ||
@JsonProperty("price") BigDecimal price, | ||
@JsonProperty("amount") BigDecimal amount, | ||
@JsonProperty("timestamp") @JsonDeserialize(using = ISO8601DateDeserializer.class) | ||
Date timestamp, | ||
@JsonProperty("side") String side) { | ||
super(); | ||
this.id = id; | ||
this.price = price; | ||
this.amount = amount; | ||
this.timestamp = timestamp; | ||
this.side = side; | ||
} | ||
|
||
public Long getId() { | ||
return id; | ||
} | ||
|
||
public BigDecimal getPrice() { | ||
return price; | ||
} | ||
|
||
public BigDecimal getAmount() { | ||
return amount; | ||
} | ||
|
||
public Date getTimestamp() { | ||
return timestamp; | ||
} | ||
|
||
public String getSide() { | ||
return side; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format( | ||
"BTCMarketsTrade{id=%s, price=%s, amount=%s, timestamp='%s', side='%s'} ", | ||
id, price, amount, timestamp, side); | ||
} | ||
} |
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
Oops, something went wrong.