diff --git a/core/api-doc-config.generated.json b/core/api-doc-config.generated.json index 3e176c67..7929ab04 100644 --- a/core/api-doc-config.generated.json +++ b/core/api-doc-config.generated.json @@ -1,5 +1,5 @@ { - "_generated": "Auto-generated by extract-jsdoc.js on 2026-06-02T00:34:44.916Z. Do not edit manually.", + "_generated": "Auto-generated by extract-jsdoc.js on 2026-06-05T14:21:50.064Z. Do not edit manually.", "methods": { "has": { "summary": "HTTP verb for the endpoint (e.g. GET, POST). */", @@ -566,7 +566,7 @@ "type": "UnifiedEvent[]", "description": "Filtered array of events" }, - "source": "BaseExchange.ts:1317" + "source": "BaseExchange.ts:1318" }, "watchOrderBook": { "summary": "Watch order book updates in real-time via WebSocket.", @@ -595,7 +595,7 @@ "type": "OrderBook", "description": "Promise that resolves with the current orderbook state" }, - "source": "BaseExchange.ts:1413" + "source": "BaseExchange.ts:1414" }, "watchOrderBooks": { "summary": "Watch multiple order books simultaneously via WebSocket.", @@ -624,7 +624,7 @@ "type": "Record", "description": "Promise that resolves with order books keyed by ID" }, - "source": "BaseExchange.ts:1426" + "source": "BaseExchange.ts:1427" }, "unwatchOrderBook": { "summary": "Unsubscribe from a previously watched order book stream.", @@ -641,7 +641,7 @@ "type": "void", "description": "Result" }, - "source": "BaseExchange.ts:1454" + "source": "BaseExchange.ts:1455" }, "watchTrades": { "summary": "Watch trade executions in real-time via WebSocket.", @@ -676,7 +676,7 @@ "type": "Trade[]", "description": "Promise that resolves with recent trades" }, - "source": "BaseExchange.ts:1467" + "source": "BaseExchange.ts:1468" }, "watchAddress": { "summary": "Stream activity for a public wallet address", @@ -699,7 +699,7 @@ "type": "SubscribedAddressSnapshot", "description": "Promise that resolves with the latest SubscribedAddressSnapshot snapshot" }, - "source": "BaseExchange.ts:1481" + "source": "BaseExchange.ts:1482" }, "unwatchAddress": { "summary": "Stop watching a previously registered wallet address and release its resource updates.", @@ -716,7 +716,7 @@ "type": "void", "description": "Result" }, - "source": "BaseExchange.ts:1494" + "source": "BaseExchange.ts:1495" }, "close": { "summary": "Close all WebSocket connections and clean up resources.", @@ -726,7 +726,7 @@ "type": "void", "description": "Result" }, - "source": "BaseExchange.ts:1503" + "source": "BaseExchange.ts:1504" }, "fetchMarketMatches": { "summary": "Find the same or related market on other venues. Two modes:", @@ -743,7 +743,7 @@ "type": "MatchResult[]", "description": "Array of matched markets with relation and confidence" }, - "source": "BaseExchange.ts:1517" + "source": "BaseExchange.ts:1518" }, "fetchMatches": { "summary": "fetchMatches", @@ -760,7 +760,7 @@ "type": "MatchResult[]", "description": "Result" }, - "source": "BaseExchange.ts:1533" + "source": "BaseExchange.ts:1534" }, "fetchEventMatches": { "summary": "Find the same or related event on other venues. Two modes:", @@ -777,7 +777,7 @@ "type": "EventMatchResult[]", "description": "Array of matched events with market-level match details" }, - "source": "BaseExchange.ts:1541" + "source": "BaseExchange.ts:1542" }, "compareMarketPrices": { "summary": "Compare live prices for the same market across venues. Finds identity matches and returns side-by-side best bid/ask prices so you can spot price differences at a glance.", @@ -794,7 +794,7 @@ "type": "PriceComparison[]", "description": "Array of price comparisons across venues" }, - "source": "BaseExchange.ts:1557" + "source": "BaseExchange.ts:1558" }, "fetchRelatedMarkets": { "summary": "Find related markets across venues. Discovers subset/superset market relationships", @@ -811,7 +811,7 @@ "type": "PriceComparison[]", "description": "Array of subset/superset matches with live prices" }, - "source": "BaseExchange.ts:1567" + "source": "BaseExchange.ts:1568" }, "fetchMatchedMarkets": { "summary": "fetchMatchedMarkets", @@ -828,7 +828,7 @@ "type": "MatchedMarketPair[]", "description": "Result" }, - "source": "BaseExchange.ts:1578" + "source": "BaseExchange.ts:1579" }, "fetchMatchedPrices": { "summary": "fetchMatchedPrices", @@ -845,7 +845,7 @@ "type": "MatchedPricePair[]", "description": "Array of matched market pairs with prices from each venue" }, - "source": "BaseExchange.ts:1586" + "source": "BaseExchange.ts:1587" }, "fetchHedges": { "summary": "fetchHedges", @@ -862,7 +862,7 @@ "type": "PriceComparison[]", "description": "Array of subset/superset matches with live prices" }, - "source": "BaseExchange.ts:1597" + "source": "BaseExchange.ts:1598" }, "fetchArbitrage": { "summary": "fetchArbitrage", @@ -879,7 +879,7 @@ "type": "ArbitrageOpportunity[]", "description": "Array of arbitrage opportunities sorted by spread" }, - "source": "BaseExchange.ts:1607" + "source": "BaseExchange.ts:1608" }, "watchPrices": { "summary": "Watch AMM price updates for a market address (Limitless only).", diff --git a/core/scripts/generate-python-exchanges.js b/core/scripts/generate-python-exchanges.js index c20458a4..ee0739d9 100644 --- a/core/scripts/generate-python-exchanges.js +++ b/core/scripts/generate-python-exchanges.js @@ -167,7 +167,7 @@ function generateClass(exchange) { } if (creds.signatureType) { const defaultVal = defaults['signature_type'] || 'None'; - constructorParams.push(`signature_type: Optional[Any] = ${defaultVal}`); + constructorParams.push(`signature_type: Optional[str] = ${defaultVal}`); superArgs.push('signature_type=signature_type'); } constructorParams.push('base_url: Optional[str] = None'); @@ -204,7 +204,7 @@ function generateClass(exchange) { indent4('def __init__('), indent8('self,'), ...constructorParams.map(p => indent8(`${p},`)), - indent4('):'), + indent4(') -> None:'), indent8('"""'), indent8(`Initialize ${className} client.`), '', diff --git a/sdks/python/API_REFERENCE.md b/sdks/python/API_REFERENCE.md index dac681ce..b20f3aa2 100644 --- a/sdks/python/API_REFERENCE.md +++ b/sdks/python/API_REFERENCE.md @@ -1456,7 +1456,7 @@ title: str # The market title (e.g., "Will BTC close above $100k on Dec 31?"). description: str # Long-form market description or resolution criteria. slug: str # URL-friendly slug for the market. outcomes: List[MarketOutcome] # The possible outcomes for this market. -resolution_date: str # When the market is scheduled to resolve. +resolution_date: str # When the market is scheduled to resolve. Optional because some venues do not publish a cutoff for every market (e.g. Opinion categorical children) — emit `undefined` rather than coercing to epoch. volume24h: float # Trading volume over the past 24 hours (USD). volume: float # Total / Lifetime volume liquidity: float # Current market liquidity (USD). diff --git a/sdks/python/pmxt/__init__.py b/sdks/python/pmxt/__init__.py index 171a6ca8..8382be5f 100644 --- a/sdks/python/pmxt/__init__.py +++ b/sdks/python/pmxt/__init__.py @@ -100,7 +100,7 @@ class _ServerNamespace: __slots__ = ("_manager",) - def __init__(self, manager: ServerManager): + def __init__(self, manager: ServerManager) -> None: self._manager = manager def status(self) -> Dict[str, Any]: diff --git a/sdks/python/pmxt/_exchanges.py b/sdks/python/pmxt/_exchanges.py index 5368bc6f..ac27bf3c 100644 --- a/sdks/python/pmxt/_exchanges.py +++ b/sdks/python/pmxt/_exchanges.py @@ -17,11 +17,11 @@ def __init__( passphrase: Optional[str] = None, private_key: Optional[str] = None, proxy_address: Optional[str] = None, - signature_type: Optional[Any] = "gnosis-safe", + signature_type: Optional[str] = "gnosis-safe", base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Polymarket client. @@ -76,7 +76,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Limitless client. @@ -120,7 +120,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Kalshi client. @@ -151,7 +151,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize KalshiDemo client. @@ -184,7 +184,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Probable client. @@ -227,7 +227,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Baozi client. @@ -256,7 +256,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Myriad client. @@ -288,7 +288,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Opinion client. @@ -320,7 +320,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Metaculus client. @@ -349,7 +349,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Smarkets client. @@ -380,7 +380,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize PolymarketUS client. @@ -411,7 +411,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Hyperliquid client. @@ -442,7 +442,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize GeminiTitan client. @@ -478,7 +478,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize SuiBets client. @@ -503,7 +503,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Mock client. @@ -528,7 +528,7 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize Router client. diff --git a/sdks/python/pmxt/client.py b/sdks/python/pmxt/client.py index 741a8d92..3b89b83c 100644 --- a/sdks/python/pmxt/client.py +++ b/sdks/python/pmxt/client.py @@ -13,7 +13,7 @@ import uuid from abc import ABC from datetime import datetime -from typing import Callable, List, Optional, Dict, Any, Literal, Union +from typing import Callable, List, Optional, Dict, Any, Literal, Union, Type # Add generated client to path _GENERATED_PATH = os.path.join(os.path.dirname(__file__), "..", "generated") @@ -88,7 +88,7 @@ def _convert_params_to_camel(params: Dict[str, Any]) -> Dict[str, Any]: return {_snake_to_camel(k): v for k, v in params.items()} -def _auto_convert(cls, raw: Dict[str, Any], **overrides): +def _auto_convert(cls: Type[Any], raw: Dict[str, Any], **overrides: Any) -> Any: """Auto-map camelCase raw dict to snake_case dataclass fields. Iterates over the dataclass fields, looks up the camelCase key in ``raw``, @@ -292,9 +292,9 @@ def __init__( base_url: Optional[str] = None, auto_start_server: Optional[bool] = None, proxy_address: Optional[str] = None, - signature_type: Optional[Any] = None, + signature_type: Optional[str] = None, pmxt_api_key: Optional[str] = None, - ): + ) -> None: """ Initialize an exchange client. @@ -1798,7 +1798,7 @@ def _watch_via_ws( def _ws_required_error(self, method_name: str) -> PmxtError: return PmxtError(f"{method_name}() requires WebSocket transport — connection failed") - def _require_ws_transport(self, method_name: str): + def _require_ws_transport(self, method_name: str) -> "SidecarWsClient": ws = self._get_or_create_ws() if ws is None: raise self._ws_required_error(method_name) @@ -2021,7 +2021,7 @@ def watch_all_order_books( raise PmxtError("watch_all_order_books() requires hosted mode (set pmxt_api_key)") effective_venues = venues if venues is not None else self._default_watch_all_order_book_venues() - args: list = [effective_venues] if effective_venues else [] + args: List[Any] = [effective_venues] if effective_venues else [] data = self._watch_via_ws("watchAllOrderBooks", args) if data is not None: return FirehoseEvent( @@ -2114,11 +2114,11 @@ def watch_address( ... print(f"Trade: {snapshot.trades}") """ try: - args: list = [address] + args: List[Any] = [address] if types is not None: args.append(types) - body: dict = {"args": args} + body: Dict[str, Any] = {"args": args} creds = self._get_credentials_dict() if creds: body["credentials"] = creds @@ -2155,7 +2155,7 @@ def unwatch_address( None """ try: - body: dict = {"args": [address]} + body: Dict[str, Any] = {"args": [address]} creds = self._get_credentials_dict() if creds: body["credentials"] = creds diff --git a/sdks/python/pmxt/errors.py b/sdks/python/pmxt/errors.py index 16d999c2..59f08869 100644 --- a/sdks/python/pmxt/errors.py +++ b/sdks/python/pmxt/errors.py @@ -13,7 +13,7 @@ class PmxtError(Exception): """Base error class for all pmxt errors.""" - def __init__(self, message: str, code: str = "UNKNOWN_ERROR", retryable: bool = False, exchange: str | None = None): + def __init__(self, message: str, code: str = "UNKNOWN_ERROR", retryable: bool = False, exchange: str | None = None) -> None: super().__init__(message) self.message = message self.code = code @@ -67,7 +67,7 @@ class EventNotFound(NotFoundError): class RateLimitExceeded(PmxtError): """429 Too Many Requests - Rate limit exceeded.""" - def __init__(self, message: str, retry_after: int | None = None, **kwargs): + def __init__(self, message: str, retry_after: int | None = None, **kwargs) -> None: super().__init__(message, **kwargs) self.retry_after = retry_after @@ -85,7 +85,7 @@ class InsufficientFunds(PmxtError): class ValidationError(PmxtError): """400 Bad Request - Input validation failed.""" - def __init__(self, message: str, field: str | None = None, **kwargs): + def __init__(self, message: str, field: str | None = None, **kwargs) -> None: super().__init__(message, **kwargs) self.field = field diff --git a/sdks/python/pmxt/router.py b/sdks/python/pmxt/router.py index da2cc666..edd735e1 100644 --- a/sdks/python/pmxt/router.py +++ b/sdks/python/pmxt/router.py @@ -25,7 +25,7 @@ from pmxt_internal.exceptions import ApiException -def _parse_market(raw: Any) -> UnifiedMarket: +def _parse_market(raw: Any) -> Any: """Best-effort parse of a raw market dict into UnifiedMarket.""" if isinstance(raw, UnifiedMarket): return raw @@ -34,7 +34,7 @@ def _parse_market(raw: Any) -> UnifiedMarket: return raw -def _parse_event(raw: Any) -> UnifiedEvent: +def _parse_event(raw: Any) -> Any: """Best-effort parse of a raw event dict into UnifiedEvent.""" if isinstance(raw, UnifiedEvent): return raw @@ -124,7 +124,7 @@ def __init__( pmxt_api_key: Optional[str] = None, base_url: Optional[str] = None, auto_start_server: bool = False, - ): + ) -> None: """ Initialize the Router. @@ -303,7 +303,7 @@ def fetch_event_matches( results.append(EventMatchResult(event=event, market_matches=market_matches)) return results - def _get_catalog_path(self, path: str, params: Dict[str, Any]) -> Any: + def _get_catalog_path(self, path: str, params: Dict[str, Any]) -> Dict[str, Any]: """GET a hosted catalog /v0 path and return its raw JSON body.""" qs = self._build_sidecar_query_string(params) url = f"{self._resolve_sidecar_host()}{path}{'?' + qs if qs else ''}" diff --git a/sdks/python/pmxt/server_manager.py b/sdks/python/pmxt/server_manager.py index 008939be..9613652d 100644 --- a/sdks/python/pmxt/server_manager.py +++ b/sdks/python/pmxt/server_manager.py @@ -53,7 +53,7 @@ class ServerManager: # must share the same critical section. _ensure_lock = threading.Lock() - def __init__(self, base_url: str = "http://localhost:3847"): + def __init__(self, base_url: str = "http://localhost:3847") -> None: """ Initialize the server manager. diff --git a/sdks/python/pmxt/ws_client.py b/sdks/python/pmxt/ws_client.py index 329dd680..808aef27 100644 --- a/sdks/python/pmxt/ws_client.py +++ b/sdks/python/pmxt/ws_client.py @@ -50,7 +50,7 @@ class _WsSubscription: __slots__ = ("request_id", "method", "symbols", "event") - def __init__(self, request_id: str, method: str, symbols: List[str]): + def __init__(self, request_id: str, method: str, symbols: List[str]) -> None: self.request_id = request_id self.method = method self.symbols = symbols @@ -66,7 +66,7 @@ class SidecarWsClient: may invoke subscribe/receive from any thread. """ - def __init__(self, host: str, access_token: Optional[str] = None, api_key: Optional[str] = None): + def __init__(self, host: str, access_token: Optional[str] = None, api_key: Optional[str] = None) -> None: self._host = host self._access_token = access_token self._api_key = api_key diff --git a/sdks/typescript/API_REFERENCE.md b/sdks/typescript/API_REFERENCE.md index f8504e0a..ec2f3280 100644 --- a/sdks/typescript/API_REFERENCE.md +++ b/sdks/typescript/API_REFERENCE.md @@ -1456,7 +1456,7 @@ title: string; // The market title (e.g., "Will BTC close above $100k on Dec 31? description: string; // Long-form market description or resolution criteria. slug: string; // URL-friendly slug for the market. outcomes: MarketOutcome[]; // The possible outcomes for this market. -resolutionDate: string; // When the market is scheduled to resolve. +resolutionDate: string; // When the market is scheduled to resolve. Optional because some venues do not publish a cutoff for every market (e.g. Opinion categorical children) — emit `undefined` rather than coercing to epoch. volume24h: number; // Trading volume over the past 24 hours (USD). volume: number; // Total / Lifetime volume liquidity: number; // Current market liquidity (USD).