fix: Stellar Testnet Integration#115
Open
Uche44 wants to merge 1 commit into
Open
Conversation
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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