Open pvyhnal-generalbytes opened 3 years ago
Hey, just chiming in here in case this would be useful. I know this isn't exactly an answer to your question but I was getting that error as well when hosting my app in a US region. Binance has a separate API for US that you should be using (or just host the app somewhere other than US)
To cayenne's point that was my first reaction (but I am not sure if that is what is causing it) but us is binance.us and everywhere else is binance.com
Yes this specific error happens when you call binance.com from the USA (see this reddit post) but my issue is that in that case the method just returns null. Should it throw an exception with the message from the HTTP response instead?
The same problem is when your IP is not on the whitelist for example. You would need trace logging to see the reason why it failed.
@pvyhnal-generalbytes i think throwing the message the exchange is throwing back is most certainly the right way to go about this feel free to open a PR
when calling
org.knowm.xchange.binance.service.BinanceAccountService#requestDepositAddress
it can get something like{"msg":"Apologies but we are unable to provide services to you as per our Terms of Use.","success":false}
(HTTP 200) from the server and it is logged in TRACE level but when that happennull
is returned from that method.Is this the pattern with other exchanges too or should it throw an exception?