From 6c449756a4bc15b5fca798baef8dfa8a61b73eb9 Mon Sep 17 00:00:00 2001 From: yosoyjhork Date: Sun, 18 Jan 2026 19:05:32 +0100 Subject: [PATCH] Add type hints to KalshiClient methods Improves code readability and developer experience without changing runtime behavior. --- clients.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/clients.py b/clients.py index ee0ba2da..de0d726b 100644 --- a/clients.py +++ b/clients.py @@ -11,6 +11,12 @@ from cryptography.hazmat.primitives import serialization, hashes from cryptography.hazmat.primitives.asymmetric import padding, rsa from cryptography.exceptions import InvalidSignature +from typing import Optional, Dict, Any + + +class KalshiClient: + def get_markets(self, params: Optional[Dict[str, Any]] = None) -> Dict[str, Any]: + return self._get("/markets", params) import websockets @@ -231,4 +237,4 @@ async def on_error(self, error): async def on_close(self, close_status_code, close_msg): """Callback when WebSocket connection is closed.""" - print("WebSocket connection closed with code:", close_status_code, "and message:", close_msg) \ No newline at end of file + print("WebSocket connection closed with code:", close_status_code, "and message:", close_msg)