binance-exchange / binance-java-api

binance-java-api is a lightweight Java library for the Binance API, supporting synchronous and asynchronous requests, as well as event streaming using WebSockets.
MIT License
831 stars 628 forks source link

Fix non-existent 'outboundAccountInfo' event. Replaced by 'outboundAccountPosition'. #386

Closed mcourteaux closed 3 years ago

mcourteaux commented 3 years ago

This fixes: #355, and probably #309.

This will cause people using this non-existent thing to cause compilation problems, which in my opinion is exactly what you want: the compiler telling you that your trading logic is using some non-existent thing in the API. Backwards compatibility is really not what you want here IMO. Updating this repository should indeed force you to look into your bug.

joaopsilva commented 3 years ago

Thanks.

brintal commented 3 years ago

But UserDataUpdateEventType.ACCOUNT_UPDATE is still used in the example included in the project. Hence the maven build is breaking now?!

mcourteaux commented 3 years ago

But UserDataUpdateEventType.ACCOUNT_UPDATE is still used in the example included in the project. Hence the maven build is breaking now?!

I updated the tests, and the Maven build is working for me. I looked through the code, and it seems here indeed: https://github.com/binance-exchange/binance-java-api/blob/master/src/test/java/com/binance/api/examples/UserDataStreamExample.java#L30 it is still used. This is not reported when I did mvn install. How do you trigger the error?

brintal commented 3 years ago

@mcourteaux Could you try executing mvn clean install. It seems like you still have the old classes in your classpath hence no error for you. clean should take care of that. I just cloned the repo on a new machine and did mvn clean install. Result:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/michael/Dev/IdeaProjects/binance-java-api/src/test/java/com/binance/api/examples/AccountBalanceCacheExample.java:[12,1] cannot find symbol
  symbol:   static ACCOUNT_UPDATE
  location: class
[ERROR] /home/michael/Dev/IdeaProjects/binance-java-api/src/test/java/com/binance/api/examples/UserDataStreamExample.java:[30,61] cannot find symbol
  symbol:   variable ACCOUNT_UPDATE
  location: class com.binance.api.client.domain.event.UserDataUpdateEvent.UserDataUpdateEventType
[ERROR] /home/michael/Dev/IdeaProjects/binance-java-api/src/test/java/com/binance/api/examples/MarginUserDataStreamExample.java:[31,61] cannot find symbol
  symbol:   variable ACCOUNT_UPDATE
  location: class com.binance.api.client.domain.event.UserDataUpdateEvent.UserDataUpdateEventType
[ERROR] /home/michael/Dev/IdeaProjects/binance-java-api/src/test/java/com/binance/api/examples/AccountBalanceCacheExample.java:[61,38] cannot find symbol
  symbol:   variable ACCOUNT_UPDATE
  location: class com.binance.api.examples.AccountBalanceCacheExample
mcourteaux commented 3 years ago

@brintal I made followup PR to fix examples: https://github.com/binance-exchange/binance-java-api/pull/388