Unable to authenticate using Socketcluster V2 to exchange keys Coinigy Exchange api api

I am trying to use ticker data for a Coinigy api web application to get real-time transaction flow and crypto asset prices.

I tried the following demo without success, and I get the answer:
"The socket is not authenticated"

internal class MyListener:BasicListener
{
    public void onConnected(Socket socket)
    {
        Console.WriteLine("connected got called");
    }

    public void onDisconnected(Socket socket)
    {
        Console.WriteLine("disconnected got called");
    }

    public void onConnectError(Socket socket, ErrorEventArgs e)
    {
        Console.WriteLine("on connect error got called");
    }

    public void onAuthentication(Socket socket, bool status)
    {
        Console.WriteLine(status ? "Socket is authenticated" : "Socket is not authenticated");
    }

    public void onSetAuthToken(string token, Socket socket)
    {
        token = "{'apiKey' : 'KEYXXXXXX', 'apiSecret' : 'SECRETXXXX'}"; //<---MY key and secret
        socket.setAuthToken(token);
        Console.WriteLine("on set auth token got called");
    }

}

internal class Program
{
    public static void Main(string[] args)
    {
        var socket=new Socket("wss://sc-02.coinigy.com/socketcluster/");
        socket.setListerner(new MyListener());

        socket.setReconnectStrategy(new ReconnectStrategy().setMaxAttempts(30));
        socket.connect();


//Other code calling the websocket....
//Other code calling the websocket....
//Other code calling the websocket....
        Console.ReadKey();


    }
}
+4
source share
1 answer

I had the same problem. There are a few things you need to know:

1) API TICKER is deprecated: Coinigy Blog

2) # Pure Socket Cluster

3) ,

4) , -.

5) . , . , .

+1

Source: https://habr.com/ru/post/1684942/


All Articles