Lut*_*her 6 c# cryptography websocket bitcoin socketcluster
我正在尝试使用Coinigy websocket api的股票代码数据来获取实时交易流和加密资产的价格.
我尝试了以下演示但没有成功,我得到了一个响应:
"套接字未经过身份验证"
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();
}
}
Run Code Online (Sandbox Code Playgroud)
我有同样的问题。您需要了解以下几点:
1) TICKER API 已弃用:Coinigy 博客
2) 我只获得了与另一个名为Pure Socket Cluster的 C# 库的经过身份验证的连接
3) 您现在需要访问您的私人频道才能获取实时数据
4) 它将获取您的收藏夹,通过网页上的设置进行配置
5) 您只能得到少数最喜欢的内容。不是您选择的所有内容。我还没有找到任何其他信息来消除限制或扩大限制,或者为什么会有这样的限制。
| 归档时间: |
|
| 查看次数: |
606 次 |
| 最近记录: |