joancaron/cryptocompare-api

Streamer

iza88 opened this issue · 8 comments

iza88 commented

Hello
I can see you did the 'Streamer subscription channels'. Is it for realtime trades?
I couldn't find the function in CryptoCompareClient class or its members.

Please add WebSocket support.

Anyone working on this?
I tried using standard Web Socket Core 2 libs from MS but seems to a problem during the protocol handshake. Turns out that SocketIO has a few bells and whistles on to of the standard WS protocol :(

@Robzilla thank you for your feedback ! I'll try to find a solution tonight or this weekend

@joancaron how did you go with this? Did you find a suitable SocketIO .net library?

@Robzilla It can be easily done using SocketIoClientDotNet library

var socket = IO.Socket("wss://streamer.cryptocompare.com");
socket.On(Socket.EVENT_CONNECT, () =>
{
    var obj = JObject.FromObject(new { subs = new[] { "5~CCCAGG~BTC~USD" } });
    socket.Emit("SubAdd", obj);
});

socket.On("m", (data) =>
{
    Console.WriteLine(data);           
});

Good find, thanks, might build an Azure Web Job or a Google app engine project to test.

@joancaron SocketIoClientDotNet is deprecated and doesn't support netstandard. Do you have a solution for cryptocompare websockets for netstandard?

I'm developing new Crypto Compare socket client, you can find it here if you are interested:
https://github.com/LadislavBohm/cryptocompare-streamer