binance icon indicating copy to clipboard operation
binance copied to clipboard

same as https://github.com/tiagosiebler/binance/issues/203

Open anymos opened this issue 2 years ago • 5 comments

there is typo error between cummulativeQuoteQty and cumulativeQuoteQty.

impact is when you run

let orderResult = (await mainClient.submitNewOrder(orderRequest)) as OrderResponseFull;

orderResult.cummulativeQuoteQty is empty while

orderResult['cummulativeQuoteQty'] is containing the right value.

anymos avatar Aug 26 '22 12:08 anymos

Meanwhile, I know you are right it shall have only 1 'm', but binance API return the result with 2 m: you can check it: https://github.com/binance/binance-spot-api-docs/blob/master/rest-api.md#new-order--trade

Probably quicker to be fixed on your side ;-)

anymos avatar Aug 26 '22 12:08 anymos

quick update, this is also the case for the cancel order it return cummulativeQuoteQty (2m), but the interface is with only 1 m

anymos avatar Aug 26 '22 14:08 anymos

There is a pull request about it (open) #225

lobobruno avatar Sep 15 '22 21:09 lobobruno

@lobobruno

Nice but this pull request is missing the cancel one ;-) (cummulativeQuoteQty)

anymos avatar Sep 16 '22 02:09 anymos

There is a pull request about it (open) #225

This PR changes some websocket response types from the beautifier (which imo don't need to be updated). Consistency is nice, but it's an unnecessary breaking change for anyone already integrated with those beautified ws properties. Those changes need to be undone before that PR can go in.

tiagosiebler avatar Sep 17 '22 09:09 tiagosiebler

I agree, let me think maybe I will find a way to have both working without a possible regression.

Maybe by adding a new method that will return the right one so the previous use will be not impacted ? jsut a thought.

It make me thinking about the referrer and referer of the early days on internet aahahahhah

anymos avatar Oct 27 '22 08:10 anymos

What about having cummulativeQuoteQty?, with the question mark, so at least the type is accepting both without using the ng-ignore. Same just a though not sure it is a good idea. The main issue I see in the current code is that without digging if one is trusting the interface then the cummulativeQuoteQty is always null, and this is how I saw it.

anymos avatar Oct 27 '22 08:10 anymos

What about having cummulativeQuoteQty?, with the question mark, so at least the type is accepting both without using the ng-ignore. Same just a though not sure it is a good idea. The main issue I see in the current code is that without digging if one is trusting the interface then the cummulativeQuoteQty is always null, and this is how I saw it.

The changes to REST types should be separate from the changes to WS types. REST responses are controlled by binance, so the types should match whatever binance is responding with. Any REST response types that don't match are technically broken, so correcting those is not a breaking change - it is a fix.

WebSocket response types are controlled by my connector (by the beautifier). If I understood correctly, those are already working before changing the ws response type, since the beautifier is setting that name (not binance, since binance sends minified events).

So by renaming the websocket response type it's a breaking change. I do agree in consistency, but the breaking change is the part that should be avoided for now. Can leave a note that in the next major release the ws type should be updated in the beautifier to be consistent, but I don't think that needs to happen now.

tiagosiebler avatar Oct 27 '22 10:10 tiagosiebler

Fixed in #261. Sorry about the delay.

tiagosiebler avatar Nov 21 '22 13:11 tiagosiebler