Skip to content

fix(spec): FCM position transfers, ApiKey.key_type, managed_isolated (#574) — 22.10.0 - #576

Merged
TexasCoding merged 3 commits into
mainfrom
fix/574-spec-drift
Nov 9, 2026
Merged

TexasCoding merged 3 commits into
mainfrom
fix/574-spec-drift

Conversation

@TexasCoding

@TexasCoding TexasCoding commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Closes #574

Reconciles spec drift from the 2026-11-09 Weekly Spec Sync (core OpenAPI 3.36.0 content change, perps OpenAPI, perps AsyncAPI). Spec hashes verified against the issue. kalshi/_generated/ regenerated (no diff). Release 22.10.0 (minor — additive optional only).

Changes

  • Core: ApiKey.key_type optional (ApiKeyTypeLiteral | None).
  • Perps: SubaccountTypeLiteral gains "managed_isolated".
  • Perps: new perps.fcm.transfer_position(...) sync/async → POST /margin/fcm/positions/transfers (201 CreateMarginFCMPositionTransferResponse). Request model CreateMarginFCMPositionTransferRequest with extra="forbid", dumped with exclude_none=True, by_alias=True, mode="json". Never retried (POST). Registered in PERPS_METHOD_ENDPOINT_MAP, PERPS_BODY_MODEL_MAP, and PERPS_CONTRACT_MAP.
  • Description-only spec changes (positions/settlement docs, block-trade accept rebooking, MCP OAuth read scopes, perps market_lifecycle_v2.is_deactivated) reflected in docs/docstrings.
  • Version bump 22.9.0 → 22.10.0 (pyproject.toml, kalshi/__init__.py, CHANGELOG.md).

Blast radius (hand-written; GitNexus unavailable)

  • ApiKey: one new optional field defaulting to None; existing parsing unaffected. Consumers: api_keys.list/create/generate responses only.
  • SubaccountTypeLiteral: widened Literal (superset) used by perps portfolio, margin_account, funding models — only effect is that responses carrying managed_isolated now validate instead of failing. Type checkers doing exhaustive matching on the Literal will see a new member (additive).
  • FcmResource / AsyncFcmResource: new method + private body builder only; existing methods untouched. New exports appended to kalshi.perps and kalshi.perps.models __all__.
  • Contract maps: three new entries; no existing entries changed.
  • No changes to transport, retry, auth, or WebSocket runtime code.

Gates (head a9d7492)

  • uv run ruff check . — pass
  • uv run mypy kalshi/ — pass (161 files)
  • uv run pytest tests/ --ignore=tests/integration -q — 5145 passed, 3 skipped
  • uv run pytest tests/test_contracts.py -W error::UserWarning — 935 passed

@TexasCoding
TexasCoding merged commit dc2cdcf into main Nov 9, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spec drift 2026-11-09: openapi 3.36.0 [content-changed] (paths 113→113, fp c2690d93)

1 participant