Skip to content

v0.12.0

Choose a tag to compare

@github-actions github-actions released this 03 Dec 17:59
· 2 commits to main since this release
v0.12.0
6b63817

Added

  • Follow Kalshi's latest published contracts (OpenAPI still labelled 3.39.0, AsyncAPI 2.0.0):
    • KalshiClient::get_dlp_programs() (GET /dlp_programs), with GetDlpProgramsResponse,
      DlpBiddingProgram, and DlpIncentivizedProgram. Kalshi's production and demo servers
      still answered 404 for this path when this release was cut.
    • Exact fixed-point dollar amounts beside the deprecated whole-cent ones:
      GetBalanceResponse::portfolio_value_dollars, Settlement::revenue_dollars, and
      GetPortfolioRestingOrderTotalValueResponse::total_resting_order_value_dollars.
    • ws::MilestoneUpdated (milestone_updated) on ws::Channel::MarketLifecycleV2, carrying
      the complete milestone as RawJson.

Changed

  • AmendOrderV2Request::price is now std::optional. Leave it unset for an expiry-only
    amendment, which keeps the resting price and queue position.
  • A blank line in a spec description now ends a doc comment's first sentence, so two paragraphs
    no longer run together (ws::Ticker::volume_fp and three other members).

Fixed

  • A WebSocket data frame whose msg holds nothing but an enum value this SDK does not know
    (or, for an enum without an empty-string value, "") is now rejected as malformed instead
    of delivered as an all-default update. This covers plain and optional enum members
    (#173,
    #177).
  • WebSocketClient::subscribe() accepts ws::UserFilter::Unset, the spec's "" default; it
    used to reject it as unknown.
  • An ok reply carrying the id of a pending subscribe or unsubscribe no longer consumes that
    command, which left the subscription stuck in Pending or Unsubscribing.
  • Reconnecting an ebattle_scores subscription no longer delivers a ws::Updated for the match
    IDs it restores, matching how markets restored by a resubscribe behave.
  • Reading a bare JSON enum string without a null terminator, where the closing quote ends the
    buffer, now yields its value and rejects invalid escapes. It used to leave the value Unknown
    and accept invalid input. Every current caller reads enums inside an object, so no shipped
    parse was affected.
  • create_flight_disruption_market() now rejects a delayed or either request without
    delay_basis, and a cancelled one with it, before sending; Kalshi answers both with
    invalid_parameters. Only delay_minutes was checked before.
  • example_stream_orderbook now rebuilds its books after a sequence gap or an unparsable frame.
    It matched error text the SDK never sends, so a gap left stale books in place.
  • A FetchContent build now defines the per-layer targets the installed package exports
    (kalshi::kalshi_core, _auth, _http, _models, _ws, and _api).
  • The API reference no longer shows the build machine's path in Markdown page titles.
  • A WebSocketClient destroyed inside its own callback no longer leaves its finished network
    thread unjoined until another client is destroyed elsewhere or the process exits. Apps that
    replace their client from a callback no longer accumulate thread stacks.
  • WebSocketClient::connect() now returns ErrorCode::InvalidRequest unless the host in
    WsConfig::url is a DNS name, an IPv4 address, or a bracketed IPv6 address. libwebsockets
    reads a host that starts with + as a UNIX socket path, so ws://+name/ws connected to a
    local socket. IPv6 zone IDs such as [fe80::1%eth0] are no longer accepted.
  • The WebSocket handshake's Host header now matches the URL: it includes a port other than
    the scheme's default and puts an IPv6 address in brackets. It used to carry the bare host.

Security

  • WebSocketClient::connect() now returns ErrorCode::InvalidRequest for a wss:// URL whose
    host is an IPv6 address. With libwebsockets older than 5.1, the client accepted any
    certificate from a trusted authority for such a URL, whatever host it named. DNS names and
    IPv4 addresses were always checked.