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.84k stars 1.94k forks source link

OKX NumberFormatException on GetOrder #4718

Open Wayruha opened 1 year ago

Wayruha commented 1 year ago

Getting NumberFormatException of GetOrder in case if order type is MARKET (price=""). There's a piece of code new BigDecimal(order.getPrice()) which is failing because of illegal argument "". `java.lang.NumberFormatException: null at java.base/java.math.BigDecimal.(BigDecimal.java:624) at java.base/java.math.BigDecimal.(BigDecimal.java:401) at java.base/java.math.BigDecimal.(BigDecimal.java:834) at org.knowm.xchange.okex.OkexAdapters.adaptOrder(OkexAdapters.java:79) at org.knowm.xchange.okex.service.OkexTradeService.getOrder(OkexTradeService.java:121)

rizer1980 commented 1 year ago

hi. How is it that the answer comes with an empty field px (price)?

Wayruha commented 1 year ago

I can't answer this question as I'm not a representative of Okx or XChange. That's just a fact which I got for MARKET order

rizer1980 commented 1 year ago

Is the error permanent or did it happen once? If permanent, show your code where it occurs. and attach debug logs. such that the request and response from the OKX server were visible