michaelhly / solana-py

Solana Python SDK
https://michaelhly.github.io/solana-py
MIT License
1.04k stars 273 forks source link

Enhance Type Hinting for WebSocket Connection #437

Closed circansm closed 4 months ago

circansm commented 4 months ago

This PR enhances the type hinting of the connect method in websocket_api.py to return SolanaWsClientProtocol instead of the general WebSocketClientProtocol. This change helps improve IDE support and developer experience by enabling better autocompletion and type checking for specific methods like logs_subscribe that are available on SolanaWsClientProtocol.

This addresses the issue #434 where there was a lack of autocompletion support in IDEs due to incorrect type hinting.

michaelhly commented 4 months ago

@kevinheavey tests seem to pass. Looks safe to merge?