@@ -6,9 +6,13 @@ Async Python client for WhiteBit API
66
77* [ Private http V4 API] ( https://github.com/whitebit-exchange/api-docs/blob/f7ca495281ade44f9f075a91c2e55d5da32a99fd/Private/http-trade-v4.md )
88* [ Public WS API] ( https://github.com/whitebit-exchange/api-docs/blob/master/Public/websocket.md )
9+ * Enhanced WebSocket events with ` event_time ` and ` update_id ` metadata
10+ * BookTicker WebSocket stream for real-time best bid/ask prices
11+ * Market depth subscriptions with enhanced metadata support
912* [ Public http v1] ( https://github.com/whitebit-exchange/api-docs/blob/main/docs/Public/http-v1.md )
1013* [ Public http v2] ( https://github.com/whitebit-exchange/api-docs/blob/main/docs/Public/http-v2.md )
1114* [ Public http v4] ( https://github.com/whitebit-exchange/api-docs/blob/main/docs/Public/http-v4.md )
15+ * Funding history endpoint for futures markets
1216* Webhook support with examples
1317* Rate limiting
1418* Type hints
@@ -41,6 +45,62 @@ async def main():
4145asyncio.run(main())
4246```
4347
48+ ### New Features in v0.3.0
49+
50+ #### BookTicker WebSocket Stream
51+
52+ ``` python
53+ import asyncio
54+ from aiowhitebit.clients.websocket import PublicWebSocketClient, SubscribeRequest
55+
56+ async def bookticker_example ():
57+ client = PublicWebSocketClient()
58+
59+ # Subscribe to BookTicker stream
60+ response = await client.bookticker_subscribe(" BTC_USDT" )
61+ print (f " Subscribed: { response} " )
62+
63+ # Unsubscribe from BookTicker stream
64+ response = await client.bookticker_unsubscribe(" BTC_USDT" )
65+ print (f " Unsubscribed: { response} " )
66+
67+ await client.close()
68+
69+ asyncio.run(bookticker_example())
70+ ```
71+
72+ #### Funding History for Futures Markets
73+
74+ ``` python
75+ import asyncio
76+ from aiowhitebit.clients.public import PublicV4Client
77+
78+ async def funding_history_example ():
79+ client = PublicV4Client()
80+
81+ # Get funding rate history for BTC_USDT futures
82+ history = await client.get_funding_history(" BTC_USDT" )
83+
84+ for item in history.result:
85+ print (f " Time: { item.timestamp} , Rate: { item.funding_rate} " )
86+
87+ asyncio.run(funding_history_example())
88+ ```
89+
90+ #### Enhanced WebSocket Events with Metadata
91+
92+ All WebSocket events now include optional ` event_time ` and ` update_id ` fields for better tracking and synchronization:
93+
94+ ``` python
95+ # WebSocket responses now include metadata
96+ {
97+ " method" : " depth_update" ,
98+ " params" : {... },
99+ " event_time" : 1640995200000 , # Event timestamp
100+ " update_id" : 12345 # Unique update identifier
101+ }
102+ ```
103+
44104## Documentation
45105
46106For detailed documentation and examples, visit our [ GitHub repository] ( https://github.com/doubledare704/aiowhitebit ) .
0 commit comments