burakoner / Bybit.Api

Bybit API Wrapper. Up-to-date, most-complete, well-organized, well-documented, easy-to-use, multi-task and multi-thread compatible Bybit Cryptocurrency Exchange Rest and Websocket Api Wrapper
MIT License
1 stars 1 forks source link

BUG: BybitRestApiClient.Asset is Null #6

Closed ThomasJaeger closed 7 months ago

ThomasJaeger commented 8 months ago

When creating the client, the Asset property is null. There is a missing initialization when BybitRestApiClient is created. To fix this, add line:

this.Asset = new BybitAssetRestApiClient(this);

in the constructor. Like so:

    public BybitRestApiClient(ILogger logger, BybitRestApiClientOptions options)
    {
        this.ClientOptions = options;
        this.MainClient = new BaseRestApiClient(this);

        this.Server = new BybitServerRestApiClient(this);
        this.User = new BybitUserRestApiClient(this);
        this.Account = new BybitAccountRestApiClient(this);
        this.Market = new BybitMarketRestApiClient(this);
        this.Trade = new BybitTradeRestApiClient(this);
        this.Position = new BybitPositionRestApiClient(this);
        this.LeveragedTokens = new BybitLeveragedTokensRestApiClient(this);
        this.UnifiedMargin = new BybitUnifiedMarginRestApiClient(this);
        this.NormalMargin = new BybitNormalMarginRestApiClient(this);
        this.InstitutionalLending = new BybitInstitutionalLendingRestApiClient(this);
        this.Asset = new BybitAssetRestApiClient(this);
    }
burakoner commented 7 months ago

Thank you for feedback. Fixed in new version

ThomasJaeger commented 7 months ago

Thank you!