Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.

Bittrex: Bittrex Level 2 Snapshot should return the sequence Id #220

Closed
lostless13 opened this issue Oct 2, 2020 · 5 comments · Fixed by #235
Closed

Bittrex: Bittrex Level 2 Snapshot should return the sequence Id #220

lostless13 opened this issue Oct 2, 2020 · 5 comments · Fixed by #235
Labels
existing exchange Modify an existing exchange fix-me Something isn't working hacktoberfest

Comments

@lostless13
Copy link

lostless13 commented Oct 2, 2020

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.

@lostless13
Copy link
Author

lostless13 commented Oct 2, 2020

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.

@bmancini55
Copy link
Member

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.

@bmancini55
Copy link
Member

If you want to give it a shot, I can assign the issue to you.

@bmancini55 bmancini55 added fix-me Something isn't working hacktoberfest existing exchange Modify an existing exchange labels Oct 2, 2020
@lostless13
Copy link
Author

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.

@bmancini55
Copy link
Member

No worries! Thanks for reporting the issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
existing exchange Modify an existing exchange fix-me Something isn't working hacktoberfest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants