ProblemSTELLAR_CHAIN = 'stellar:testnet' is a module constant in walletconnect.ts. The Topbar network toggle lets users switch the walletStore network to 'public', but WalletConnect pairing still uses stellar:testnet regardless, so a mainnet wallet can be offered a testnet session or vice versa.
- Chain id is fixed at module load;
walletStore.network changes are not reflected.
- Session proposals advertise
stellar:testnet even when the UI says Mainnet.
- Account/network mismatch errors surface only later, after the wallet replies.
Solution
- Derive the chain id from the active
walletStore network at pairing time.
- Validate the wallet's reported network against the UI network and fail fast with a typed error.
- Keep the mapping (
testnet/public) in one place and document it.
Acceptance Criteria
- Switching the Topbar network changes the chain id used in the pairing URI.
- A wallet on the wrong network produces an immediate, clear mismatch error.
- No stale
stellar:testnet constant is used for mainnet sessions.
npm run build passes.
Note for Contributors: Write a clear PR description. Show the pairing URI chain id before/after toggling the network.
Problem
STELLAR_CHAIN = 'stellar:testnet'is a module constant inwalletconnect.ts. TheTopbarnetwork toggle lets users switch thewalletStorenetwork to'public', but WalletConnect pairing still usesstellar:testnetregardless, so a mainnet wallet can be offered a testnet session or vice versa.walletStore.networkchanges are not reflected.stellar:testneteven when the UI says Mainnet.Solution
walletStorenetwork at pairing time.testnet/public) in one place and document it.Acceptance Criteria
stellar:testnetconstant is used for mainnet sessions.npm run buildpasses.Note for Contributors: Write a clear PR description. Show the pairing URI chain id before/after toggling the network.