Skip to content

fix: read Stellar network and contract ID from config (#66)#77

Merged
robertocarlous merged 1 commit into
Neurowealth:mainfrom
Xaxxoo:fix/issue-66-stellar-network-config
May 29, 2026
Merged

fix: read Stellar network and contract ID from config (#66)#77
robertocarlous merged 1 commit into
Neurowealth:mainfrom
Xaxxoo:fix/issue-66-stellar-network-config

Conversation

@Xaxxoo
Copy link
Copy Markdown
Contributor

@Xaxxoo Xaxxoo commented May 26, 2026

Summary

  • Routes all Stellar env reads (RPC URL, network passphrase, vault contract ID) through the central config object in src/stellar/client.ts and src/stellar/contract.ts
  • Replaces the implicit MAINNET fallback in extractNetwork() (events.ts) with an exhaustive switch on the validated config value, so the compiler enforces coverage of all three network variants
  • Deployments now control the network entirely via STELLAR_NETWORK=testnet|mainnet|futurenet

Test plan

  • Set STELLAR_NETWORK=testnet and verify extractNetwork() returns Network.TESTNET
  • Set STELLAR_NETWORK=futurenet and verify extractNetwork() returns Network.FUTURENET
  • Set STELLAR_NETWORK=mainnet and verify extractNetwork() returns Network.MAINNET
  • Confirm invalid network value still throws at config load time (validated in config/env.ts)
  • Run existing test suite: npm test

Closes #66

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@Xaxxoo Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

…ess.env

Resolves Neurowealth#66 - removes hardcoded MAINNET fallback in extractNetwork() by using
an exhaustive switch on the validated config value, and routes all stellar env
reads (RPC URL, network passphrase, vault contract ID) through the central
config object so deployments control the network via STELLAR_NETWORK env var.
@Xaxxoo Xaxxoo force-pushed the fix/issue-66-stellar-network-config branch from 6ac0805 to 39d2d97 Compare May 29, 2026 19:56
@robertocarlous robertocarlous merged commit 987fd46 into Neurowealth:main May 29, 2026
1 of 2 checks passed
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.

Make Stellar network selection configurable instead of hardcoding MAINNET

2 participants