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

[Kucoin] NullPointerException on equals(getId()) from Trade #4694

Open trixprod opened 1 year ago

trixprod commented 1 year ago

Hello, Xchange is returning Kucoin trades with null id :

Trade{ type=BID, originalAmount=4.127400000000000000, instrument=ORAI/USDT, price=6.057, timestamp=Sun Jan 26 12:05:47 UTC 78177, **id='null',** makerOrderId='null', takerOrderId='null'} The trade class need a mandatory Id to check equals :

public boolean equals(Object o) { if (this == o) { return true; } else { return o != null && this.getClass() == o.getClass() ? this.id.equals(((Trade)o).getId()) : false; } }

rizer1980 commented 1 year ago

I suppose that it is better to do the check in the Kucoin class, since this is not a standard situation