From 8ba89a060c62e31637d8ab91023fb929fa238430 Mon Sep 17 00:00:00 2001 From: "Samuel EF. Tinnerholm" Date: Sun, 24 May 2026 17:52:20 +0300 Subject: [PATCH] fix: add env fallbacks for hardcoded service URLs Fixes #508 --- core/src/exchanges/opinion/config.ts | 4 ++-- core/src/router/client.ts | 2 +- core/src/subscriber/external/goldsky.ts | 9 ++++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/core/src/exchanges/opinion/config.ts b/core/src/exchanges/opinion/config.ts index 6e38f63b..efe199ad 100644 --- a/core/src/exchanges/opinion/config.ts +++ b/core/src/exchanges/opinion/config.ts @@ -1,5 +1,5 @@ -export const DEFAULT_OPINION_API_URL = "https://proxy.opinion.trade:8443/openapi"; -export const OPINION_WS_URL = "wss://ws.opinion.trade"; +export const DEFAULT_OPINION_API_URL = process.env.OPINION_API_URL || "https://proxy.opinion.trade:8443/openapi"; +export const OPINION_WS_URL = process.env.OPINION_WS_URL || "wss://ws.opinion.trade"; export const OPINION_MAX_PAGE_SIZE = 20; // CLOB SDK chain constants diff --git a/core/src/router/client.ts b/core/src/router/client.ts index 637f3a5a..fb1806da 100644 --- a/core/src/router/client.ts +++ b/core/src/router/client.ts @@ -15,7 +15,7 @@ import type { RouterEventSearchParams, } from './types'; -const DEFAULT_BASE_URL = 'https://api.pmxt.dev'; +const DEFAULT_BASE_URL = process.env.PMXT_API_URL || 'https://api.pmxt.dev'; export class PmxtApiClient { private readonly http: AxiosInstance; diff --git a/core/src/subscriber/external/goldsky.ts b/core/src/subscriber/external/goldsky.ts index 5fe7d1df..419aedf2 100644 --- a/core/src/subscriber/external/goldsky.ts +++ b/core/src/subscriber/external/goldsky.ts @@ -54,9 +54,12 @@ export interface GoldSkyConfig extends Omit