-
Notifications
You must be signed in to change notification settings - Fork 217
Conversation
"execution", "order", "margin", "position", "wallet"
support naked channel Names
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, all done from me. One question: what effect does this have on the content of the streams? Does it affect the normal market data channels (e.g. adding more information to trades), or does it make more channels available, which you catch using exchange-specific code?
The reason that I ask is because we have other PRs open (e.g. #246, #244) which overlap this heavily and at the moment only provide authenticated data through exchange-specific APIs. It may be the right time to start extending the core API to include authenticated information (such as execution reports).
pom.xml
Outdated
@@ -5,7 +5,7 @@ | |||
<groupId>info.bitrich.xchange-stream</groupId> | |||
<artifactId>xchange-stream-parent</artifactId> | |||
<packaging>pom</packaging> | |||
<version>4.3.13-SNAPSHOT</version> | |||
<version>4.3.14-SNAPSHOT</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it affect the normal market data channels (e.g. adding more information to trades), or does it make more channels available
It make more channels available, beyond orderbook and klines, I can now subscribe to position, wallet, order and execution channels
My goal is to provide all data required for trading as streams, for every exchange that can do it.
Another avenue I have been looking at is Manifold, but I would rather we have a proper supported api (I have several streaming exchanges in the works)
Please feel free to take what you want can from this PR (I am not a git guru)
pom.xml
Outdated
@@ -80,7 +80,7 @@ | |||
</repositories> | |||
|
|||
<properties> | |||
<xchange.version>4.3.13</xchange.version> | |||
<xchange.version>4.3.14-SNAPSHOT</xchange.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change this to 4.3.14? It's been released now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will do
@@ -65,4 +70,8 @@ public boolean isAlive() { | |||
|
|||
@Override | |||
public void useCompressedMessages(boolean compressedMessages) { streamingService.useCompressedMessages(compressedMessages); } | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than exposing the streaming service directly, perhaps it might be cleaner to add some specialised methods to BitfinexStreamingExchange
to expose what you need as proper streams? I have an example in my (still unmerged PR for Binance: #246
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I agree, I wanted to open this up for discussuion
protected void handleMessage(JsonNode message) { | ||
// if (message.has("info") && message.get("info").asText().startsWith("Welcome ")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this commented-out code be removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes
|
||
@Override // called by NettyStreamingService.resubscribeChannels | ||
public String getAuthenticateMessage() throws IOException { | ||
// connect().blockingAwait(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code
new BitmexWebSocketSubscriptionMessage("authKeyExpires", | ||
new Object[]{exchangeSpecification.getApiKey(), nonce, digestString}); | ||
|
||
//sendMessage( ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code
|
||
return objectMapper.writeValueAsString(subscribeMessage); | ||
|
||
//streamingService.sendAuthKeyExpires(new Object[]{apiKey, nonce, digestString}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commented out code
|
||
BitmexWebSocketSubscriptionMessage subscribeMessage = | ||
new BitmexWebSocketSubscriptionMessage("authKeyExpires", | ||
new Object[]{exchangeSpecification.getApiKey(), nonce, digestString}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't you just use new String[]
here rather than new Object[]
, and avoid the change to BitmexWebSocketSubscriptionMessage
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i first iteration passed a digest object, but a string is suffecient now
Note: merge #268 first |
#268 merged. @mdvx any comments on @badgerwithagun comments? |
I am a little stuck here, I am not sure how to pull the PR down onto a clean checkout of develop branch, so I can make the requested changes. Are there some general instructions somewhere? I am using git (normal, tortoise, InteliJ) on windows. |
@mdvx : I'm not an IntelliJ user myself, but the sequence of actions you need is:
You can then |
into develop # Conflicts: # pom.xml # service-core/pom.xml # service-netty/pom.xml # service-netty/src/main/java/info/bitrich/xchangestream/service/netty/NettyStreamingService.java # service-pubnub/pom.xml # service-pusher/pom.xml # service-wamp/pom.xml # xchange-binance/pom.xml # xchange-bitfinex/pom.xml # xchange-bitflyer/pom.xml # xchange-bitmex/pom.xml # xchange-bitstamp/pom.xml # xchange-cexio/pom.xml # xchange-coinbasepro/pom.xml # xchange-coinmate/pom.xml # xchange-gemini/pom.xml # xchange-hitbtc/pom.xml # xchange-okcoin/pom.xml # xchange-poloniex/pom.xml # xchange-poloniex2/pom.xml # xchange-stream-core/pom.xml # xchange-wex/pom.xml
will return to BitMEX, using trunc version |
Bitmex use ExchangeSpecification to select Sandbox, ApiKey and ApiSecret
expose getStreamingService() for Bitmex and CoinbasePro
Create to resubscribe channels - this is also called manually after the socket connects (would be nice to do that automatically)
@OverRide // called by NettyStreamingService.resubscribeChannels
public String BitmexStreamingService.getAuthenticateMessage() throws IOException;
this gives access to the authenticated channels