Closed posman closed 1 year ago
Interesting observation - I see it too. There's no custom logic here doing that to-array mapping in my SDK, seems like that's how the API itself is responding.
What I'll actually do here is update the return type for that method to always be an array: Promise<SymbolLeverageBracketsResult[]>
. Not really a breaking change since that's how the API itself responds, not a new transformation from the SDK, and will make for a less fussy implementation for anyone using typescript. Thanks for pointing it out.
Fixed in v2.5.0 (via #311)
This is not a bug, just an observation
According to Binance API https://binance-docs.github.io/apidocs/futures/en/#notional-and-leverage-brackets-user_data, the endpoint leverageBracket will return an array when called without a symbol and a JSON object when called with a symbol.
But the method
getNotionalAndLeverageBrackets()
in USDMClient it's returning an array in both cases. When called with a symbol, returns an array of length = 1Everything is working fine. Just something to take in account. (I know people's code will break if a change is made to the function)