OKX NumberFormatException on GetOrder

Open
#4,718 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
java
Domain
api, backend

Research direction

Start in org.knowm.xchange.okex.OkexAdapters.adaptOrder at OkexAdapters.java:79, then inspect OkexTradeService.getOrder at OkexTradeService.java:121 and the MARKET-order response where price is empty. Done means GetOrder no longer throws NumberFormatException for a MARKET order and adapts the returned order successfully.

Written by the indexing model from the issue text.

Description

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)

Dominant language
Java
Stars
4.1k
Forks
2k
Avg merge
2d 12h
Merged PRs (30d)
21

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from knowm/XChange

All issues in knowm/XChange

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.