Skip to content

v0.9.0

Choose a tag to compare

@github-actions github-actions released this 20 Nov 21:38
· 52 commits to main since this release
v0.9.0
a1ccc79

Added

  • Follow Predictions OpenAPI 3.37.0: cancel and reject block-trade proposals, on-request weather
    point, concert cancellation, and flight disruption markets, and incentive schedules.
  • Support the ebattle_scores WebSocket channel with subscribe_matches, unsubscribe_matches,
    and matchlist. Matches are added again after each reconnect, since a subscribe carries none.
  • Add RateLimitConfig::transfer for intra-account transfers, which Kalshi meters in their own
    bucket of 600 tokens per minute.
  • Add the KALSHI_INSTALL CMake option, on by default only for a top-level build.
  • Add ARCHITECTURE.md, an
    overview of the layers, request flow, and WebSocket lifecycle.

Changed

  • Remove Market::expiration_time, which the upstream contract no longer lists.
  • Name the subscription with sid in update_subscription commands. Every command variant
    accepts it, and eBattle updates require it.
  • Reject market changes to a ticker subscription sent without markets, which Kalshi answers
    with error 13 while it keeps streaming every market.
  • A FetchContent consumer's install no longer installs kalshi-cpp. Set KALSHI_INSTALL=ON to
    keep the old behavior.
  • Build the static libraries as position-independent code unless
    CMAKE_POSITION_INDEPENDENT_CODE is set, so they can link into shared libraries.
  • WebSocketClient::connect() rejects a non-positive ping_interval and an idle_timeout no
    longer than it, which would drop healthy connections.
  • Signer::from_pem accepts RSA-PSS keys (#90) and signs a test message while loading.
    A key that cannot produce Kalshi's signature now fails there with InvalidKey instead of on
    every request: an RSA-PSS key restricted to another digest, another MGF1 digest, or a longer
    salt, or an RSA key shorter than 522 bits.
  • Signer::from_pem_file rejects key files larger than 1 MiB.
  • HttpClient::request returns InvalidRequest when ClientConfig::base_url names no host or
    contains a query string or a fragment, or when timeout or connect_timeout is zero or
    negative.
  • WebSocket subscribed, unsubscribed, and error messages that lack a field Kalshi's
    contract requires, and those and ok messages that carry a subscription ID below 1, are
    reported through on_error and otherwise ignored. Only an ok that answers
    list_subscriptions has its contents checked.
  • An HTTP response larger than max_response_bytes returns ParseError instead of
    InvalidRequest. The request was sent by then and may have taken effect, which
    InvalidRequest denied.
  • Glaze, GoogleTest, and Google Benchmark are downloaded as release archives pinned by
    SHA-256 instead of by git tag, so a moved tag fails the build instead of changing it.

Fixed

  • Reject market_id and market_ids outside the ticker channel. An orderbook subscribed by ID
    received no snapshots and could not recover from a gap
    (#85).
  • Retry HTTP 408 responses like network errors: reads by default, writes only with
    retry_writes (#86).
  • Keep public enum names stable when the upstream contract reorders its schemas.
  • Charge exit triggers, target balance allocation, API usage upgrades, block-trade accepts, and
    weather point and concert market creation to the Write bucket, and block-trade proposals,
    rejections, and cancels to Read, matching Kalshi's assignments.
  • Fail calls on a moved-from KalshiClient with NetworkError, and scaled_integer on a
    moved-from FixedPoint with InvalidRequest, instead of crashing.
  • Bound the parallel jobs in tools/test_consumers.sh by JOBS.
  • Report sequence gaps that an orderbook snapshot or an ok or error frame reveals; they
    share the subscription's sequence.
  • Complete get_snapshot and other commands whose reply is a data message, so they no longer
    accumulate on a long-lived connection.
  • Treat error 7 on an unsubscribe as the end of the subscription, and deliver Unsubscribed
    for unsubscribes still pending when the connection drops.
  • Return InvalidKey from Signer::from_pem_file instead of throwing when a key file opens
    but cannot be read, such as a directory (#89).
  • Wipe key file contents from memory before freeing it, and stop reading endless files such
    as /dev/zero.
  • Keep a base URL's query string or fragment out of the signed request path (#84).
  • Stop a zero or negative HTTP timeout from disabling the timeout and letting requests hang
    (#87).
  • Stop a subscribed message without a subscription ID from confirming a subscription as
    ID 0 or sending an unsubscribe for ID 0 (#88).
  • Report a malformed list_subscriptions reply as an error instead of an empty list.
  • Reject . and .. as path parameters such as a market ticker. They reached a different
    route than the one requested, which could answer with another resource's data.
  • Trust only OpenSSL's default verify paths for WebSocket TLS, which SSL_CERT_FILE and
    SSL_CERT_DIR override, plus the system's root certificates on Windows. libwebsockets also
    trusted a ../share directory relative to the working directory.
  • Report and retry a reconnect attempt whose handshake cannot be signed, instead of staying
    in Reconnecting for good.
  • Publish a release only after CI passes on the tagged commit itself. A pull request's run no
    longer counts, and a cancelled run is started again.