diff --git a/core/src/exchanges/limitless/client.ts b/core/src/exchanges/limitless/client.ts index 92da1be4..2d43fe7b 100644 --- a/core/src/exchanges/limitless/client.ts +++ b/core/src/exchanges/limitless/client.ts @@ -1,5 +1,6 @@ import { HttpClient, OrderClient, OrderBuilder, OrderSigner, MarketFetcher, Side, OrderType } from '@limitless-exchange/sdk'; import { Wallet, providers, Contract, utils } from 'ethers'; +import { LIMITLESS_RPC_URL } from './config'; const DEFAULT_LIMITLESS_API_URL = process.env.LIMITLESS_BASE_URL || 'https://api.limitless.exchange'; @@ -378,8 +379,7 @@ export class LimitlessClient { const USDC_ADDRESS = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"; const ABI = ["function balanceOf(address) view returns (uint256)", "function decimals() view returns (uint8)"]; - // Use a public RPC for Base - const provider = new providers.StaticJsonRpcProvider('https://mainnet.base.org', { + const provider = new providers.StaticJsonRpcProvider(LIMITLESS_RPC_URL, { chainId: 8453, name: 'base', }); diff --git a/core/src/exchanges/limitless/config.ts b/core/src/exchanges/limitless/config.ts new file mode 100644 index 00000000..bed2d5fd --- /dev/null +++ b/core/src/exchanges/limitless/config.ts @@ -0,0 +1 @@ +export const LIMITLESS_RPC_URL = process.env.LIMITLESS_RPC_URL || 'https://mainnet.base.org'; diff --git a/core/src/exchanges/limitless/index.ts b/core/src/exchanges/limitless/index.ts index 701a24d1..235f47b7 100644 --- a/core/src/exchanges/limitless/index.ts +++ b/core/src/exchanges/limitless/index.ts @@ -32,6 +32,7 @@ import { FetcherContext } from '../interfaces'; import { limitlessApiSpec } from './api'; import { LimitlessAuth } from './auth'; import { LimitlessClient } from './client'; +import { LIMITLESS_RPC_URL } from './config'; import { limitlessErrorMapper } from './errors'; import { LimitlessFetcher } from './fetcher'; import { LimitlessNormalizer } from './normalizer'; @@ -553,7 +554,7 @@ export class LimitlessExchange extends PredictionMarketExchange { // // Static network avoids ethers v5 auto-detect (eth_chainId), which can throw // noNetwork / NETWORK_ERROR on flaky public RPCs (#92). - const provider = new providers.StaticJsonRpcProvider('https://mainnet.base.org', { + const provider = new providers.StaticJsonRpcProvider(LIMITLESS_RPC_URL, { chainId: 8453, name: 'base', }); diff --git a/core/src/exchanges/opinion/config.ts b/core/src/exchanges/opinion/config.ts index 1a2b2dfa..7e959716 100644 --- a/core/src/exchanges/opinion/config.ts +++ b/core/src/exchanges/opinion/config.ts @@ -4,4 +4,4 @@ export const OPINION_MAX_PAGE_SIZE = 20; // CLOB SDK chain constants export const OPINION_CHAIN_ID = 56; -export const OPINION_DEFAULT_RPC_URL = 'https://bsc-dataseed.binance.org'; +export const OPINION_DEFAULT_RPC_URL = process.env.OPINION_RPC_URL || 'https://bsc-dataseed.binance.org';