Kucoin / kucoin-futures-python-sdk

MIT License
7 stars 3 forks source link

Sandbox Can't find contract #9

Closed guanm326 closed 1 month ago

guanm326 commented 3 years ago

I tried running the following code but can't get it to work. Note I am testing in sandbox component. (is_sandbox=True). this works when I am not using the sandbox....

import asyncio
from kucoin_futures.client import WsToken
from kucoin_futures.ws_client import KucoinFuturesWsClient

async def main():
    async def deal_msg(msg):
        print(msg)
        if msg['topic'] == '/contractMarket/level2:XBTUSDM':
            print(f'Get XBTUSDM Ticker:{msg["data"]}')
        elif msg['topic'] == '/contractMarket/level3:XBTUSDTM':
            print(f'Get XBTUSDTM level3:{msg["data"]}')

    # is public
    # client = WsToken()
    # is private
    #client = WsToken(key='', secret='', passphrase='', is_sandbox=True, url='')
    # is sandbox
    client = WsToken(is_sandbox=True)
    ws_client = await KucoinFuturesWsClient.create(loop, client, deal_msg, private=False)
    await ws_client.subscribe('/contractMarket/tickerV2:XBTUSDTM')
    #await ws_client.subscribe('/contractMarket/level3:XBTUSDM')
    while True:
        await asyncio.sleep(60, loop=loop)

if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(main())

Getting the following error:

{'code': 404, 'data': 'topic /contractMarket/tickerV2:XBTUSDTM is not found', 'id': '1620356359200', 'type': 'error'}

ISAAC-XXYYZZ commented 1 month ago

We have temporarily suspended support for the Sandbox environment. Due to many changes in the SDK, please refer to our latest documentation: https://www.kucoin.com/docs/beginners/introduction Please try updating to the latest version of the SDK and modify your code to try again. If you encounter any issues, feel free to provide feedback.