JKorf / Kucoin.Net

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

Should the second constructor of KucoinFuturesSymbolOrderBook be public and not internal ? #201

Closed EricGarnier closed 1 year ago

EricGarnier commented 1 year ago

Hi JKorf, thanks for the amazing job you have done. With the latest version I notice that the most complex version one the constructor for KucoinFuturesSymbolOrderBook is internal. This prevent the use of shared socket. Is this intentional?

        [ActivatorUtilitiesConstructor]
        internal KucoinFuturesSymbolOrderBook(
            string symbol,
            Action<KucoinOrderBookOptions>? optionsDelegate,
            ILogger<KucoinFuturesSymbolOrderBook>? logger = null,
            IKucoinRestClient? restClient = null,
            IKucoinSocketClient? socketClient = null) : base(logger, "Kucoin", symbol)

Thanks for your answer. Eric

JKorf commented 1 year ago

Hi Eric, you're right, the 2nd constructor should indeed be public. Seems like that one got lost in the update. I've updated it in v5.0.1 to be public again. FYI, you can now also use the IKucoinOrderBookFactory which automatically get's injected in DI and can construct order books which might be useful depending on your usecase and project structure.