kalshi-cpp 0.6.2
C++23 client for Kalshi's Predictions API
Loading...
Searching...
No Matches
environment.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string_view>
5
6namespace kalshi {
7
10enum class Environment : std::uint8_t { Production, Demo };
11
13[[nodiscard]] constexpr std::string_view rest_base_url(Environment environment) noexcept {
14 return environment == Environment::Demo ? "https://external-api.demo.kalshi.co/trade-api/v2"
15 : "https://external-api.kalshi.com/trade-api/v2";
16}
17
19[[nodiscard]] constexpr std::string_view websocket_url(Environment environment) noexcept {
20 return environment == Environment::Demo ? "wss://external-api-ws.demo.kalshi.co/trade-api/ws/v2"
21 : "wss://external-api-ws.kalshi.com/trade-api/ws/v2";
22}
23
24} // namespace kalshi
Definition api.hpp:15
Environment
Kalshi deployment.
Definition environment.hpp:10
constexpr std::string_view rest_base_url(Environment environment) noexcept
REST base URL, including the /trade-api/v2 prefix that requests sign.
Definition environment.hpp:13
constexpr std::string_view websocket_url(Environment environment) noexcept
WebSocket URL for streaming market and account data.
Definition environment.hpp:19