Closed lostless13 closed 3 years ago
Sorry I would have done a pull request but I wasn't sure how you wanted to handle dealing with the https.js core utility and getting the header.
In my Bittrex Api library I just do this check in the main get method and add it to the body json:
if (response.headers.sequence) response.data["sequence"] = Number(response.headers.sequence)
Sort of a weird design on bittrex's part.
Ah! Interesting, I didn't realize Bittrex sent the sequence in the headers.
We can just add a getRaw
(or something like that) method to https
that resolves with tuple of the concatenated body and headers on success instead of the parsed JSON body. That way the caller can take action they want on the body Buffer and headers.
If you want to give it a shot, I can assign the issue to you.
I already overrode and rebound the function in my app to get it out the door so I doubt I'd get to it anytime soon with my current backlog. Sorry.
No worries! Thanks for reporting the issue
function _requestLevel2Snapshot should include the sequence id in the return value so that the starting point is known.
The sequence id is in the response header called "sequence" when you call the Bittrex V3 markets/{id}/orderbook endpoint.