Skip to content

fix: add env fallbacks for hardcoded RPC endpoints#583

Merged
realfishsam merged 1 commit into
mainfrom
fix/507-hardcoded-rpc
May 24, 2026
Merged

fix: add env fallbacks for hardcoded RPC endpoints#583
realfishsam merged 1 commit into
mainfrom
fix/507-hardcoded-rpc

Conversation

@realfishsam
Copy link
Copy Markdown
Contributor

Fixes #507

@realfishsam
Copy link
Copy Markdown
Contributor Author

PR Review: PASS (NOT VERIFIED)

What This Does

Extracts hardcoded RPC endpoint URLs into environment-variable-backed constants for Limitless (Base chain) and Opinion (BSC chain). Creates a new config.ts for Limitless and updates the existing Opinion config.ts to read from process.env.LIMITLESS_RPC_URL and process.env.OPINION_RPC_URL respectively, with the original URLs as defaults.

Blast Radius

  • Limitless exchange: client.ts (getBalance), index.ts (getAddressOnChainBalance) -- both RPC call sites updated
  • Opinion exchange: config.ts -- one constant updated, consumed by auth.ts
  • No SDK, OpenAPI, or normalizer changes

Findings

  1. Consistent approach across both exchanges -- both follow the process.env.X || 'default' pattern. Good.
  2. New file limitless/config.ts is a single-line export, which is fine and follows the Opinion config pattern.
  3. No test coverage for env var override -- not blocking since the default behavior is preserved and the fallback is the existing hardcoded URL, but a unit test verifying process.env override would strengthen confidence.
  4. Other hardcoded RPC URLs in codebase -- grep shows no remaining un-configurable RPC URLs after this PR. Clean sweep.

PMXT Pipeline Check

  • Field propagation: N/A
  • OpenAPI sync: N/A
  • Type safety: OK

Semver Impact

patch -- no public API change; internal infrastructure improvement for deployment flexibility

Risk

No runtime verification that the env var override actually works end-to-end (e.g., connecting to a custom RPC). The change is safe by construction since the default is unchanged.

@realfishsam realfishsam merged commit 0bfd9d8 into main May 24, 2026
11 of 12 checks passed
@realfishsam realfishsam deleted the fix/507-hardcoded-rpc branch May 24, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Magic numbers: Hardcoded blockchain RPC endpoints without env fallbacks

1 participant