I have six keys for streaming depth data : all_symbols = [[‘BTCAUD’, [‘ETHBTC’, ‘BNBBTC’]], [‘ETHAUD’, [‘BNBETH’, ‘ETHBUSD’]]].
If I don’t log in then I don’t get an error.
I use asyncio sleep(1), after getting the data of all element keys. Example : ‘BTCAUD’, ‘ETHBTC’, ‘BNBBTC’
asyncio sleep(1)
‘ETHAUD’, ‘BNBETH’, ‘ETHBUSD’
asyncio sleep(1)
do I need authorization ?
how can i use ‘sleep’ so that no error occurs ? when i use authorization .
async def main():
global status_connect
uri = “wss://stream.binance.com:9443/stream?streams=”
async with websockets.connect(uri,ping_interval=None) as websocket:
await on_open(websocket, status_connect)
while True:
message = await websocket.recv()
if re.match(r’^{"stream’, message):
await on_message(websocket, message)