This repository was archived by the owner on Jun 8, 2020. It is now read-only.
Interface support for trade service (Implemented for bitmex and okcoin/okex)#180
Closed
declan94 wants to merge 12 commits intobitrich-info:developfrom
Closed
Interface support for trade service (Implemented for bitmex and okcoin/okex)#180declan94 wants to merge 12 commits intobitrich-info:developfrom
declan94 wants to merge 12 commits intobitrich-info:developfrom
Conversation
Contributor
|
Anything I can help with this PR? Code review or resolving the conflict? |
Contributor
|
I am waiting for this PR to merge in order to update the StreamingTradeService with getUserTrades implementation. |
mdvx
reviewed
Nov 15, 2019
Contributor
mdvx
left a comment
There was a problem hiding this comment.
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
}
}
Collaborator
Collaborator
|
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
This file contains hidden or 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
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).