tiagosiebler / binance

Node.js & JavaScript SDK for Binance REST APIs & WebSockets, with TypeScript & browser support, integration tests, beautification & more.
MIT License
757 stars 266 forks source link

Incorrect Type Definition for WsMessage24hrTickerFormatted #398

Closed h1b9b closed 7 months ago

h1b9b commented 7 months ago

Hello,

I've noticed an issue with the TypeScript type definition for WsMessage24hrTickerFormatted. The bestAsk field always appears as undefined.

According to the mapping for 24hrTickerEvent, it seems that the correct field to use should be bestAskPrice. However, this would introduce inconsistency in naming between bestBid and bestAsk.

tiagosiebler commented 7 months ago

Hmm I see the conflict. bestBid and bestAskPrice. Renaming it would be a breaking change for anyone that happens to be using it (which an accurate type definition might mitigate a bit, but not everyone uses typescript). Short term fix is improving the type to match what the data actually looks like, I'll get that added shortly. Consistency would be nice long term though...

h1b9b commented 7 months ago

Thanks for fixing the conflict so quickly! Improving the type definitions to match the data structure sounds like the best short-term fix. 👍