Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object reference not set to an instance of an object when calling GetBalancesAsync #8

Open
ThomasJaeger opened this issue May 11, 2024 · 0 comments

Comments

@ThomasJaeger
Copy link

I'm getting the following error when I call GetBalancesAsync. No changes where made on my side, this happened after upgrading from 1.3.0 to 2.4.0:

at Bybit.Api.Clients.RestApi.BybitRestApiBaseClient.GetServerTimestampAsync() in E:\Github\Bybit.Api\Bybit.Api\Clients\RestApi\BybitRestApiBaseClient.cs:line 45 at ApiSharp.RestApiClient.SyncTimeAsync() in E:\Github\ApiSharp\ApiSharp\RestApiClient.cs:line 494 at ApiSharp.RestApiClient.PrepareRequestAsync(Uri uri, HttpMethod method, CancellationToken cancellationToken, Boolean signed, Dictionary2 queryParameters, Dictionary2 bodyParameters, Dictionary2 headerParameters, Nullable1 serialization, JsonSerializer deserializer, Boolean ignoreRatelimit, Int32 requestWeight) in E:\Github\ApiSharp\ApiSharp\RestApiClient.cs:line 140 at ApiSharp.RestApiClient.SendRequestAsync[T](Uri uri, HttpMethod method, CancellationToken cancellationToken, Boolean signed, Dictionary2 queryParameters, Dictionary2 bodyParameters, Dictionary2 headerParameters, Nullable1 serialization, JsonSerializer deserializer, Boolean ignoreRatelimit, Int32 requestWeight) in E:\Github\ApiSharp\ApiSharp\RestApiClient.cs:line 98 at Bybit.Api.Clients.RestApi.BybitRestApiBaseClient.SendBybitRequest[T](Uri uri, HttpMethod method, CancellationToken cancellationToken, Boolean signed, Dictionary2 queryParameters, Dictionary2 bodyParameters, Dictionary2 headerParameters, Nullable1 arraySerialization, JsonSerializer deserializer, Boolean ignoreRatelimit, Int32 requestWeight) in E:\Github\Bybit.Api\Bybit.Api\Clients\RestApi\BybitRestApiBaseClient.cs:line 100 at Bybit.Api.Clients.RestApi.BybitRestApiAccountClient.GetBalancesAsync(BybitAccountType account, String asset, CancellationToken ct) in E:\Github\Bybit.Api\Bybit.Api\Clients\RestApi\BybitRestApiAccountClient.cs:line 54 at ExchangeBybit.Api.GetWalletBalanceAsync(String accountType, String coin) in /home/hampelman/source/jtrading/ExchangeBybit/Api.cs:line 69

The call I make is this:

var response = await _client.Account.GetBalancesAsync(type, coin);

where type is BybitAccountType.Contract and coin is USDT

Looks like Bybit.Api.Clients.RestApi.BybitRestApiBaseClient.GetServerTimestampAsync() is failing.

Please help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant