diff --git a/kalshi/models/orders.py b/kalshi/models/orders.py index 3f621b94..cf45b26a 100644 --- a/kalshi/models/orders.py +++ b/kalshi/models/orders.py @@ -367,8 +367,8 @@ class BatchCreateOrdersResponseEntry(BaseModel): class BatchCreateOrdersResponse(BaseModel): """Response from ``POST /portfolio/orders/batched``. - Spec ``components.schemas.BatchCreateOrdersResponse``. v3.0.0 - BREAKING: previously the SDK returned ``list[Order]`` and crashed + Spec ``components.schemas.BatchCreateOrdersResponse``. Changed in v2.4.0 + (breaking): previously the SDK returned ``list[Order]`` and crashed with ``ValidationError`` on the first failed leg (``Order.model_validate(None)``). Now returns the typed envelope so callers can inspect per-leg ``order``/``error``/``client_order_id``. @@ -402,8 +402,8 @@ class BatchCancelOrdersResponseEntry(BaseModel): class BatchCancelOrdersResponse(BaseModel): """Response from ``DELETE /portfolio/orders/batched``. - Spec ``components.schemas.BatchCancelOrdersResponse``. v3.0.0 - BREAKING: previously the SDK declared ``-> None`` and discarded the + Spec ``components.schemas.BatchCancelOrdersResponse``. Changed in v2.4.0 + (breaking): previously the SDK declared ``-> None`` and discarded the response body. Per-leg ``reduced_by_fp`` and any per-leg errors are now surfaced. """ diff --git a/kalshi/resources/orders.py b/kalshi/resources/orders.py index 11b25df4..fa10b11d 100644 --- a/kalshi/resources/orders.py +++ b/kalshi/resources/orders.py @@ -473,7 +473,7 @@ def batch_create( ) -> BatchCreateOrdersResponse: """Place a batch of orders. - BREAKING in v3.0.0: previously returned ``list[Order]`` and would + Changed in v2.4.0 (breaking): previously returned ``list[Order]`` and would crash with ``ValidationError`` on any partially-failed batch (the spec marks each entry's ``order`` and ``error`` as nullable; the old ``Order.model_validate(o.get("order", o))`` blew up the @@ -511,7 +511,7 @@ def batch_cancel( mix of both. String entries are wrapped as ``BatchCancelOrdersRequestOrder(order_id=)`` before serialization. - BREAKING in v3.0.0: previously returned ``None`` and discarded + Changed in v2.4.0 (breaking): previously returned ``None`` and discarded the server's per-leg response. Now returns :class:`BatchCancelOrdersResponse` so callers can read the load-bearing ``reduced_by_fp`` per entry (cents canceled) plus