kalshi-cpp 0.6.2
C++23 client for Kalshi's Predictions API
Loading...
Searching...
No Matches
helpers.hpp File Reference
#include "kalshi/error.hpp"
#include "kalshi/fixed_point.hpp"
#include "kalshi/models.hpp"
#include <chrono>
#include <cstdint>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  kalshi
 

Typedefs

using kalshi::Timestamp = std::chrono::sys_time< std::chrono::milliseconds >
 

Functions

Result< std::int64_t > kalshi::to_cents (std::string_view dollars)
 Converts a dollar string such as "0.5600" to whole cents.
 
Result< std::int64_t > kalshi::to_contracts (std::string_view count)
 Converts a fixed-point count such as "10.00" to whole contracts.
 
Result< Timestamp > kalshi::parse_timestamp (std::string_view text)
 Parses the RFC 3339 timestamps Kalshi returns, such as "2026-09-25T14:00:00.123Z" or "2026-09-25T10:00:00-04:00".
 
constexpr OutcomeSide kalshi::outcome_side (Side side, Action action) noexcept
 The outcome a (side, action) pair is exposed to: buying yes or selling no is yes exposure.
 
constexpr BookSide kalshi::book_side (Side side, Action action) noexcept
 The single-book side for a (side, action) pair: yes exposure bids.