JKorf / OKX.Net

A C# .netstandard client library for the OKX REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/OKX.Net/
MIT License
28 stars 15 forks source link

data.Data.Symbol returning empty in SubscribeToKlineUpdatesAsync #31

Closed danielhw2 closed 5 months ago

danielhw2 commented 6 months ago

When subscribing to kLineUpdates with SubscribeToKlineUpdatesAsync(symbol_name, OKX.Net.Enums.OKXPeriod.OneMinute... the event receives data with the variable "data.Data.Symbol" empty.

response received:

{
  "Timestamp": "2024-03-04T02:35:18.4118381Z",
  "Topic": "BTC-USD-240308",
  "OriginalData": "{\"arg\":{\"channel\":\"candle1m\",\"instId\":\"BTC-USD-240308\"},\"data\":[[\"1709519700000\",\"64148.8\",\"64148.8\",\"64127\",\"64127\",\"64\",\"0.0998\",\"6400\",\"0\"]]}",
  "UpdateType": 0,
  "Data": [
    1709519700000,
    64148.8,
    64148.8,
    64127.0,
    64127.0,
    64.0,
    0.0998,
    6400.0,
    "0"
  ]
}

As a workaround I used "data.Topic" to get the symbol name.

CryptoExchange.Net 7.0.0 JK.OKX.Net 1.6.1 .NET 8

JKorf commented 5 months ago

data.Topic can be used for this, but I've also restored the Symbol property being set on the model it self in the latest version