michaelhly / solana-py

Solana Python SDK
https://michaelhly.github.io/solana-py
MIT License
979 stars 252 forks source link

Enhance Type Hinting for WebSocket Connection #437

Closed circansm closed 3 months ago

circansm commented 3 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 3 months ago

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