Skip to content

fix: Stellar Testnet Integration#115

Open
Uche44 wants to merge 1 commit into
Lumina-eX:mainfrom
Uche44:fix/stellar-testnet-integration
Open

fix: Stellar Testnet Integration#115
Uche44 wants to merge 1 commit into
Lumina-eX:mainfrom
Uche44:fix/stellar-testnet-integration

Conversation

@Uche44
Copy link
Copy Markdown

@Uche44 Uche44 commented Jun 1, 2026

Implemented full Stellar Testnet + Freighter wallet integration across the frontend with proper network detection, a global state context, and gated authentication.

Changes Made
[NEW] components/wallet-provider.tsx
A global React context (StellarWalletProvider) that:

Polls Freighter every 3 seconds for connection status, wallet address and active network.
Exposes useStellarWallet() hook with: address, isConnected, network, isWrongNetwork, connect(), disconnect().
Syncs the wallet address with localStorage.
Defines REQUIRED_NETWORK = "TESTNET" as the single source of truth.
[NEW] components/network-banner.tsx
A sticky top banner that appears only when the wallet is connected but on the wrong network. It:

Is dismissible per-session.
Instructs the user to switch networks inside Freighter → Settings → Network.
[MODIFY] app/layout.tsx
Wrapped the entire app in .
Mounted globally so it shows on every page.
[MODIFY] components/navbar.tsx
Replaced all mock wallet state with real data from useStellarWallet():

Shows real truncated wallet address when connected.
Shows a colored Testnet/Mainnet network badge.
Shows an amber AlertTriangle icon when on the wrong network.
Profile dropdown shows the full address and network info.
Real connect() / disconnect() actions hooked up.
Mobile menu updated to match.
[MODIFY] components/dashboard/header.tsx
Displays a compact green "connected" pill showing the wallet address + network when on Testnet.
Displays an amber inline warning strip when on the wrong network.
User dropdown shows wallet address, network badge, and wrong-network indicator.
Logout button calls disconnect() and redirects to /login.
[MODIFY] app/login/page.tsx
Refactored to a clean two-step auth flow:

Step 1 — Connect: Calls connect() from the provider (uses requestAccess).
Step 2 — Sign & Authenticate: After connecting, the page shows the wallet card. If on the wrong network, a prominent amber warning block appears and the Sign In button is disabled with a "Switch to Testnet First" label. Only when on Testnet does the Freighter signature → backend verify flow proceed.

Closes #80

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 1, 2026

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

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.

[Feature]: Stellar Testnet Integration

1 participant