New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
binance: add watchTickers #16159
binance: add watchTickers #16159
Conversation
const subscribe = { | ||
'id': requestId, | ||
}; | ||
const tickers = await this.watch (url, messageHash, this.extend (request, params), messageHash, subscribe); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sc0Vu I think we need to apply the same logic as we have in Cex, because, for futures Binance does not send all the updates within the same message, so we end up returning an empty array when the message does not contain the subscribed symbol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the topic and data format are the same for different types, probably need to wait the ticker.
These command worked for me:
node examples/js/cli binanceusdm watchTickers '["MATIC/BUSD"]'
node examples/js/cli binanceusdm watchTickers '["APT/BUSD"]'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sc0Vu what do you mean by "probably need to wait the ticker." ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@carlosmiei I see, you mean user might get empty array in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sc0Vu yeah but as I said cex solves this issue in an easy way, can you check it out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sc0Vu is this ready to be reviewed again?
…ccxt into add-binance-watch-tickers
LGTM ✅
|
@sc0Vu do you have plans for adding watchTickers for coinbase (advanced api) too? |
In this PR, I made these changes:
Test command: