From ccc5a0b5eda89afb6dd245f6427cd37047a8c191 Mon Sep 17 00:00:00 2001 From: SebastianBoehler <27767932+SebastianBoehler@users.noreply.github.com> Date: Sun, 21 Jun 2026 23:10:59 +0200 Subject: [PATCH 1/2] fix(order): serialize FAK order type --- CMakeLists.txt | 6 +++- README.md | 6 ++-- include/clob_client.hpp | 2 +- include/polymarket/version.hpp | 6 ++-- src/clob_client.cpp | 2 +- tests/test_order_type_serialization.cpp | 48 +++++++++++++++++++++++++ 6 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 tests/test_order_type_serialization.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 1112eec..bf2cfd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.16) # Policy for older CMake compatibility in dependencies set(CMAKE_POLICY_VERSION_MINIMUM 3.5) -project(polymarket_cpp_client VERSION 1.2.5 LANGUAGES CXX C) +project(polymarket_cpp_client VERSION 1.3.0 LANGUAGES CXX C) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -179,6 +179,10 @@ if(POLYMARKET_CLIENT_BUILD_TESTS) target_link_libraries(test_order_execution PRIVATE polymarket::client) add_test(NAME test_order_execution COMMAND test_order_execution) + add_executable(test_order_type_serialization tests/test_order_type_serialization.cpp) + target_link_libraries(test_order_type_serialization PRIVATE polymarket::client) + add_test(NAME test_order_type_serialization COMMAND test_order_type_serialization) + add_executable(test_sdk_error tests/test_sdk_error.cpp) target_link_libraries(test_sdk_error PRIVATE polymarket::client) add_test(NAME test_sdk_error COMMAND test_sdk_error) diff --git a/README.md b/README.md index f59f3c9..f29c31a 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ include(FetchContent) FetchContent_Declare( polymarket_client GIT_REPOSITORY https://github.com/SebastianBoehler/polymarket-cpp-client.git - GIT_TAG v1.2.5 # or any release tag + GIT_TAG v1.3.0 # or any release tag ) FetchContent_MakeAvailable(polymarket_client) @@ -53,11 +53,11 @@ Download pre-built binaries from [Releases](https://github.com/SebastianBoehler/ ```bash # macOS -curl -LO https://github.com/SebastianBoehler/polymarket-cpp-client/releases/download/v1.2.5/polymarket-cpp-client-macos-arm64.tar.gz +curl -LO https://github.com/SebastianBoehler/polymarket-cpp-client/releases/download/v1.3.0/polymarket-cpp-client-macos-arm64.tar.gz tar -xzf polymarket-cpp-client-macos-arm64.tar.gz -C /usr/local # Linux -curl -LO https://github.com/SebastianBoehler/polymarket-cpp-client/releases/download/v1.2.5/polymarket-cpp-client-linux-x64.tar.gz +curl -LO https://github.com/SebastianBoehler/polymarket-cpp-client/releases/download/v1.3.0/polymarket-cpp-client-linux-x64.tar.gz tar -xzf polymarket-cpp-client-linux-x64.tar.gz -C /usr/local ``` diff --git a/include/clob_client.hpp b/include/clob_client.hpp index 954f159..5035aa0 100644 --- a/include/clob_client.hpp +++ b/include/clob_client.hpp @@ -19,7 +19,7 @@ namespace polymarket GTC, // Good-Til-Cancelled GTD, // Good-Til-Date FOK, // Fill-Or-Kill - FAK // Fill-And-Kill (IOC) + FAK // Fill-And-Kill }; // Order response from API diff --git a/include/polymarket/version.hpp b/include/polymarket/version.hpp index cd4ec64..a947fe5 100644 --- a/include/polymarket/version.hpp +++ b/include/polymarket/version.hpp @@ -1,9 +1,9 @@ #pragma once #define POLYMARKET_CLIENT_VERSION_MAJOR 1 -#define POLYMARKET_CLIENT_VERSION_MINOR 2 -#define POLYMARKET_CLIENT_VERSION_PATCH 5 -#define POLYMARKET_CLIENT_VERSION "1.2.5" +#define POLYMARKET_CLIENT_VERSION_MINOR 3 +#define POLYMARKET_CLIENT_VERSION_PATCH 0 +#define POLYMARKET_CLIENT_VERSION "1.3.0" namespace polymarket { diff --git a/src/clob_client.cpp b/src/clob_client.cpp index 8d07efc..2f0d4d2 100644 --- a/src/clob_client.cpp +++ b/src/clob_client.cpp @@ -130,7 +130,7 @@ namespace polymarket case OrderType::FOK: return "FOK"; case OrderType::FAK: - return "IOC"; + return "FAK"; default: return "GTC"; } diff --git a/tests/test_order_type_serialization.cpp b/tests/test_order_type_serialization.cpp new file mode 100644 index 0000000..ca9881b --- /dev/null +++ b/tests/test_order_type_serialization.cpp @@ -0,0 +1,48 @@ +#include "http_client.hpp" +#include "order_signer.hpp" +#include "sdk_error.hpp" +#include "types.hpp" + +#include +#include +#include +#include +#include +#include + +#define private public +#include "clob_client.hpp" +#undef private + +using namespace polymarket; + +namespace +{ + bool expect_equal(const std::string &name, const std::string &actual, const std::string &expected) + { + if (actual == expected) + { + return true; + } + + std::cerr << name << " mismatch\n" + << " expected: " << expected << "\n" + << " actual: " << actual << "\n"; + return false; + } +} + +int main() +{ + ClobClient client("https://clob.polymarket.com"); + + if (!expect_equal("GTC order type", client.order_type_to_string(OrderType::GTC), "GTC") || + !expect_equal("GTD order type", client.order_type_to_string(OrderType::GTD), "GTD") || + !expect_equal("FOK order type", client.order_type_to_string(OrderType::FOK), "FOK") || + !expect_equal("FAK order type", client.order_type_to_string(OrderType::FAK), "FAK")) + { + return 1; + } + + return 0; +} From 37048a033140b8bd4f38acd1f4c8aa9a6a267e3d Mon Sep 17 00:00:00 2001 From: SebastianBoehler <27767932+SebastianBoehler@users.noreply.github.com> Date: Sun, 21 Jun 2026 23:14:26 +0200 Subject: [PATCH 2/2] test: skip blocked public RPC responses --- tests/test_oracle_watcher_historical.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_oracle_watcher_historical.cpp b/tests/test_oracle_watcher_historical.cpp index 52aeb03..69912bb 100644 --- a/tests/test_oracle_watcher_historical.cpp +++ b/tests/test_oracle_watcher_historical.cpp @@ -69,6 +69,7 @@ bool is_transient_rpc_error(const std::string &message) "Operation timed out", "request timed out", "timed out", + "status=403", }; for (const auto *pattern : patterns) {