knowm / XChange

XChange is a Java library providing a streamlined API for interacting with 60+ Bitcoin and Altcoin exchanges providing a consistent interface for trading and accessing market data.
http://knowm.org/open-source/xchange/
MIT License
3.82k stars 1.93k forks source link

[Binance] Futures pull request changes broke xchange for some users #4661

Open kovalu opened 1 year ago

kovalu commented 1 year ago

Hi @makarid, I've found out after upgrade to xchange 5.1.0 that your Futures changes in following PR broke xchange for some users https://github.com/knowm/XChange/pull/4614

I'm in contact with couple of people using our service and for them the call to BinanceAccountService.getAccountInfo fails: image

The reason is the call to futuresAcount(). I don't have it confirmed yet, but I think that for people who never used futures this fails. I don't think this should be called, or it should be called somehow conditionally based on getting some info that the user has futures account or the api key has permissions to call it.

Will you be able to fix that, @makarid?

kovalu commented 1 year ago

I can confirm now, that with one user having this issue it helped that he activated the futures account on Binance. Weirdly enough, the original API key still didn't work. He needed to create new API key.

This needs to be fixed so it works also for new accounts registered on Binance without activating the futures account.

TheCookieLab commented 1 year ago

This is a blocking issue for those using Binance.us as the workaround of activating the future's account is not possible. Accessing any of the BinanceAccountService APIs results in:

Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms. Please contact customer service if you believe you received this message in error. (HTTP status code: 451)

makarid commented 1 year ago

Sure guys, I will make the futures disabled by default. This will fix the issue, I didn't know that you have to activate the futures on Binance first, I thought it is enabled by default.

On Wed, Jan 18, 2023, 9:31 PM TheCookieLab @.***> wrote:

This is a blocking issue for those using Binance.us as the workaround of activating the future's account is not possible. Accessing any of the BinanceAccountService APIs results in:

Service unavailable from a restricted location according to 'b. Eligibility' in https://www.binance.com/en/terms. Please contact customer service if you believe you received this message in error. (HTTP status code: 451)

— Reply to this email directly, view it on GitHub https://github.com/knowm/XChange/issues/4661#issuecomment-1387650880, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHIWQ72MBXAI35TOOAD7QBLWTBAJFANCNFSM6AAAAAAT3JR7EA . You are receiving this because you were mentioned.Message ID: @.***>

TheCookieLab commented 1 year ago

Thanks, appreciate the quick acknowledgement.

nibarulabs commented 1 year ago

Any update on this as to when it'll get into a PR and a release?

nibarulabs commented 1 year ago

I have built the Binance module from the develop branch and can confirm it is again working as expected with no futures enabled on Binance.us.

mrmx commented 1 year ago

I can confirm that the current develop branch that calls futuresAcount() fails if no futures account is open in Binance. Waiting for @makarid #4665 PR merge that adds flag support to enable futures account