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 138 forks source link

Exception on GetExchangeInfo() #143

Closed yetkinsari closed 5 years ago

yetkinsari commented 5 years ago

Issue Overview

Exception on client.GetExchangeInfo();

Package Version: 4.9.1

Using source code head revision last git commit id: 38e2568a4dd623b78bbb26fb1217aa8ede381802 Apr 12 2019

Repro Steps

Open up exampleprogram.cs, put in your keys if relevant. try to get exchange info, you get an exception, see error messages below: Error converting value "PRICE_FILTER" to type 'BinanceExchange.API.Enums.ExchangeInfoSymbolFilterType'. Path 'filterType', line 1, position 646. Inner exception message: Enum name 'PERCENT_PRICE' already exists on enum 'ExchangeInfoSymbolFilterType'.

Other Information

In ExchangeInfoSymbolFilterType.cs you have duplicate PERCENT_PRICE EnumMember Workaround for me is renaming second one to PERCENTAGE_PRICE for now.

EpicTiger commented 5 years ago

I tried to fix this issue but i did not understand the construction made by @glitch100 in class ExchangeInfoSymbolFilterConverter.cs the error occurs when calling GetExchangeInfo in the converter class on line 21. This issue causes the issue explained here https://github.com/glitch100/BinanceDotNet/issues/145

Erwin1989 commented 5 years ago

You don't have to duplicate, the problem is at the bottom of ExchangeInfoSymbolFilterType.cs (change the value to PERCENTAGE_PRICE):

endregion

[EnumMember(Value = "PERCENT_PRICE")] PercentagePrice,

yetkinsari commented 5 years ago

Above I tried to say: there is a duplication, so renaming is necessary.

glitch100 commented 5 years ago

Would you like to make a PR?

yetkinsari commented 5 years ago

PR created : https://github.com/glitch100/BinanceDotNet/pull/152