Skip to content

feat: Testnet/Mainnet network switcher#91

Open
opensecretsauce wants to merge 2 commits intosorosave-protocol:mainfrom
opensecretsauce:feat/network-switcher
Open

feat: Testnet/Mainnet network switcher#91
opensecretsauce wants to merge 2 commits intosorosave-protocol:mainfrom
opensecretsauce:feat/network-switcher

Conversation

@opensecretsauce
Copy link

Closes #80

Changes

  • NetworkSwitcher component — dropdown (🧪 Testnet / 🌐 Mainnet) in Navbar
  • Confirmation dialog on switch with Mainnet funds warning
  • Disconnects wallet + clears localStorage on switch, page reloads
  • sorosave.ts updated to read active network for RPC URL, passphrase, contractId
  • Configurable via NEXT_PUBLIC_MAINNET_CONTRACT_ID env var

Build

pnpm build

- Add WalletAdapter interface (src/lib/wallets/index.ts)
- Add FreighterAdapter, xBullAdapter, AlbedoAdapter
- Refactor providers.tsx to support multiple wallets + localStorage persistence
- Update ConnectWallet.tsx with wallet selection modal
- Create src/lib/sdk.ts as local stub for @sorosave/sdk
- Create src/lib/wallet.ts with multi-wallet signTransaction routing
- Fix all @sorosave/sdk missing module errors — build passes clean
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