Skip to content
This repository has been 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
wants to merge 12 commits into from

Conversation

declan94
Copy link
Collaborator

@declan94 declan94 commented May 13, 2018

Add interface support for streaming trade service to get trading order information through WebSocket API.
Implemented the interface for bitmex and okcoin(okex).

@declan94 declan94 changed the title add interface support for trade service Interface support for trade service (Implemented for bitmex) May 21, 2018
@declan94 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
@henryxwong
Copy link
Contributor

Anything I can help with this PR? Code review or resolving the conflict?

@makarid
Copy link
Contributor

makarid commented Jun 22, 2019

I am waiting for this PR to merge in order to update the StreamingTradeService with getUserTrades implementation.

Copy link
Contributor

@mdvx mdvx left a 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
        }
    }

@badgerwithagun
Copy link
Collaborator

@declan94 , @makarid , @mdvx: I'm trying to get as many PRs as I can either merged or closed, so we can start working towards merging this library with XChange. What is the status of this? Is anyone still waiting for it? Are we close to being able to merge?

@badgerwithagun
Copy link
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
as reference for OKEX/Bitmex private channels
dozd pushed a commit that referenced this pull request Jan 1, 2020
as reference for OKEX/Bitmex private channels
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants