This repository has been archived by the owner on Jun 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 217
Interface support for trade service (Implemented for bitmex and okcoin/okex) #180
Closed
Conversation
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
declan94
changed the title
add interface support for trade service
Interface support for trade service (Implemented for bitmex)
May 21, 2018
declan94
changed the title
Interface support for trade service (Implemented for bitmex)
Interface support for trade service (Implemented for bitmex and okcoin/okex)
May 21, 2018
Anything I can help with this PR? Code review or resolving the conflict? |
I am waiting for this PR to merge in order to update the StreamingTradeService with getUserTrades implementation. |
mdvx
reviewed
Nov 15, 2019
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.
How did you avoid this? WebSocketClientHandler.channelRead0
The GZIP code is for another Exchange, Kraken I think, but Upbit was sending as Binary frames too
} else if (frame instanceof BinaryWebSocketFrame) {
BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame;
ByteBuf bf = binaryFrame.content();
byte[] bytes = new byte[bf.capacity()];
bf.readBytes(bytes);
if (bytes[0] == (GZIPInputStream.GZIP_MAGIC & 0x00ff) && bytes[1] == (GZIPInputStream.GZIP_MAGIC & 0xff00) >> 8) { // upbit GZIPInputStream.
GZIPInputStream gzipInputStream = new GZIPInputStream(new ByteArrayInputStream(bytes));
ByteArrayOutputStream result = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
while ((length = gzipInputStream.read(buffer)) != -1) {
result.write(buffer, 0, length);
}
handler.onMessage(result.toString());
} else {
handler.onMessage(new String(bytes)); // upbit
}
}
OK guys, I'm going to close this but add a reference to the README to say this PR can be used as a start point if anyone wants to add Bitmex/OKEX private channels in the future. |
badgerwithagun
added a commit
that referenced
this pull request
Dec 11, 2019
dozd
pushed a commit
that referenced
this pull request
Jan 1, 2020
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add interface support for streaming trade service to get trading order information through WebSocket API.
Implemented the interface for bitmex and okcoin(okex).