Closed sonpxc005472 closed 11 months ago
Could you share your code?
Just like the sample:
var sample_pairs = new List<string> { "BCH-USDT-SWAP", "ETH-USDT-SWAP" }; var ws = new OKXWebSocketApiClient(); foreach (var pair in sample_pairs) { await ws.OrderBookTrading.MarketData.SubscribeToCandlesticksAsync((data) => { if (data != null) { // ... Your logic here } }, pair, OkxPeriod.FiveMinutes); }
After investigating, I see OKX already changed the websocket address follow this link. Now, the address is: wss://ws.okx.com:8443/ws/v5/business. Please take a look and update the lib
Btw, the endpoint: api.PublicData.UnitConvertAsync(symbol, quantity, price, OkxConvertType.ContractToCurrency, OkxConvertUnit.Coin). The price and unit is optional for converting contract to currency and vice versa but if a do not pass one of these params the endpoint will be failed
OKX divided websocket endpoints into public, private and business. In your case you get response below
{ "event": "error", "msg": "This channel has been migrated to the '/business' URL. Please subscribe using the new URL. More details can refer to: https://www.okx.com/help-center/changes-to-v5-api-websocket-subscription-parameter-and-url", "code": "64001" }
So, this problem is nbot related only one websocket endpoint. It's related with all websocket methods. I've fixed this issue.
Thanks for your feedback
Version 1.4.0 has been released. Please check these out https://github.com/burakoner/OKX.Api/commit/a2332273d6d885f3b58a532bc5d63793da3634d8 https://www.nuget.org/packages/OKX.Api/
I don't see any data pushed after I subscribe a candlestick