Skip to content
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

Could we bring the the "Subject" object from the Websocket Ticker Response? #107

Open
Ocma opened this issue Dec 18, 2021 · 0 comments
Open

Comments

@Ocma
Copy link

Ocma commented Dec 18, 2021

Hi there! First of all, thanks a lot for all your work. Without your libraries I doubt I would have been able to immerse myself in dealing with Binance or Kucoin APIs.

I do have a question about the Websocket. When I subscribe to get all the symbols ('/market/ticker:all') the response does only contain the "data" object, so it does not say to what pair does it relate to.

Is there any way of bringing the "subject" object as well?

    async def main():
        global loop
        async def handle_evt(msg):
                  print(msg["data"])
        client = Client(api_key, api_secret, api_passphrase)
        ksm = await KucoinSocketManager.create(loop, client, handle_evt)
        await ksm.subscribe('/market/ticker:all')

response from code above:

{'bestAsk': '5.8412', 'bestAskSize': '98.0368', 'bestBid': '5.82', 'bestBidSize': '9.476', 'price': '5.8323', 'sequence': '1615121675585', 'size': '1.9945', 'time': 1639786832796}

Kucoin Documentation response example with the subject object:

{
    "type":"message",
    "topic":"/market/ticker:all",
    "subject":"BTC-USDT",
    "data":{

        "sequence":"1545896668986",
        "bestAsk":"0.08",
        "size":"0.011",
        "bestBidSize":"0.036",
        "price":"0.08",
        "bestAskSize":"0.18",
        "bestBid":"0.049"
    }
}

Thanks a lot in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant