Closed 810961186 closed 1 year ago
Did you provide your API credentials?
yes,I wrote it like this:
var ws = new OKXWebSocketApiClient();
ws.SetApiCredentials("XXX", "XXX", "XXX");
var response=await ws.OrderBookTrading.Trade.SubscribeToOrderUpdatesAsync((data) =>
{
if (data != null)
{
Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{JsonConvert.SerializeObject(data)}");
// ... Your logic here
}
}, OkxInstrumentType.Any, "", "");
Console.WriteLine($"{DateTime.Now.ToString("HH:mm:ss")}:{JsonConvert.SerializeObject(response)}");
response is {"Data":null,"Raw":null,"Error":{"Code":null,"Message":"Authentication failed: No credentials provided for private endpoint","Data":null},"Success":false}
same result. How to fix it?
The problem is completely different. I tried many times, there is no problem with login. But problem is related with your request. Even API docs says some parameters is optional, websocket returns message below
{ "event":"error", "msg":"channel:orders,instType:ANY,instFamily:,instId: doesn't exist", "code":"60018" }
I've fixed this situation, it shows correct error response now. I'll release new version today. I wont close this issue and wait for your response.
Thanks for feedback.
use private channel subscribe back {"Data":null,"Raw":null,"Error":{"Code":null,"Message":"Authentication failed: No credentials provided for private endpoint","Data":null},"Success":false}