Commit Graph

5 Commits

Author SHA1 Message Date
direkturcrypto e9e5d66ac9 fix: patch CLOB client JSON.stringify to handle circular proxy agent
The CLOB client errorHandling function does JSON.stringify on
err.response.config which includes httpsAgent (HttpsProxyAgent with
circular references). Inject a safe serializer that strips agent
properties before serializing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 12:16:46 +07:00
direkturcrypto 0886938694 fix: use axios interceptor instead of inline config injection
The IIFE approach that injected httpsAgent into the request config
caused "Converting circular structure to JSON" when the CLOB client
serialized the config object (HttpsProxyAgent has circular refs).

New approach: register an axios request interceptor after the axios
import. This is simpler (no need to find request config patterns),
works with any code format, and avoids serialization issues since
axios handles httpsAgent internally after interceptors run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 14:36:21 +07:00
direkturcrypto f0295818e2 fix: handle inline axios call pattern in patch script
The VPS fresh install uses `(0, axios_1.default)({ method, url: endpoint, ... })`
instead of a separate `config` variable. Add Format B regex to match this
inline pattern and wrap it in an IIFE that injects the proxy agent.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 13:58:27 +07:00
direkturcrypto 85f19d0bd6 fix: use regex matching in patch script + add geoblock IP check
- Rewrite patch-clob-client.cjs to use regex instead of exact string
  matching, so it works regardless of code formatting differences
  between npm versions (fixes "Could not find request config line" on
  fresh VPS install)
- Add multiple fallback patterns (config regex → fallback regex →
  axios call injection) with debug output if all fail
- Add Polymarket geoblock API check (polymarket.com/api/geoblock)
  for both VPS direct IP and proxy IP at startup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 13:55:35 +07:00
direkturcrypto b4d6d648bd feat: auto-patch clob-client proxy support via postinstall script
The proxy patch in node_modules is lost on every fresh npm install.
This postinstall script automatically patches @polymarket/clob-client
http-helpers to inject HttpsProxyAgent for all polymarket.com requests.

Runs automatically after npm install — no manual patching needed on VPS deploy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 13:49:52 +07:00