bitrich-info / xchange-stream

XChange-stream is a Java library providing a simple and consistent streaming API for interacting with Bitcoin and other crypto currency exchanges via WebSocket protocol. It is build on top of of XChange library providing new interfaces for streaming API. User can subscribe for live updates via reactive streams of RxJava library.
Apache License 2.0
413 stars 222 forks source link

[SignalR] and [Bittrex] Request #177

Open thebubbleindex opened 6 years ago

thebubbleindex commented 6 years ago

I think if we can add SignalR client for Java we can then go about adding bittrex. https://bittrex.github.io/#ws-api-overview

Would it be theoretically possible?

nilswx commented 6 years ago

Interesting to see that Bittrex now has an updated web socket API. I wish they would either ditch SignalR completely or pay someone to publish a modern, asynchronous client for the JVM.

I ended up hand-rolling an Akka HTTP SignalR client for my Scala projects and was eventually able to subscribe/unsubscribe/follow everything, apart from the authenticated stuff. It seems that authentication is now possible as well (without copy-pasting cookies). Unfortunately my SignalR connection stopped working when they enabled Cloudflare on the /signalr endpoints, not sure if they fixed that as well by now. Anyway, I couldn't be bothered to use a Rhino or Nashorn JS interpreter and parse & fiddle with the challenge, so I packed my bags and left Bittrex for better exchanges. 💔

But yes, theoretically this should be possible. 🙂

thebubbleindex commented 6 years ago

Cool, I am having initial success but I will most likely need help. Attaching my maven child module. It currently subscribes to the SubscribeToSummaryDeltas on Bittrex Websocket API: https://bittrex.github.io/

Maven Project: service-signalr.zip

It is limited but I think it is a good starting point.

CCob commented 6 years ago

Great project you guys have going here.

I fixed the official MS version of the signalr library so that it would work with bittrex and created a project here. https://github.com/signalr4j/signalr4j

I also created bittrex4j which uses the library and have recently added support for the new bittrex c2 hub that supports authentication.

You guys are welcome to take some of that logic