Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
[![CI](https://github.com/Reddimus/kalshi-cpp/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/Reddimus/kalshi-cpp/actions/workflows/ci.yml)
[![Release](https://img.shields.io/github/v/release/Reddimus/kalshi-cpp)](https://github.com/Reddimus/kalshi-cpp/releases)

An unofficial C++23 client for Kalshi's Predictions API. It covers every
A C++23 client for Kalshi's Predictions API. It covers every
[REST operation](docs/operations.md) and [WebSocket channel](docs/channels.md).
A generator builds it from Kalshi's OpenAPI and AsyncAPI documents in
[`spec/`](https://github.com/Reddimus/kalshi-cpp/tree/main/spec), so type and
field names match [Kalshi's API docs](https://docs.kalshi.com). Kalshi's
separate Margin and Perpetuals API is out of scope. The
Its types and methods come from Kalshi's OpenAPI and AsyncAPI documents in
[`spec/`](https://github.com/Reddimus/kalshi-cpp/tree/main/spec), so their names
match [Kalshi's API docs](https://docs.kalshi.com). Kalshi's separate Margin
and Perpetuals API is out of scope. The
[API reference](https://reddimus.github.io/kalshi-cpp/) lists every type and method.

## Install
Expand Down Expand Up @@ -172,6 +172,6 @@ shows.

## Contributing

[CONTRIBUTING.md](CONTRIBUTING.md) covers building from source, tests, code
generation, and releases. Report security issues as
[CONTRIBUTING.md](CONTRIBUTING.md) covers building from source, tests, updating
the specs, and releases. Report security issues as
[SECURITY.md](SECURITY.md) describes.
2 changes: 1 addition & 1 deletion docs/channels.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WebSocket channels

Generated from Kalshi's AsyncAPI 2.0.0 document (`spec/asyncapi.yaml`).
Covers Kalshi's AsyncAPI 2.0.0 document (`spec/asyncapi.yaml`).
Subscribe with `WebSocketClient::subscribe(ws::Channel::..., params)`; each message
arrives in `on_message` as `ws::Update<T>`.

Expand Down
2 changes: 1 addition & 1 deletion docs/operations.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# REST operations

Generated from Kalshi Predictions OpenAPI 3.31.0 (`spec/openapi.yaml`).
Covers Kalshi's Predictions OpenAPI 3.31.0 document (`spec/openapi.yaml`).
Each row is a `KalshiClient` method.

## account
Expand Down
8 changes: 4 additions & 4 deletions include/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

| Header | Contents |
| --- | --- |
| `kalshi/api.hpp` | `KalshiClient`, one method per REST operation (generated) |
| `kalshi/models.hpp` | Request, response, and enum types from the OpenAPI spec (generated) |
| `kalshi/api.hpp` | `KalshiClient`, one method per REST operation |
| `kalshi/models.hpp` | Request, response, and enum types from the OpenAPI spec |
| `kalshi/helpers.hpp` | Fixed-point to cents or contracts, timestamps, order directions |
| `kalshi/http_client.hpp` | Transport interface, libcurl client, `ClientConfig` |
| `kalshi/retry.hpp` | `RetryingTransport` and `RetryPolicy` |
| `kalshi/rate_limit.hpp` | `TokenBucket` and `RateLimitedTransport` |
| `kalshi/pagination.hpp` | `collect_pages` |
| `kalshi/signer.hpp` | API key loading and request signing |
| `kalshi/websocket.hpp` | `WebSocketClient`, `WsConfig`, and `WsError` |
| `kalshi/ws_models.hpp` | WebSocket channels and message types from the AsyncAPI spec (generated) |
| `kalshi/ws_models.hpp` | WebSocket channels and message types from the AsyncAPI spec |
| `kalshi/error.hpp` | `Error`, `ErrorCode`, and `Result<T>` |
| `kalshi/environment.hpp` | Production and demo URLs |
| `kalshi/fixed_point.hpp` | Exact decimal parsing |
| `kalshi/raw_json.hpp` | `RawJson`, free-form JSON kept as text |
| `kalshi/version.hpp` | `kalshi::VERSION` (generated at configure time) |
| `kalshi/version.hpp` | `kalshi::VERSION`, set at configure time |

Headers under `kalshi/detail/` support the implementation and tests. They are
not a stable interface.
2 changes: 1 addition & 1 deletion include/kalshi/version.hpp.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

/// @file version.hpp
/// @brief The SDK version, generated from `project(... VERSION)` in CMakeLists.txt.
/// @brief The SDK version, from `project(... VERSION)` in CMakeLists.txt.

namespace kalshi {

Expand Down
2 changes: 1 addition & 1 deletion tools/codegen/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def routes_test(self) -> str:
def operations_doc(self) -> str:
version = self.spec.get("info", {}).get("version", "?")
out = ["# REST operations\n\n",
f"Generated from Kalshi Predictions OpenAPI {version} (`spec/openapi.yaml`).\n",
f"Covers Kalshi's Predictions OpenAPI {version} document (`spec/openapi.yaml`).\n",
"Each row is a `KalshiClient` method.\n"]
for tag, ops in sorted(self.tags().items()):
out.append(f"\n## {tag}\n\n| Method | Route | C++ |\n| --- | --- | --- |\n")
Expand Down
2 changes: 1 addition & 1 deletion tools/codegen/ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def example_check(self, message: DataMessage, example: dict) -> str:
def channels_doc(self) -> str:
version = self.spec.get("info", {}).get("version", "?")
out = ["# WebSocket channels\n\n",
f"Generated from Kalshi's AsyncAPI {version} document (`spec/asyncapi.yaml`).\n",
f"Covers Kalshi's AsyncAPI {version} document (`spec/asyncapi.yaml`).\n",
"Subscribe with `WebSocketClient::subscribe(ws::Channel::..., params)`; each message\n"
"arrives in `on_message` as `ws::Update<T>`.\n\n",
"| Channel | `ws::Channel` | Messages |\n| --- | --- | --- |\n"]
Expand Down
Loading