Skip to content

feat(auth): implement walletgate multi-wallet provider and network switcher - #1252

Merged
ayomideadeniran merged 1 commit into
StellarDevHub:mainfrom
Dopezapha:feature/walletgate-multi-wallet-network-switcher
Sep 2, 2026
Merged

feat(auth): implement walletgate multi-wallet provider and network switcher#1252
ayomideadeniran merged 1 commit into
StellarDevHub:mainfrom
Dopezapha:feature/walletgate-multi-wallet-network-switcher

Conversation

@Dopezapha

Copy link
Copy Markdown
Contributor

Closes #1112
Closes #1113

PR Description

I implemented a unified multi-wallet provider and dynamic Stellar network auto-detection mechanism for the Web3 Student Lab platform. Previously, wallet connection relied on limited extension handling and lacked active network divergence protection.

I added standardized wallet adapters for Freighter, Albedo, Rabet, Hana, xBull, WalletConnect, and a Dev Mock Wallet inside WalletContext.tsx. The context dynamically scans the browser window for installed extension objects every 3 seconds. When a user opens the WalletGate modal, detected extensions show an instant connect button while missing wallets render direct download links so users can install them without leaving or breaking the modal flow.

I also built an active network auto-detection and switcher system supporting Public Mainnet, Testnet, and Futurenet. The context monitors the connected wallet network passphrase and compares it against the active application target network. If a network mismatch occurs, I display an alert banner at the top of the interface and block transaction signing attempts until the user switches networks using the 1-click network switcher button. Additionally, I isolated balances by network so testnet funds remain separated from production mainnet account views.

Changes Made

  • Updated frontend/src/contexts/WalletContext.tsx to add multi-wallet adapters for Freighter, Albedo, Rabet, Hana, xBull, WalletConnect, and Dev Mock.
  • Added dynamic window extension scanning to reactively identify available browser wallets.
  • Standardized transaction signing with network passphrase validation across all wallet adapters.
  • Implemented global network state management, network divergence detection, block height polling, and network-isolated balances in WalletContext.tsx.
  • Updated frontend/src/components/layout/WalletGate.tsx with a multi-wallet selection modal displaying detected wallets and direct installation links.
  • Added a top-level network mismatch alert banner with 1-click network switching triggers in WalletGate.tsx.

Testing

  • Ran git status and TypeScript compilation checks to verify type safety across modified files.
  • Command run:
    npx tsc --noEmit
  • Verified that wallet discovery, network state switching, and transaction signing guards behave as expected without runtime errors.

@vercel

vercel Bot commented Aug 30, 2026

Copy link
Copy Markdown

@Dopezapha is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

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

const [transactionSnapshot, sendTransaction] = useMachine(web3TransactionMachine);

// Restore session
const [balances, setBalances] = useState<Record<StellarNetwork, string>>({
@ayomideadeniran
ayomideadeniran merged commit 1909a0c into StellarDevHub:main Sep 2, 2026
4 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants