glitch100 / BinanceDotNet

Official C# Wrapper for the Binance exchange API, with REST and WebSocket endpoints
https://www.nuget.org/packages/BinanceDotNet/
MIT License
161 stars 140 forks source link

Intermittent issue with #168

Open raderag opened 4 years ago

raderag commented 4 years ago

Issue Overview

A short description of the issue I get a malformed requests intermittently when I call GetAccountInformation().

Package Version: ?.?.?

latest - 4.12.0

Repro Steps

Happens sometimes when I call GetAccountInformation();

The client is connected, the keys are the same. Once it happens, it doesn't seem to work for a while; I was wondering if it could be an issue with rate limiting?

Other Information

Malformed requests are sent to the server. Please review the request object/string

at BinanceExchange.API.APIProcessor.d8`1.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at BinanceExchange.API.APIProcessor.d11`1.MoveNext() at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at BinanceExchange.API.Client.BinanceClient.d__31.MoveNext()

Its generated in this call: public Task GetAccountInformation(int receiveWindow = -1);

which calls

    public async Task<T> ProcessGetRequest<T>(BinanceEndpointData endpoint, int receiveWindow = 5000) where T : class

    this line:
        message = await RequestClient.SignedGetRequest(endpoint.Uri, _apiKey, _secretKey, endpoint.Uri.Query, receiveWindow);

    The key and secret are correct. 
raderag commented 4 years ago

The issue is really simple, if using the binance.us system, you need the binance.us endpoint.