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

Located bug in ListenUserDataEndpoint #56

Open
krillin6 opened this issue Jun 16, 2018 · 2 comments
Open

Located bug in ListenUserDataEndpoint #56

krillin6 opened this issue Jun 16, 2018 · 2 comments

Comments

@krillin6
Copy link

The switch statement doesn't work because eventData.e isn't being cast to a string.

I ran through the code in debug mode and was able to confirm changing this:
switch (eventData.e)
to this:
switch ((string)eventData.e)
made the switch statement properly evaluate and the event handlers will now fire.

@krillin6
Copy link
Author

Another item cropped up now that it mostly works:

-		$exception	{"A member with the name 't' already exists on 'Binance.API.Csharp.Client.Models.WebSocket.AccountUpdatedMessage'. Use the JsonPropertyAttribute to specify another name."}	Newtonsoft.Json.JsonSerializationException
+		Data	{System.Collections.ListDictionaryInternal}	System.Collections.IDictionary {System.Collections.ListDictionaryInternal}
		HResult	-2146233088	int
		HelpLink	null	string
+		InnerException	null	System.Exception
		Message	"A member with the name 't' already exists on 'Binance.API.Csharp.Client.Models.WebSocket.AccountUpdatedMessage'. Use the JsonPropertyAttribute to specify another name."	string
		Source	"Newtonsoft.Json"	string
		StackTrace	"   at Newtonsoft.Json.Serialization.JsonPropertyCollection.AddProperty(JsonProperty property)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateProperties(Type type, MemberSerialization memberSerialization)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)\r\n   at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)\r\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\r\n   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\r\n   at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)\r\n   at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)\r\n   at Binance.API.Csharp.Client.ApiClient.<>c__DisplayClass3_0.<ConnectToUserDataWebSocket>b__0(Object sender, MessageEventArgs e) in C:\\Users\\kberger\\source\\repos\\Binance.API.Csharp.Client-master\\Binance.API.Csharp.Client\\ApiClient.cs:line 157\r\n   at WebSocketSharp.Ext.Emit[TEventArgs](EventHandler`1 eventHandler, Object sender, TEventArgs e)\r\n   at WebSocketSharp.WebSocket.messagec(MessageEventArgs e)"	string
+		TargetSite	{Void AddProperty(Newtonsoft.Json.Serialization.JsonProperty)}	System.Reflection.MethodBase {System.Reflection.RuntimeMethodInfo}

A member with the name 't' already exists on 'Binance.API.Csharp.Client.Models.WebSocket.AccountUpdatedMessage'

There's a typo here on AccountUpdatedMessage:

    [JsonProperty("t")]
    public int TakerCommission { get; set; }
    
    [JsonProperty("t")]
    public bool CanTrade { get; set; }

One needs to be upper case... I can fix that on my end as well.

@krillin6
Copy link
Author

Fuck me. It gets even worse. I've mostly fixed the deserialize issues, but now the JSON converter can't tell the difference in Case-sensitivity, so t and T, c and C, don't always work right... This is a nightmare.

Instead of "o":"MARKET", I get "O":-1 half of the time. So Type = -1, and not MARKET, like it should.

JamesNK/Newtonsoft.Json#1074

The English in the above link is shit, but they closed the case without fixing it for performance reasons apparently. :(

This whole Binance API is turning into a massive nightmare. As it stands now, this entire code project is basically unusable. I'll have to finish this later.

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