-
Notifications
You must be signed in to change notification settings - Fork 656
Description
def on_user_data_stream_um(self,data):
print(f"data type: {type(data)},{data}")
async def subscribe_user_data_stream_um(self):
connection = await self.get_um_connection()
try:
resp = await connection.start_user_data_stream()
listen_key = resp.data().result.listen_key
if not listen_key:
raise ValueError("无法获取 listenKey: " + str(resp))
print("listenKey:", listen_key)
ws = self.um_client.websocket_streams
connection = await ws.create_connection()
stream = await ws.user_data(listen_key)
stream.on("message", lambda data: self.on_user_data_stream_um(data))
await asyncio.sleep(1000)
await stream.unsubscribe()
except Exception as e:
logging.error(f"subscribe_user_data_stream_um() error: {e}")
the code above when create or cancel order , it dones catch the UserDataStreamEventsResponse model,actual_instance still None
this is the output:
data type: <class 'binance_sdk_derivatives_trading_usds_futures.websocket_streams.models.user_data_stream_events_response.UserDataStreamEventsResponse'>,oneof_schema_1_validator=None oneof_schema_2_validator=None oneof_schema_3_validator=None oneof_schema_4_validator=None oneof_schema_5_validator=None oneof_schema_6_validator=None oneof_schema_7_validator=None oneof_schema_8_validator=None oneof_schema_9_validator=None actual_instance=None one_of_schemas={'AccountUpdate', 'AccountConfigUpdate', 'GridUpdate', 'ConditionalOrderTriggerReject', 'OrderTradeUpdate', 'Listenkeyexpired', 'MarginCall', 'TradeLite', 'StrategyUpdate'} discriminator_value_class_map={}