user_data_stream bug? why cant catch the UserDataStreamEventsResponse model,actual_instance is None?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start with the reproduced user_data_stream subscription and inspect websocket_streams/models/user_data_stream_events_response.py, where UserDataStreamEventsResponse is defined. Trigger a create-order or cancel-order event and compare the received model with its one-of schemas. Done means the corresponding event is represented by a populated actual_instance instead of None.
Written by the indexing model from the issue text.
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={}
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 707
- Avg merge
- 2h 17m
- Merged PRs (30d)
- 2
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from binance/binance-connector-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
binance/binance-connector-python#514 · 1 comment ·
-
[Bug] WebSocket API: session re-logon after reconnect is sent without apiKey and signaturePossibly taken @Amadeus-22 claimed this 1 day ago. Open
Difficulty 3/5 1-3 hours Newbie friendliness 74/100
-
[Bug] Response models declare numeric fields as strict `str`, causing silent fallback of `.data()` to raw dict (simple-earn & staking)Possibly taken @Tyagiquamar claimed this 24 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 68/100
binance/binance-connector-python#553 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
All issues in binance/binance-connector-python
Similar issues
-
bug Triage-Needed
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
FuRongJun-1999/dsh-memory#170 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
521xueweihan/HelloGitHub#3940 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100