You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
orders.create type overload still permits omitting required action/count #350
v2.5 removed the silent 1-contract / action="buy" defaults at runtime (a TypeError now fires when any of ticker / side / count / action is missing). The public overload still advertises action and count as optional kwargs (None = ...), so a strict type-checking user can write client.orders.create(ticker="T", side="yes", yes_price="0.50") and mypy accepts it — the call then raises TypeError before any HTTP request is made.
Not a wire-corruption bug anymore, but it leaves the SDK's static contract inconsistent precisely on the money-risk branch v2.5 was meant to harden.
Evidence
kalshi/resources/orders.py:330-345 — overload still optional:
Change the kwarg-form overload (sync OrdersResource.create and async AsyncOrdersResource.create) so action: ActionLiteral and count: int are required (no None, no default):
Keep the implementation signature's None defaults for overload dispatch and runtime error quality. Add a mypy-level regression test (e.g. via tests/test_type_overloads.py if present, or a # type: ignore[call-overload] assertion in a typed test fixture) confirming the trimmed overload rejects the missing-arg shape.
Activity
fix(models): AmendOrderRequest Literal narrowing + V1 ge=0 + create()…