Skip to content

feat: Add Stellar Testnet/Mainnet network switcher#97

Open
dagangtj wants to merge 1 commit intosorosave-protocol:mainfrom
dagangtj:feature/network-switch
Open

feat: Add Stellar Testnet/Mainnet network switcher#97
dagangtj wants to merge 1 commit intosorosave-protocol:mainfrom
dagangtj:feature/network-switch

Conversation

@dagangtj
Copy link

Description

Adds network switching functionality between Stellar Testnet and Mainnet as requested in #80.

Changes

  • ✅ Added NetworkSwitcher component with dropdown in Navbar
  • ✅ Updated sorosave.ts to support multiple network configurations
  • ✅ Implemented localStorage persistence for network selection
  • ✅ Added confirmation dialog before switching networks
  • ✅ Clear cache data on network switch to prevent stale data
  • ✅ Updated providers.tsx to track current network state

Implementation Details

  • Network configs stored in NETWORK_CONFIGS with RPC URLs, passphrases, and contract IDs
  • switchNetwork() function reinitializes SoroSaveClient with new config
  • Confirmation modal warns users about cache clearing and page reload
  • All sorosave_* localStorage keys (except network selection) are cleared on switch

Testing

  • Network selection persists across page reloads
  • Confirmation dialog appears before switching
  • Cache is cleared on network change
  • Client reinitializes with correct network config

Closes #80

- Add NetworkSwitcher component with dropdown in Navbar
- Update sorosave.ts to support multiple networks with config
- Add localStorage persistence for network selection
- Show confirmation dialog before switching networks
- Clear cache data on network switch
- Update providers.tsx to track current network

Closes sorosave-protocol#80
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.

Add support for multiple networks (Testnet/Mainnet switch)

1 participant