node-binance-api icon indicating copy to clipboard operation
node-binance-api copied to clipboard

Some API calls ignore some options

Open NoUJoe opened this issue 4 years ago • 0 comments

Some API calls do not use options that you set. For example, binance.prices () vs binance.prevDay ():

binance.prevDay () does follow the options that you set because of the following code in the function:

https://github.com/jaggedsoft/node-binance-api/blob/0d0a4cd91f7698efbd4d896a323209ca6706b944/node-binance-api.js#L3317-L3318

publicRequest() calls reqObj( url, data, method ) which returns an object that uses options:

https://github.com/jaggedsoft/node-binance-api/blob/0d0a4cd91f7698efbd4d896a323209ca6706b944/node-binance-api.js#L196-L209

However, binance.prices () does not use all the options that you set:

https://github.com/jaggedsoft/node-binance-api/blob/0d0a4cd91f7698efbd4d896a323209ca6706b944/node-binance-api.js#L3249-L3255

It sets it's own options for the http request and does not call publicRequest() bypassing reqObj( url, data, method ).

Is there any reason for this? There are many more examples, it's seemingly random.

NoUJoe avatar Nov 11 '21 03:11 NoUJoe