From 5b622dccdf16c93125269508cde6fde7814fdf5c Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Fri, 7 Dec 2018 20:55:23 -0500 Subject: [PATCH 01/24] 4.3.13-SNAPSHOT --- pom.xml | 4 ++-- service-core/pom.xml | 2 +- service-netty/pom.xml | 2 +- service-pubnub/pom.xml | 2 +- service-pusher/pom.xml | 2 +- service-wamp/pom.xml | 2 +- xchange-binance/pom.xml | 2 +- xchange-bitfinex/pom.xml | 2 +- xchange-bitflyer/pom.xml | 2 +- xchange-bitmex/pom.xml | 2 +- xchange-bitstamp/pom.xml | 2 +- xchange-cexio/pom.xml | 2 +- xchange-coinmate/pom.xml | 2 +- xchange-gdax/pom.xml | 2 +- xchange-gemini/pom.xml | 2 +- xchange-hitbtc/pom.xml | 2 +- xchange-okcoin/pom.xml | 2 +- xchange-poloniex/pom.xml | 2 +- xchange-poloniex2/pom.xml | 2 +- xchange-stream-core/pom.xml | 2 +- xchange-wex/pom.xml | 2 +- 21 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pom.xml b/pom.xml index dcd5f0206..4538f3b99 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ info.bitrich.xchange-stream xchange-stream-parent pom - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT xchange-stream-core @@ -80,7 +80,7 @@ - 4.3.11 + 4.3.13-SNAPSHOT UTF-8 UTF-8 1.8 diff --git a/service-core/pom.xml b/service-core/pom.xml index 9df4ebeb1..f8aa4c8e2 100644 --- a/service-core/pom.xml +++ b/service-core/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/service-netty/pom.xml b/service-netty/pom.xml index 18810e325..a67b60f01 100644 --- a/service-netty/pom.xml +++ b/service-netty/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/service-pubnub/pom.xml b/service-pubnub/pom.xml index 98f00eaa9..ec12eed78 100644 --- a/service-pubnub/pom.xml +++ b/service-pubnub/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/service-pusher/pom.xml b/service-pusher/pom.xml index 57aedf666..0785801e1 100644 --- a/service-pusher/pom.xml +++ b/service-pusher/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/service-wamp/pom.xml b/service-wamp/pom.xml index 5bb3b6605..ae409b1e9 100644 --- a/service-wamp/pom.xml +++ b/service-wamp/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-binance/pom.xml b/xchange-binance/pom.xml index a34e752ac..5b9c498ed 100644 --- a/xchange-binance/pom.xml +++ b/xchange-binance/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-bitfinex/pom.xml b/xchange-bitfinex/pom.xml index d96ef70d1..8e9b79e2c 100644 --- a/xchange-bitfinex/pom.xml +++ b/xchange-bitfinex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-bitflyer/pom.xml b/xchange-bitflyer/pom.xml index cc3289eda..61b5ecd4e 100644 --- a/xchange-bitflyer/pom.xml +++ b/xchange-bitflyer/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-bitmex/pom.xml b/xchange-bitmex/pom.xml index c856ffe79..16aedf5bd 100644 --- a/xchange-bitmex/pom.xml +++ b/xchange-bitmex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-bitstamp/pom.xml b/xchange-bitstamp/pom.xml index 16904e256..5852e2bd3 100644 --- a/xchange-bitstamp/pom.xml +++ b/xchange-bitstamp/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-cexio/pom.xml b/xchange-cexio/pom.xml index ca101ec65..d8a49f0a8 100644 --- a/xchange-cexio/pom.xml +++ b/xchange-cexio/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-coinmate/pom.xml b/xchange-coinmate/pom.xml index cbdbe71c6..671ece981 100644 --- a/xchange-coinmate/pom.xml +++ b/xchange-coinmate/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-gdax/pom.xml b/xchange-gdax/pom.xml index d020b93ed..df024d298 100644 --- a/xchange-gdax/pom.xml +++ b/xchange-gdax/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-gemini/pom.xml b/xchange-gemini/pom.xml index 93673488c..80f22af34 100644 --- a/xchange-gemini/pom.xml +++ b/xchange-gemini/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-hitbtc/pom.xml b/xchange-hitbtc/pom.xml index ea63f5263..2964fc183 100644 --- a/xchange-hitbtc/pom.xml +++ b/xchange-hitbtc/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-okcoin/pom.xml b/xchange-okcoin/pom.xml index 5bb11fd7d..ef662146e 100644 --- a/xchange-okcoin/pom.xml +++ b/xchange-okcoin/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-poloniex/pom.xml b/xchange-poloniex/pom.xml index e4da2205f..2f093668d 100644 --- a/xchange-poloniex/pom.xml +++ b/xchange-poloniex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-poloniex2/pom.xml b/xchange-poloniex2/pom.xml index bf83b3259..a7c2799ee 100644 --- a/xchange-poloniex2/pom.xml +++ b/xchange-poloniex2/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-stream-core/pom.xml b/xchange-stream-core/pom.xml index 01c598a15..23d851476 100644 --- a/xchange-stream-core/pom.xml +++ b/xchange-stream-core/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 diff --git a/xchange-wex/pom.xml b/xchange-wex/pom.xml index ba8c06607..b1d02f23a 100644 --- a/xchange-wex/pom.xml +++ b/xchange-wex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.12-SNAPSHOT + 4.3.13-SNAPSHOT 4.0.0 From dcf4ca1d0f8a53ed01adec3b9d8510dd9fc01721 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Mon, 7 Jan 2019 23:00:59 -0500 Subject: [PATCH 02/24] Getting access to authenticated channels, "execution", "order", "margin", "position", "wallet" --- xchange-bitmex/pom.xml | 2 +- .../bitmex/BitmexStreamingExchange.java | 4 +++ .../BitmexStreamingMarketDataService.java | 2 +- .../bitmex/BitmexStreamingService.java | 27 ++++++++++--------- .../BitmexWebSocketSubscriptionMessage.java | 6 ++++- 5 files changed, 25 insertions(+), 16 deletions(-) diff --git a/xchange-bitmex/pom.xml b/xchange-bitmex/pom.xml index 16aedf5bd..678c09822 100644 --- a/xchange-bitmex/pom.xml +++ b/xchange-bitmex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java index c9cf0ab8b..6effe28b0 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java @@ -65,4 +65,8 @@ public boolean isAlive() { @Override public void useCompressedMessages(boolean compressedMessages) { streamingService.useCompressedMessages(compressedMessages); } + + public BitmexStreamingService getStreamingService() { + return streamingService; + } } diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingMarketDataService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingMarketDataService.java index bf97ac90b..2566f8aa5 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingMarketDataService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingMarketDataService.java @@ -34,7 +34,7 @@ public BitmexStreamingMarketDataService(BitmexStreamingService streamingService) @Override public Observable getOrderBook(CurrencyPair currencyPair, Object... args) { - String instrument = currencyPair.base.toString() + currencyPair.counter.toString(); + String instrument = currencyPair.base.getCurrencyCode() + currencyPair.counter.getCurrencyCode(); String channelName = String.format("orderBookL2:%s", instrument); return streamingService.subscribeBitmexChannel(channelName).map(s -> { diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index cafc16efa..b5436e88f 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -1,22 +1,15 @@ package info.bitrich.xchangestream.bitmex; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; -import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - import info.bitrich.xchangestream.bitmex.dto.BitmexWebSocketSubscriptionMessage; import info.bitrich.xchangestream.bitmex.dto.BitmexWebSocketTransaction; import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; +import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; import io.reactivex.Observable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; /** * Created by Lukas Zaoralek on 13.11.17. @@ -36,6 +29,7 @@ protected void handleMessage(JsonNode message) { if (message.has("error")) { String error = message.get("error").asText(); LOG.error("Error with message: " + error); + LOG.debug("Error with message: " + message.toString()); return; } @@ -52,7 +46,7 @@ public Observable subscribeBitmexChannel(String chan BitmexWebSocketTransaction transaction = objectMapper.treeToValue(s, BitmexWebSocketTransaction.class); return transaction; }) - .share(); + .share(); } @Override @@ -73,4 +67,11 @@ public String getUnsubscribeMessage(String channelName) throws IOException { BitmexWebSocketSubscriptionMessage subscribeMessage = new BitmexWebSocketSubscriptionMessage("unsubscribe", new String[]{}); return objectMapper.writeValueAsString(subscribeMessage); } + public void sendAuthKeyExpires(Object[] signature) throws IOException { + + BitmexWebSocketSubscriptionMessage subscribeMessage = + new BitmexWebSocketSubscriptionMessage("authKeyExpires", signature); + + sendMessage( objectMapper.writeValueAsString(subscribeMessage)); + } } diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexWebSocketSubscriptionMessage.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexWebSocketSubscriptionMessage.java index e19c5da60..9c5539f0b 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexWebSocketSubscriptionMessage.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexWebSocketSubscriptionMessage.java @@ -13,10 +13,14 @@ public class BitmexWebSocketSubscriptionMessage { private String op; @JsonProperty(ARGS) - private String[] args; + private Object[] args; public BitmexWebSocketSubscriptionMessage(String op, String[] args) { this.op = op; this.args = args; } + public BitmexWebSocketSubscriptionMessage(String op, Object[] args) { + this.op = op; + this.args = args; + } } From 780c46eea7a186fe60a130743f085dcb114ebd68 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Mon, 7 Jan 2019 23:10:55 -0500 Subject: [PATCH 03/24] 4.3.14-SNAPSHOT --- pom.xml | 4 ++-- service-core/pom.xml | 2 +- service-netty/pom.xml | 2 +- service-pubnub/pom.xml | 2 +- service-pusher/pom.xml | 2 +- service-wamp/pom.xml | 2 +- xchange-binance/pom.xml | 2 +- xchange-bitfinex/pom.xml | 2 +- xchange-bitflyer/pom.xml | 2 +- xchange-bitstamp/pom.xml | 2 +- xchange-cexio/pom.xml | 2 +- xchange-coinbasepro/pom.xml | 2 +- xchange-coinmate/pom.xml | 2 +- xchange-gemini/pom.xml | 2 +- xchange-hitbtc/pom.xml | 2 +- xchange-okcoin/pom.xml | 2 +- xchange-poloniex/pom.xml | 2 +- xchange-poloniex2/pom.xml | 2 +- xchange-stream-core/pom.xml | 2 +- xchange-wex/pom.xml | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index b529ff72d..099b81fbd 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ info.bitrich.xchange-stream xchange-stream-parent pom - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT xchange-stream-core @@ -80,7 +80,7 @@ - 4.3.13 + 4.3.14-SNAPSHOT UTF-8 UTF-8 1.8 diff --git a/service-core/pom.xml b/service-core/pom.xml index f8aa4c8e2..3dff41553 100644 --- a/service-core/pom.xml +++ b/service-core/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/service-netty/pom.xml b/service-netty/pom.xml index a67b60f01..4d05aed1a 100644 --- a/service-netty/pom.xml +++ b/service-netty/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/service-pubnub/pom.xml b/service-pubnub/pom.xml index ec12eed78..cf738a4f8 100644 --- a/service-pubnub/pom.xml +++ b/service-pubnub/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/service-pusher/pom.xml b/service-pusher/pom.xml index 0785801e1..83c15b222 100644 --- a/service-pusher/pom.xml +++ b/service-pusher/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/service-wamp/pom.xml b/service-wamp/pom.xml index ae409b1e9..3c77c09ea 100644 --- a/service-wamp/pom.xml +++ b/service-wamp/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-binance/pom.xml b/xchange-binance/pom.xml index 5b9c498ed..9b51c8964 100644 --- a/xchange-binance/pom.xml +++ b/xchange-binance/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-bitfinex/pom.xml b/xchange-bitfinex/pom.xml index 8e9b79e2c..ec5fae644 100644 --- a/xchange-bitfinex/pom.xml +++ b/xchange-bitfinex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-bitflyer/pom.xml b/xchange-bitflyer/pom.xml index 61b5ecd4e..d05fac5ea 100644 --- a/xchange-bitflyer/pom.xml +++ b/xchange-bitflyer/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-bitstamp/pom.xml b/xchange-bitstamp/pom.xml index 5852e2bd3..ac5efdde5 100644 --- a/xchange-bitstamp/pom.xml +++ b/xchange-bitstamp/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-cexio/pom.xml b/xchange-cexio/pom.xml index d8a49f0a8..39b55e341 100644 --- a/xchange-cexio/pom.xml +++ b/xchange-cexio/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-coinbasepro/pom.xml b/xchange-coinbasepro/pom.xml index bade0d744..acd2c967e 100644 --- a/xchange-coinbasepro/pom.xml +++ b/xchange-coinbasepro/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-coinmate/pom.xml b/xchange-coinmate/pom.xml index 671ece981..d888d5377 100644 --- a/xchange-coinmate/pom.xml +++ b/xchange-coinmate/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-gemini/pom.xml b/xchange-gemini/pom.xml index 80f22af34..bc5868c32 100644 --- a/xchange-gemini/pom.xml +++ b/xchange-gemini/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-hitbtc/pom.xml b/xchange-hitbtc/pom.xml index 2964fc183..6c8900de2 100644 --- a/xchange-hitbtc/pom.xml +++ b/xchange-hitbtc/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-okcoin/pom.xml b/xchange-okcoin/pom.xml index ef662146e..b5ac30907 100644 --- a/xchange-okcoin/pom.xml +++ b/xchange-okcoin/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-poloniex/pom.xml b/xchange-poloniex/pom.xml index 2f093668d..668dd250d 100644 --- a/xchange-poloniex/pom.xml +++ b/xchange-poloniex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-poloniex2/pom.xml b/xchange-poloniex2/pom.xml index a7c2799ee..d9beacda9 100644 --- a/xchange-poloniex2/pom.xml +++ b/xchange-poloniex2/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-stream-core/pom.xml b/xchange-stream-core/pom.xml index 23d851476..b74ab3d32 100644 --- a/xchange-stream-core/pom.xml +++ b/xchange-stream-core/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 diff --git a/xchange-wex/pom.xml b/xchange-wex/pom.xml index b1d02f23a..a5b3b12c6 100644 --- a/xchange-wex/pom.xml +++ b/xchange-wex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.13-SNAPSHOT + 4.3.14-SNAPSHOT 4.0.0 From 8d69f38d35f0bd9ccafdba4da074e08452f15c48 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Mon, 7 Jan 2019 23:11:40 -0500 Subject: [PATCH 04/24] CoinbaseProStreamingExchange add getStreamingService() --- .../coinbasepro/CoinbaseProStreamingExchange.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xchange-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java b/xchange-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java index 2cfb64f28..5eecd4c3b 100644 --- a/xchange-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java +++ b/xchange-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java @@ -1,16 +1,15 @@ package info.bitrich.xchangestream.coinbasepro; -import org.knowm.xchange.ExchangeSpecification; -import org.knowm.xchange.coinbasepro.CoinbaseProExchange; -import org.knowm.xchange.coinbasepro.dto.account.CoinbaseProWebsocketAuthData; -import org.knowm.xchange.coinbasepro.service.CoinbaseProAccountServiceRaw; - import info.bitrich.xchangestream.core.ProductSubscription; import info.bitrich.xchangestream.core.StreamingExchange; import info.bitrich.xchangestream.core.StreamingMarketDataService; import info.bitrich.xchangestream.service.netty.WebSocketClientHandler; import io.reactivex.Completable; import io.reactivex.Observable; +import org.knowm.xchange.ExchangeSpecification; +import org.knowm.xchange.coinbasepro.CoinbaseProExchange; +import org.knowm.xchange.coinbasepro.dto.account.CoinbaseProWebsocketAuthData; +import org.knowm.xchange.coinbasepro.service.CoinbaseProAccountServiceRaw; /** * CoinbasePro Streaming Exchange. Connects to live WebSocket feed. @@ -102,4 +101,8 @@ public boolean isAlive() { @Override public void useCompressedMessages(boolean compressedMessages) { streamingService.useCompressedMessages(compressedMessages); } + + public CoinbaseProStreamingService getStreamingService() { + return streamingService; + } } From fd1e93c8a9ff58eda9d2751895b7e438365bd04b Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Tue, 8 Jan 2019 16:25:32 -0500 Subject: [PATCH 05/24] remove unnecessary API_URI_SANDBOX --- .../bitrich/xchangestream/bitmex/BitmexStreamingExchange.java | 1 + 1 file changed, 1 insertion(+) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java index 6effe28b0..dc57b7dca 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java @@ -13,6 +13,7 @@ */ public class BitmexStreamingExchange extends BitmexExchange implements StreamingExchange { private static final String API_URI = "wss://www.bitmex.com/realtime"; + private static final String API_URI_SANDBOX = "wss://testnet.bitmex.com/realtime"; private final BitmexStreamingService streamingService; private BitmexStreamingMarketDataService streamingMarketDataService; From 07a62f5f5a7fd307285e9719d7b752b387e7d101 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Tue, 8 Jan 2019 16:26:03 -0500 Subject: [PATCH 06/24] remove unnecessary API_URI_SANDBOX --- .../bitrich/xchangestream/bitmex/BitmexStreamingExchange.java | 1 - 1 file changed, 1 deletion(-) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java index dc57b7dca..6effe28b0 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java @@ -13,7 +13,6 @@ */ public class BitmexStreamingExchange extends BitmexExchange implements StreamingExchange { private static final String API_URI = "wss://www.bitmex.com/realtime"; - private static final String API_URI_SANDBOX = "wss://testnet.bitmex.com/realtime"; private final BitmexStreamingService streamingService; private BitmexStreamingMarketDataService streamingMarketDataService; From 7df1989c169e47ed77ef053c75b8f826ee6c5363 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Fri, 11 Jan 2019 16:50:53 -0500 Subject: [PATCH 07/24] use init service for sandbox request detect support naked channel Names --- .../xchangestream/bitmex/BitmexStreamingExchange.java | 9 +++++++-- .../xchangestream/bitmex/BitmexStreamingService.java | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java index 6effe28b0..3584c7b3c 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java @@ -13,12 +13,12 @@ */ public class BitmexStreamingExchange extends BitmexExchange implements StreamingExchange { private static final String API_URI = "wss://www.bitmex.com/realtime"; + private static final String API_SANDBOX_URI = "wss://testnet.bitmex.com/realtime"; - private final BitmexStreamingService streamingService; + private BitmexStreamingService streamingService; private BitmexStreamingMarketDataService streamingMarketDataService; public BitmexStreamingExchange() { - this.streamingService = new BitmexStreamingService(API_URI); } protected BitmexStreamingExchange(BitmexStreamingService streamingService) { @@ -28,6 +28,11 @@ protected BitmexStreamingExchange(BitmexStreamingService streamingService) { @Override protected void initServices() { super.initServices(); + if (exchangeSpecification.getExchangeSpecificParametersItem(USE_SANDBOX).equals(true)) + this.streamingService = new BitmexStreamingService(API_SANDBOX_URI); + else + this.streamingService = new BitmexStreamingService(API_URI); + streamingMarketDataService = new BitmexStreamingMarketDataService(streamingService); } diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index 848909fd8..d3b1303f6 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -51,7 +51,8 @@ public Observable subscribeBitmexChannel(String chan @Override protected String getChannelNameFromMessage(JsonNode message) throws IOException { - final JsonNode symbolNode = message.get("data").get(0).get("symbol"); + final JsonNode data0 = message.get("data").get(0); + final JsonNode symbolNode = data0 == null ? null : data0.get("symbol"); final JsonNode tableNode = message.get("table"); if (symbolNode == null) From ae51fb0a0c474a9661aa34e5821704e5790ca7e1 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Fri, 11 Jan 2019 17:01:40 -0500 Subject: [PATCH 08/24] support naked channel Names --- .../service/netty/NettyStreamingService.java | 45 ++++++++----------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java b/service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java index 5a0f6b6a1..8462552a6 100644 --- a/service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java +++ b/service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java @@ -1,40 +1,15 @@ package info.bitrich.xchangestream.service.netty; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.time.Duration; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.TimeUnit; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import info.bitrich.xchangestream.service.exception.NotConnectedException; import io.netty.bootstrap.Bootstrap; -import io.netty.channel.Channel; -import io.netty.channel.ChannelFuture; -import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInitializer; -import io.netty.channel.ChannelOption; -import io.netty.channel.ChannelPipeline; +import io.netty.channel.*; import io.netty.channel.nio.NioEventLoopGroup; import io.netty.channel.socket.SocketChannel; import io.netty.channel.socket.nio.NioSocketChannel; import io.netty.handler.codec.http.DefaultHttpHeaders; import io.netty.handler.codec.http.HttpClientCodec; import io.netty.handler.codec.http.HttpObjectAggregator; -import io.netty.handler.codec.http.websocketx.CloseWebSocketFrame; -import io.netty.handler.codec.http.websocketx.TextWebSocketFrame; -import io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker; -import io.netty.handler.codec.http.websocketx.WebSocketClientHandshakerFactory; -import io.netty.handler.codec.http.websocketx.WebSocketFrame; -import io.netty.handler.codec.http.websocketx.WebSocketVersion; +import io.netty.handler.codec.http.websocketx.*; import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; import io.netty.handler.codec.http.websocketx.extensions.compression.WebSocketClientCompressionHandler; import io.netty.handler.logging.LogLevel; @@ -48,6 +23,19 @@ import io.reactivex.CompletableEmitter; import io.reactivex.Observable; import io.reactivex.ObservableEmitter; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.time.Duration; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.TimeUnit; public abstract class NettyStreamingService { private final Logger LOG = LoggerFactory.getLogger(this.getClass()); @@ -357,6 +345,9 @@ protected void handleError(T message, Throwable t) { protected void handleChannelMessage(String channel, T message) { NettyStreamingService.Subscription subscription = channels.get(channel); + if (subscription == null) + subscription = channels.get(channel.split(":")[0]); + if (subscription == null) { LOG.debug("Channel has been closed {}.", channel); return; From c82ca986a857e67fad9a8ece422581707ab8a959 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sat, 12 Jan 2019 06:46:20 -0500 Subject: [PATCH 09/24] saving authentication message builder --- .../bitmex/BitmexStreamingExchange.java | 4 +-- .../bitmex/BitmexStreamingService.java | 34 ++++++++++++++++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java index 3584c7b3c..634e6542f 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java @@ -29,9 +29,9 @@ protected BitmexStreamingExchange(BitmexStreamingService streamingService) { protected void initServices() { super.initServices(); if (exchangeSpecification.getExchangeSpecificParametersItem(USE_SANDBOX).equals(true)) - this.streamingService = new BitmexStreamingService(API_SANDBOX_URI); + this.streamingService = new BitmexStreamingService(API_SANDBOX_URI, exchangeSpecification); else - this.streamingService = new BitmexStreamingService(API_URI); + this.streamingService = new BitmexStreamingService(API_URI, exchangeSpecification); streamingMarketDataService = new BitmexStreamingMarketDataService(streamingService); } diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index d3b1303f6..2df0462d1 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -6,8 +6,12 @@ import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; import io.reactivex.Observable; +import org.knowm.xchange.ExchangeSpecification; +import org.knowm.xchange.bitmex.service.BitmexDigest; +import org.knowm.xchange.utils.nonce.ExpirationTimeFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import si.mazi.rescu.SynchronizedValueFactory; import java.io.IOException; @@ -16,12 +20,18 @@ */ public class BitmexStreamingService extends JsonNettyStreamingService { private static final Logger LOG = LoggerFactory.getLogger(BitmexStreamingService.class); + private ExchangeSpecification exchangeSpecification; public BitmexStreamingService(String apiUrl) { super(apiUrl, Integer.MAX_VALUE); + this.exchangeSpecification = null; + } + public BitmexStreamingService(String apiUrl, ExchangeSpecification exchangeSpecification) { + super(apiUrl, Integer.MAX_VALUE); + this.exchangeSpecification = exchangeSpecification; } - @Override + @Override protected void handleMessage(JsonNode message) { if (message.has("info") || message.has("success")) { return; @@ -72,11 +82,27 @@ public String getUnsubscribeMessage(String channelName) throws IOException { BitmexWebSocketSubscriptionMessage subscribeMessage = new BitmexWebSocketSubscriptionMessage("unsubscribe", new String[]{}); return objectMapper.writeValueAsString(subscribeMessage); } - public void sendAuthKeyExpires(Object[] signature) throws IOException { + +// @Override + public String getAuthenticateMessage() throws IOException { +// connect().blockingAwait(); + + BitmexDigest bitmexDigest = BitmexDigest.createInstance(exchangeSpecification.getSecretKey(), exchangeSpecification.getApiKey() ); + SynchronizedValueFactory nonceFactory = new ExpirationTimeFactory(30); + + long nonce = nonceFactory.createValue(); + String payload = "GET/realtime" + nonce; + String digestString = bitmexDigest.digestString(payload); BitmexWebSocketSubscriptionMessage subscribeMessage = - new BitmexWebSocketSubscriptionMessage("authKeyExpires", signature); + new BitmexWebSocketSubscriptionMessage("authKeyExpires", + new Object[]{exchangeSpecification.getApiKey(), nonce, digestString}); + + //sendMessage( ); + + return objectMapper.writeValueAsString(subscribeMessage); - sendMessage( objectMapper.writeValueAsString(subscribeMessage)); + //streamingService.sendAuthKeyExpires(new Object[]{apiKey, nonce, digestString}); + //Thread.sleep(1500); } } From 07a8f3099a46c159677cce653bad5545ccc37ed3 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sat, 12 Jan 2019 07:30:03 -0500 Subject: [PATCH 10/24] send authenticationMessage for BitMex --- .../bitmex/BitmexStreamingService.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index 2df0462d1..0d8baf2c1 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -31,8 +31,27 @@ public BitmexStreamingService(String apiUrl, ExchangeSpecification exchangeSpeci this.exchangeSpecification = exchangeSpecification; } +// @Override +// protected void onConnected() { +// try { +// sendMessage(getAuthenticateMessage()); +// } catch (IOException e) { +// handleError(null, e); +// } +// } + @Override protected void handleMessage(JsonNode message) { + if (message.has("info") && message.get("info").asText().startsWith("Welcome ")) { + if (exchangeSpecification.getApiKey() != null && exchangeSpecification.getSecretKey() != null) { + try { + sendMessage(getAuthenticateMessage()); + } catch (IOException e) { + handleError(message, e); + } + } + return; + } if (message.has("info") || message.has("success")) { return; } From 37eb5c37837e6a76e8a5fcb40829627e0fe50869 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sat, 12 Jan 2019 07:35:53 -0500 Subject: [PATCH 11/24] send authenticationMessage for BitMex --- .../bitmex/BitmexStreamingService.java | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index 0d8baf2c1..e7e80fe87 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -31,27 +31,19 @@ public BitmexStreamingService(String apiUrl, ExchangeSpecification exchangeSpeci this.exchangeSpecification = exchangeSpecification; } -// @Override -// protected void onConnected() { -// try { -// sendMessage(getAuthenticateMessage()); -// } catch (IOException e) { -// handleError(null, e); -// } -// } - @Override protected void handleMessage(JsonNode message) { - if (message.has("info") && message.get("info").asText().startsWith("Welcome ")) { - if (exchangeSpecification.getApiKey() != null && exchangeSpecification.getSecretKey() != null) { - try { - sendMessage(getAuthenticateMessage()); - } catch (IOException e) { - handleError(message, e); - } - } - return; - } +// if (message.has("info") && message.get("info").asText().startsWith("Welcome ")) { +// if (exchangeSpecification.getApiKey() != null && exchangeSpecification.getSecretKey() != null) { +// try { + //TODO: send this onConnect +// sendMessage(getAuthenticateMessage()); +// } catch (Exception e) { +// handleError(message, e); +// } +// } +// return; +// } if (message.has("info") || message.has("success")) { return; } From 730f243935261095f44bcf2ba9465d7d0a4a2606 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sat, 12 Jan 2019 07:53:55 -0500 Subject: [PATCH 12/24] resubscribeChannels with authentication --- .../service/netty/NettyStreamingService.java | 13 +++++++++++++ .../bitmex/BitmexStreamingService.java | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java b/service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java index 8462552a6..d95e10858 100644 --- a/service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java +++ b/service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java @@ -310,7 +310,20 @@ public Observable subscribeChannel(String channelName, Object... args) { }).share(); } + public String getAuthenticateMessage() throws IOException { + return null; + } + public void resubscribeChannels() { + try { + final String authenticateMessage = getAuthenticateMessage(); + if (authenticateMessage != null) + sendMessage(authenticateMessage); + + } catch (IOException e) { + LOG.error("Failed to sendMessage getAuthenticateMessage"); + } + for (String channelId : channels.keySet()) { try { Subscription subscription = channels.get(channelId); diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index e7e80fe87..37b95b03e 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -94,7 +94,7 @@ public String getUnsubscribeMessage(String channelName) throws IOException { return objectMapper.writeValueAsString(subscribeMessage); } -// @Override + @Override // called by NettyStreamingService.resubscribeChannels public String getAuthenticateMessage() throws IOException { // connect().blockingAwait(); From a047c64156f95021cef906a8a5d6c28eb7c97dc4 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sat, 12 Jan 2019 15:01:19 -0500 Subject: [PATCH 13/24] CoinbasePro, use_Sandbox --- .../coinbasepro/CoinbaseProStreamingExchange.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xchange-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java b/xchange-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java index 5eecd4c3b..b213a5666 100644 --- a/xchange-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java +++ b/xchange-coinbasepro/src/main/java/info/bitrich/xchangestream/coinbasepro/CoinbaseProStreamingExchange.java @@ -16,6 +16,7 @@ */ public class CoinbaseProStreamingExchange extends CoinbaseProExchange implements StreamingExchange { private static final String API_URI = "wss://ws-feed.pro.coinbase.com"; + private static final String API_SANDBOX_URI = "wss://ws-feed-public.sandbox.pro.coinbase.com"; private CoinbaseProStreamingService streamingService; private CoinbaseProStreamingMarketDataService streamingMarketDataService; @@ -32,7 +33,8 @@ public Completable connect(ProductSubscription... args) { if (args == null || args.length == 0) throw new UnsupportedOperationException("The ProductSubscription must be defined!"); ExchangeSpecification exchangeSpec = getExchangeSpecification(); - this.streamingService = new CoinbaseProStreamingService(API_URI, () -> authData(exchangeSpec)); + String uri = exchangeSpec.getExchangeSpecificParametersItem(USE_SANDBOX).equals(true) ? API_SANDBOX_URI : API_URI; + this.streamingService = new CoinbaseProStreamingService(uri, () -> authData(exchangeSpec)); this.streamingMarketDataService = new CoinbaseProStreamingMarketDataService(streamingService); streamingService.subscribeMultipleCurrencyPairs(args); From 93bf0b42a0992ed3762b76364b4b0544bb599856 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sun, 13 Jan 2019 18:19:30 -0500 Subject: [PATCH 14/24] BitmexDigest.createInstance null check --- .../bitrich/xchangestream/bitmex/BitmexStreamingService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index 37b95b03e..a2a30d825 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -99,6 +99,9 @@ public String getAuthenticateMessage() throws IOException { // connect().blockingAwait(); BitmexDigest bitmexDigest = BitmexDigest.createInstance(exchangeSpecification.getSecretKey(), exchangeSpecification.getApiKey() ); + if (bitmexDigest == null) + return null; + SynchronizedValueFactory nonceFactory = new ExpirationTimeFactory(30); long nonce = nonceFactory.createValue(); From ef2632dd79e01f85e82ec00438e50747a23ac609 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Wed, 30 Jan 2019 20:03:53 -0500 Subject: [PATCH 15/24] unique snapshot name 4.3.14-MDVX --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 099b81fbd..07a48663e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ info.bitrich.xchange-stream xchange-stream-parent pom - 4.3.14-SNAPSHOT + 4.3.14-MDVX xchange-stream-core From dd565794aa839ccb75346739625dd7649d6fd7c3 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Wed, 30 Jan 2019 20:03:53 -0500 Subject: [PATCH 16/24] unique snapshot name 4.3.14-MDVX --- pom.xml | 2 +- service-core/pom.xml | 2 +- service-netty/pom.xml | 2 +- service-pubnub/pom.xml | 2 +- service-pusher/pom.xml | 2 +- service-wamp/pom.xml | 2 +- xchange-binance/pom.xml | 2 +- xchange-bitfinex/pom.xml | 2 +- xchange-bitflyer/pom.xml | 2 +- xchange-bitmex/pom.xml | 2 +- xchange-bitstamp/pom.xml | 2 +- xchange-cexio/pom.xml | 2 +- xchange-coinbasepro/pom.xml | 2 +- xchange-coinmate/pom.xml | 2 +- xchange-gemini/pom.xml | 2 +- xchange-hitbtc/pom.xml | 2 +- xchange-okcoin/pom.xml | 2 +- xchange-poloniex/pom.xml | 2 +- xchange-poloniex2/pom.xml | 2 +- xchange-stream-core/pom.xml | 2 +- xchange-wex/pom.xml | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pom.xml b/pom.xml index 099b81fbd..07a48663e 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ info.bitrich.xchange-stream xchange-stream-parent pom - 4.3.14-SNAPSHOT + 4.3.14-MDVX xchange-stream-core diff --git a/service-core/pom.xml b/service-core/pom.xml index 3dff41553..a94957aee 100644 --- a/service-core/pom.xml +++ b/service-core/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/service-netty/pom.xml b/service-netty/pom.xml index 4d05aed1a..9fd8b3451 100644 --- a/service-netty/pom.xml +++ b/service-netty/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/service-pubnub/pom.xml b/service-pubnub/pom.xml index cf738a4f8..1259d5797 100644 --- a/service-pubnub/pom.xml +++ b/service-pubnub/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/service-pusher/pom.xml b/service-pusher/pom.xml index 83c15b222..82f25f544 100644 --- a/service-pusher/pom.xml +++ b/service-pusher/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/service-wamp/pom.xml b/service-wamp/pom.xml index 3c77c09ea..e69aebb43 100644 --- a/service-wamp/pom.xml +++ b/service-wamp/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-binance/pom.xml b/xchange-binance/pom.xml index 9b51c8964..93fcc1657 100644 --- a/xchange-binance/pom.xml +++ b/xchange-binance/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-bitfinex/pom.xml b/xchange-bitfinex/pom.xml index ec5fae644..dbd65b6ff 100644 --- a/xchange-bitfinex/pom.xml +++ b/xchange-bitfinex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-bitflyer/pom.xml b/xchange-bitflyer/pom.xml index d05fac5ea..d705d7828 100644 --- a/xchange-bitflyer/pom.xml +++ b/xchange-bitflyer/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-bitmex/pom.xml b/xchange-bitmex/pom.xml index 678c09822..c0a390116 100644 --- a/xchange-bitmex/pom.xml +++ b/xchange-bitmex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-bitstamp/pom.xml b/xchange-bitstamp/pom.xml index ac5efdde5..d43679f02 100644 --- a/xchange-bitstamp/pom.xml +++ b/xchange-bitstamp/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-cexio/pom.xml b/xchange-cexio/pom.xml index 39b55e341..fe3a6796f 100644 --- a/xchange-cexio/pom.xml +++ b/xchange-cexio/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-coinbasepro/pom.xml b/xchange-coinbasepro/pom.xml index acd2c967e..e0dd746be 100644 --- a/xchange-coinbasepro/pom.xml +++ b/xchange-coinbasepro/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-coinmate/pom.xml b/xchange-coinmate/pom.xml index d888d5377..5f9439845 100644 --- a/xchange-coinmate/pom.xml +++ b/xchange-coinmate/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-gemini/pom.xml b/xchange-gemini/pom.xml index bc5868c32..401018585 100644 --- a/xchange-gemini/pom.xml +++ b/xchange-gemini/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-hitbtc/pom.xml b/xchange-hitbtc/pom.xml index 6c8900de2..8331c63b7 100644 --- a/xchange-hitbtc/pom.xml +++ b/xchange-hitbtc/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-okcoin/pom.xml b/xchange-okcoin/pom.xml index b5ac30907..d5dd1933e 100644 --- a/xchange-okcoin/pom.xml +++ b/xchange-okcoin/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-poloniex/pom.xml b/xchange-poloniex/pom.xml index 668dd250d..83fe3934b 100644 --- a/xchange-poloniex/pom.xml +++ b/xchange-poloniex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-poloniex2/pom.xml b/xchange-poloniex2/pom.xml index d9beacda9..243032820 100644 --- a/xchange-poloniex2/pom.xml +++ b/xchange-poloniex2/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-stream-core/pom.xml b/xchange-stream-core/pom.xml index b74ab3d32..07d95eea4 100644 --- a/xchange-stream-core/pom.xml +++ b/xchange-stream-core/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 diff --git a/xchange-wex/pom.xml b/xchange-wex/pom.xml index a5b3b12c6..149e8fd31 100644 --- a/xchange-wex/pom.xml +++ b/xchange-wex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-SNAPSHOT + 4.3.14-MDVX 4.0.0 From 3714584a1032dd0b8cd04ee14ed7c3c80d4edef8 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sat, 9 Mar 2019 19:10:30 -0500 Subject: [PATCH 17/24] fixed my branch --- xchange-bitfinex/pom.xml | 9 ++++++++- .../xchangestream/bitfinex/BitfinexStreamingService.java | 2 +- .../bitrich/xchangestream/core/StreamingExchange.java | 2 -- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/xchange-bitfinex/pom.xml b/xchange-bitfinex/pom.xml index dbd65b6ff..49ca31b69 100644 --- a/xchange-bitfinex/pom.xml +++ b/xchange-bitfinex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-SNAPSHOT 4.0.0 @@ -25,5 +25,12 @@ xchange-bitfinex ${xchange.version} + + + javax.xml.bind + jaxb-api + 2.3.1 + + \ No newline at end of file diff --git a/xchange-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java b/xchange-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java index 1a36feb7f..e3070e034 100644 --- a/xchange-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java +++ b/xchange-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java @@ -143,7 +143,7 @@ protected void handleMessage(JsonNode message) { } case ERROR: if (message.get("code").asInt() == SUBSCRIPTION_FAILED) { - LOG.error("Error with message: " + message.get("symbol") + " " + message.get("msg")); + LOG.error("Error with message: " + message.get("symbol") + " " + message.get("msg")); return; } super.handleError(message, new ExchangeException("Error code: " + message.get(ERROR_CODE).asText())); diff --git a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingExchange.java b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingExchange.java index 3e3909fd1..0b355dd30 100644 --- a/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingExchange.java +++ b/xchange-stream-core/src/main/java/info/bitrich/xchangestream/core/StreamingExchange.java @@ -1,6 +1,5 @@ package info.bitrich.xchangestream.core; -import info.bitrich.xchangestream.service.ConnectableService; import info.bitrich.xchangestream.service.netty.NettyStreamingService; import io.reactivex.Completable; import io.reactivex.Observable; @@ -72,7 +71,6 @@ default Observable connectionSuccess() { default void applyStreamingSpecification(ExchangeSpecification exchangeSpec, NettyStreamingService streamingService){ streamingService.setSocksProxyHost((String) exchangeSpec.getExchangeSpecificParametersItem(SOCKS_PROXY_HOST)); streamingService.setSocksProxyPort((Integer) exchangeSpec.getExchangeSpecificParametersItem(SOCKS_PROXY_PORT)); - streamingService.setBeforeConnectionHandler((Runnable) exchangeSpec.getExchangeSpecificParametersItem(ConnectableService.BEFORE_CONNECTION_HANDLER)); Boolean accept_all_ceriticates = (Boolean) exchangeSpec.getExchangeSpecificParametersItem(ACCEPT_ALL_CERITICATES); if (accept_all_ceriticates != null && accept_all_ceriticates) { From a11dfe5525f44dc9c61e9e834f347851056aff41 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Fri, 22 Mar 2019 13:55:28 -0400 Subject: [PATCH 18/24] 4.3.16-MDVX --- pom.xml | 4 ++-- service-core/pom.xml | 2 +- service-netty/pom.xml | 2 +- service-pubnub/pom.xml | 2 +- service-pusher/pom.xml | 2 +- service-wamp/pom.xml | 2 +- xchange-binance/pom.xml | 2 +- .../bitfinex/BitfinexStreamingService.java | 10 +++++----- xchange-bitflyer/pom.xml | 2 +- xchange-bitmex/pom.xml | 2 +- xchange-bitstamp/pom.xml | 2 +- xchange-cexio/pom.xml | 2 +- xchange-coinbasepro/pom.xml | 2 +- xchange-coinmate/pom.xml | 2 +- xchange-gemini/pom.xml | 2 +- xchange-hitbtc/pom.xml | 2 +- xchange-okcoin/pom.xml | 2 +- xchange-poloniex/pom.xml | 2 +- xchange-poloniex2/pom.xml | 2 +- xchange-stream-core/pom.xml | 2 +- xchange-wex/pom.xml | 2 +- 21 files changed, 26 insertions(+), 26 deletions(-) diff --git a/pom.xml b/pom.xml index 40cbdd1ec..607938aa0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ info.bitrich.xchange-stream xchange-stream-parent pom - 4.3.14-SNAPSHOT + 4.3.16-MDVX xchange-stream-core @@ -80,7 +80,7 @@ - 4.3.14 + 4.3.16 UTF-8 UTF-8 1.8 diff --git a/service-core/pom.xml b/service-core/pom.xml index a94957aee..24bda08ae 100644 --- a/service-core/pom.xml +++ b/service-core/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/service-netty/pom.xml b/service-netty/pom.xml index 9fd8b3451..7521931d9 100644 --- a/service-netty/pom.xml +++ b/service-netty/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/service-pubnub/pom.xml b/service-pubnub/pom.xml index 1259d5797..cd0ba8915 100644 --- a/service-pubnub/pom.xml +++ b/service-pubnub/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/service-pusher/pom.xml b/service-pusher/pom.xml index 82f25f544..425bc12b7 100644 --- a/service-pusher/pom.xml +++ b/service-pusher/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/service-wamp/pom.xml b/service-wamp/pom.xml index e69aebb43..ac3cba63c 100644 --- a/service-wamp/pom.xml +++ b/service-wamp/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-binance/pom.xml b/xchange-binance/pom.xml index 93fcc1657..ea36ed245 100644 --- a/xchange-binance/pom.xml +++ b/xchange-binance/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java b/xchange-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java index e3070e034..b74574f16 100644 --- a/xchange-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java +++ b/xchange-bitfinex/src/main/java/info/bitrich/xchangestream/bitfinex/BitfinexStreamingService.java @@ -5,7 +5,7 @@ import info.bitrich.xchangestream.bitfinex.dto.*; import info.bitrich.xchangestream.service.netty.JsonNettyStreamingService; import info.bitrich.xchangestream.service.netty.StreamingObjectMapperHelper; -import io.netty.handler.codec.http.websocketx.extensions.WebSocketClientExtensionHandler; + import io.reactivex.Observable; import io.reactivex.subjects.PublishSubject; import org.apache.commons.lang3.StringUtils; @@ -73,10 +73,10 @@ public BitfinexStreamingService(String apiUrl, this.nonceFactory = nonceFactory; } - @Override - protected WebSocketClientExtensionHandler getWebSocketClientExtensionHandler() { - return null; - } +// @Override +// protected WebSocketClientExtensionHandler getWebSocketClientExtensionHandler() { +// return null; +// } @Override public void messageHandler(String message) { diff --git a/xchange-bitflyer/pom.xml b/xchange-bitflyer/pom.xml index d705d7828..53498628b 100644 --- a/xchange-bitflyer/pom.xml +++ b/xchange-bitflyer/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-bitmex/pom.xml b/xchange-bitmex/pom.xml index c0a390116..f23f9e752 100644 --- a/xchange-bitmex/pom.xml +++ b/xchange-bitmex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-bitstamp/pom.xml b/xchange-bitstamp/pom.xml index d43679f02..4e551e6f9 100644 --- a/xchange-bitstamp/pom.xml +++ b/xchange-bitstamp/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-cexio/pom.xml b/xchange-cexio/pom.xml index fe3a6796f..d857a444c 100644 --- a/xchange-cexio/pom.xml +++ b/xchange-cexio/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-coinbasepro/pom.xml b/xchange-coinbasepro/pom.xml index dd866920e..fc71ed8a2 100644 --- a/xchange-coinbasepro/pom.xml +++ b/xchange-coinbasepro/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-coinmate/pom.xml b/xchange-coinmate/pom.xml index 5f9439845..cdd654f79 100644 --- a/xchange-coinmate/pom.xml +++ b/xchange-coinmate/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-gemini/pom.xml b/xchange-gemini/pom.xml index 401018585..8af14625a 100644 --- a/xchange-gemini/pom.xml +++ b/xchange-gemini/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-hitbtc/pom.xml b/xchange-hitbtc/pom.xml index 8331c63b7..119188f88 100644 --- a/xchange-hitbtc/pom.xml +++ b/xchange-hitbtc/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-okcoin/pom.xml b/xchange-okcoin/pom.xml index d5dd1933e..24d87d759 100644 --- a/xchange-okcoin/pom.xml +++ b/xchange-okcoin/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-poloniex/pom.xml b/xchange-poloniex/pom.xml index 83fe3934b..f0b70b77f 100644 --- a/xchange-poloniex/pom.xml +++ b/xchange-poloniex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-poloniex2/pom.xml b/xchange-poloniex2/pom.xml index 243032820..dc8039cd2 100644 --- a/xchange-poloniex2/pom.xml +++ b/xchange-poloniex2/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-stream-core/pom.xml b/xchange-stream-core/pom.xml index 07d95eea4..b900d7708 100644 --- a/xchange-stream-core/pom.xml +++ b/xchange-stream-core/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 diff --git a/xchange-wex/pom.xml b/xchange-wex/pom.xml index 149e8fd31..018a1eaa5 100644 --- a/xchange-wex/pom.xml +++ b/xchange-wex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.14-MDVX + 4.3.16-MDVX 4.0.0 From 856118ce5c19487e71a4586f21de18d2f690aed3 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Mon, 1 Apr 2019 14:34:11 -0400 Subject: [PATCH 19/24] remove comments --- .../xchangestream/bitmex/BitmexStreamingService.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java index a2a30d825..12d4e17d9 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingService.java @@ -96,8 +96,6 @@ public String getUnsubscribeMessage(String channelName) throws IOException { @Override // called by NettyStreamingService.resubscribeChannels public String getAuthenticateMessage() throws IOException { -// connect().blockingAwait(); - BitmexDigest bitmexDigest = BitmexDigest.createInstance(exchangeSpecification.getSecretKey(), exchangeSpecification.getApiKey() ); if (bitmexDigest == null) return null; @@ -112,11 +110,6 @@ public String getAuthenticateMessage() throws IOException { new BitmexWebSocketSubscriptionMessage("authKeyExpires", new Object[]{exchangeSpecification.getApiKey(), nonce, digestString}); - //sendMessage( ); - return objectMapper.writeValueAsString(subscribeMessage); - - //streamingService.sendAuthKeyExpires(new Object[]{apiKey, nonce, digestString}); - //Thread.sleep(1500); } } From 68327444fd8b81b73189710369e4f56ca0f00d86 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Mon, 1 Apr 2019 14:35:03 -0400 Subject: [PATCH 20/24] fix bitfinex snapshot --- xchange-bitfinex/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xchange-bitfinex/pom.xml b/xchange-bitfinex/pom.xml index 49ca31b69..eb615e3c6 100644 --- a/xchange-bitfinex/pom.xml +++ b/xchange-bitfinex/pom.xml @@ -3,7 +3,7 @@ xchange-stream-parent info.bitrich.xchange-stream - 4.3.16-SNAPSHOT + 4.3.16-MDVX 4.0.0 From 5317da3b882f967789f5b8b9cf36bdc5df2fefc3 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Mon, 27 May 2019 21:31:27 -0400 Subject: [PATCH 21/24] BitMex null test --- .../xchangestream/bitmex/dto/BitmexOrderbook.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexOrderbook.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexOrderbook.java index 2722fc19a..9db4aab65 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexOrderbook.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexOrderbook.java @@ -57,13 +57,21 @@ public void updateLevel(BitmexLimitOrder level, String action) { boolean shouldDelete = action.equals("delete"); String id = level.getId(); BigDecimal price = orderBookSideIds.get(id); - orderBookSide.remove(price); + if (orderBookSide != null) + if (price != null) + orderBookSide.remove(price); + orderBookSideIds.remove(id); if (!shouldDelete) { BitmexLimitOrder modifiedLevel = new BitmexLimitOrder(level.getSymbol(), level.getId(), level.getSide(), price, level.getSize()); // Original level doesn't have price! see bitmex doc - orderBookSide.put(price, modifiedLevel); - orderBookSideIds.put(id, price); + + if (orderBookSide != null) + if (price != null) + orderBookSide.put(price, modifiedLevel); + + if (price != null) + orderBookSideIds.put(id, price); } } } From 86b3e3aee9d1c6564d75302954701e2038c42181 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Mon, 27 May 2019 21:32:17 -0400 Subject: [PATCH 22/24] POM updates to deploy maven with: mvn -U clean deploy -DskipTests -DAWS_DEFAULT_REGION=us-east-2 --- pom.xml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 607938aa0..666103aef 100644 --- a/pom.xml +++ b/pom.xml @@ -61,12 +61,12 @@ - ossrh - https://oss.sonatype.org/content/repositories/snapshots + mainbloq-maven-repo + s3://mainbloq-maven-repo/snapshot - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + mainbloq-maven-repo + s3://mainbloq-maven-repo/release @@ -143,6 +143,14 @@ 2.5.3 + + + com.gkatzioura.maven.cloud + s3-storage-wagon + 1.9 + + + @@ -212,4 +220,5 @@ + From 6f52ed053d48ba15f7bdf848e22e7a421edc7e58 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sun, 16 Jun 2019 14:21:36 -0400 Subject: [PATCH 23/24] remove getNonceFactory() --- .../xchangestream/bitmex/BitmexStreamingExchange.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java index 634e6542f..dd03dc8f3 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/BitmexStreamingExchange.java @@ -6,7 +6,6 @@ import io.reactivex.Completable; import org.knowm.xchange.ExchangeSpecification; import org.knowm.xchange.bitmex.BitmexExchange; -import si.mazi.rescu.SynchronizedValueFactory; /** * Created by Lukas Zaoralek on 12.11.17. @@ -46,11 +45,6 @@ public Completable disconnect() { return streamingService.disconnect(); } - @Override - public SynchronizedValueFactory getNonceFactory() { - return null; - } - @Override public ExchangeSpecification getDefaultExchangeSpecification() { ExchangeSpecification spec = super.getDefaultExchangeSpecification(); From f12bd8d6a334201bcd34757a90ab7163845d9d24 Mon Sep 17 00:00:00 2001 From: Marc Deveaux Date: Sun, 16 Jun 2019 19:50:11 -0400 Subject: [PATCH 24/24] defend against missing levels after reconnect --- .../xchangestream/bitmex/dto/BitmexOrderbook.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexOrderbook.java b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexOrderbook.java index 9db4aab65..a9c81c776 100644 --- a/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexOrderbook.java +++ b/xchange-bitmex/src/main/java/info/bitrich/xchangestream/bitmex/dto/BitmexOrderbook.java @@ -35,8 +35,10 @@ public void createFromLevels(BitmexLimitOrder[] levels) { for (BitmexLimitOrder level : levels) { SortedMap orderBookSide = level.getSide().equals(ASK_SIDE) ? asks : bids; Map orderBookSideIds = level.getSide().equals(ASK_SIDE) ? askIds : bidIds; - orderBookSide.put(level.getPrice(), level); - orderBookSideIds.put(level.getId(), level.getPrice()); + if (level != null) { + orderBookSide.put(level.getPrice(), level); + orderBookSideIds.put(level.getId(), level.getPrice()); + } } } @@ -94,8 +96,10 @@ public static List toLimitOrders(BitmexLimitOrder[] levels) { List limitOrders = new ArrayList<>(levels.length); for (BitmexLimitOrder level : levels) { - LimitOrder limitOrder = level.toLimitOrder(); - limitOrders.add(limitOrder); + if (level != null) { + LimitOrder limitOrder = level.toLimitOrder(); + limitOrders.add(limitOrder); + } } return limitOrders;