This package replaces the old hard-coded wallet modal with a 2026-style EVM wallet flow:
- Detects EIP-6963 wallet providers and legacy injected providers.
- Lists only detected wallets in the connect modal.
- Keeps a link to trusted EVM wallet directories when nothing is detected.
- Uses
eth_accountsfor hydration andeth_requestAccountsonly after the user selects a wallet. - Keeps your existing
ethersprovider/signer API, so existing launchpad code should continue to work. - Adds no new npm dependencies.
Copy these into the repo, preserving paths:
frontend/src/hooks/useWallet.tsfrontend/src/contexts/WalletContext.tsxfrontend/src/components/wallet/ConnectWalletModal.tsx
From the repository root, after copying the files above, run:
node apply-wallet-connection-patch.mjsThe patch script updates frontend/src/components/TopBar.tsx by:
- removing the inline
createPortalwallet modal, - removing the old
WalletType/toastmodal handler, - importing
ConnectWalletModal, and - rendering
<ConnectWalletModal open={walletModalOpen} onOpenChange={setWalletModalOpen} />.
If the script says TopBar.tsx did not change, make these manual edits:
import { useWallet } from "@/contexts/WalletContext";
import { ConnectWalletModal } from "@/components/wallet/ConnectWalletModal";Remove the old handleWalletSelect function and replace the entire old {/* Wallet selection modal */} ... createPortal(..., document.body)} block with:
{/* Wallet selection modal */}
<ConnectWalletModal open={walletModalOpen} onOpenChange={setWalletModalOpen} />