Skip to content

fix: warn when wallet is on wrong Stellar network - #847

Merged
Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
Olabsy19:fix/issue-793-components-connectbutton-tsx-display-warning
Oct 22, 2026
Merged

Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
Olabsy19:fix/issue-793-components-connectbutton-tsx-display-warning

Conversation

@Olabsy19

Copy link
Copy Markdown
Contributor

Overview

This PR surfaces a clear warning when the connected wallet's Stellar network passphrase does not match the app's configured network. Instead of letting users hit confusing transaction simulation errors, the UI now detects the mismatch and prompts them to switch networks in their wallet.

Related Issue

Changes

🌐 Network Mismatch Detection

  • [MODIFY] lib/network-config.ts

    • Exposes the app's expected network passphrase so it can be compared against the wallet's active network.
  • [MODIFY] contexts/WalletContext.tsx

    • Compares the wallet-reported network passphrase with the app configuration and exposes a mismatch flag/state to consumers.
  • [MODIFY] components/ConnectButton.tsx

    • Displays a warning when the wallet is connected to the wrong Stellar network and shows a "Switch to Testnet" modal guiding the user to change networks in their wallet.
  • [MODIFY] components/NetworkBadge.tsx

    • Reflects the mismatch state so the active network is clearly indicated alongside the warning.

Verification Results

Manual check:
✅ Connecting on Mainnet while app is in Testnet mode triggers the mismatch warning
✅ "Switch to Testnet" modal is shown from the ConnectButton
✅ NetworkBadge reflects the mismatched network state
Acceptance Criteria Status
Warning is displayed when wallet is on the wrong Stellar network ✅ Mismatch detected via passphrase comparison in WalletContext
User is prompted to switch networks before submitting transactions ✅ "Switch to Testnet" modal shown from ConnectButton
Active network is clearly indicated ✅ NetworkBadge reflects mismatch state

Closes #793

@drips-wave

drips-wave Bot commented Oct 22, 2026

Copy link
Copy Markdown

@Olabsy19 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

@Olabsy19
Olabsy19 force-pushed the fix/issue-793-components-connectbutton-tsx-display-warning branch from b8aea67 to eeba57c Compare October 22, 2026 12:53
@Jaydbrown
Jaydbrown merged commit 136cded into conduit-protocol:main Oct 22, 2026
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.

components/ConnectButton.tsx: display warning when wallet is connected to wrong Stellar network

2 participants