-
Notifications
You must be signed in to change notification settings - Fork 45
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
1 parent
27469df
commit 084eba6
Showing
9 changed files
with
119 additions
and
35 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
10 changes: 0 additions & 10 deletions
10
src/main/java/com/cf/client/poloniex/wss/model/PolonicexWSSOrderBook.java
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
src/main/java/com/cf/client/poloniex/wss/model/PoloniexOrderBook.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,30 @@ | ||
package com.cf.client.poloniex.wss.model; | ||
|
||
import com.google.gson.Gson; | ||
import java.util.Map; | ||
import java.util.TreeMap; | ||
|
||
/** | ||
* | ||
* @author David | ||
*/ | ||
public class PoloniexOrderBook { | ||
|
||
public final Map<String, PoloniexOrderBookEntry> bids; | ||
public final Map<String, PoloniexOrderBookEntry> asks; | ||
|
||
public PoloniexOrderBook() { | ||
this.bids = new TreeMap<>(); | ||
this.asks = new TreeMap<>(); | ||
} | ||
|
||
public PoloniexOrderBook(Map<String, PoloniexOrderBookEntry> bids, Map<String, PoloniexOrderBookEntry> asks) { | ||
this.bids = bids; | ||
this.asks = asks; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new Gson().toJson(this); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/cf/client/poloniex/wss/model/PoloniexOrderBookEntry.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 com.cf.client.poloniex.wss.model; | ||
|
||
import com.google.gson.Gson; | ||
import java.math.BigDecimal; | ||
|
||
/** | ||
* | ||
* @author David | ||
*/ | ||
public class PoloniexOrderBookEntry { | ||
|
||
public final String type; | ||
public final BigDecimal rate; | ||
public final BigDecimal amount; | ||
|
||
public PoloniexOrderBookEntry(String type, BigDecimal rate, BigDecimal amount) { | ||
this.type = type; | ||
this.rate = rate; | ||
this.amount = amount; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new Gson().toJson(this); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/cf/client/poloniex/wss/model/PoloniexWSSOrderBookUpdate.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,27 @@ | ||
package com.cf.client.poloniex.wss.model; | ||
|
||
import com.google.gson.Gson; | ||
|
||
/** | ||
* | ||
* @author David | ||
*/ | ||
public class PoloniexWSSOrderBookUpdate { | ||
|
||
public final Double currencyPair; | ||
public final Double orderNumber; | ||
public final PoloniexOrderBookEntry previousEntry; | ||
public final PoloniexWSSOrderBookUpdate replacementEntry; | ||
|
||
public PoloniexWSSOrderBookUpdate(Double currencyPair, Double orderNumber, PoloniexOrderBookEntry previousEntry, PoloniexWSSOrderBookUpdate replacementEntry) { | ||
this.currencyPair = currencyPair; | ||
this.orderNumber = orderNumber; | ||
this.previousEntry = previousEntry; | ||
this.replacementEntry = replacementEntry; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return new Gson().toJson(this); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/cf/client/wss/handler/NoOpMessageHandler.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,15 @@ | ||
|
||
package com.cf.client.wss.handler; | ||
|
||
/** | ||
* | ||
* @author David | ||
*/ | ||
public class NoOpMessageHandler implements IMessageHandler { | ||
|
||
@Override | ||
public void handle(String message) { | ||
// do nothing | ||
} | ||
|
||
} |
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