📍 Page Location
URL: /wallet-setup
📸 Visual Representation of the Page
Step 3: Wallet Setup
I have a wallet
Enter your existing wallet address
Help me set up wallet
Connect with MetaMask
🎨 Detailed Visual Description
User sees two options: "I have a wallet" (manual entry) or "Help me set up wallet" (MetaMask integration). For manual entry, user inputs wallet address and type. MetaMask option connects to browser extension.
Key Visual Elements:
- Manual wallet entry
- MetaMask integration
- Ethereum address validation (0x + 40 hex chars)
- Wallet type selection
⚙️ Backend Process
API Endpoint: POST /api/wallet/create
Process Flow:
1. Validates wallet address format (Ethereum: 0x + 40 hex)
2. Creates wallet record in database.wallets Map
3. Links wallet to user via email
4. Sets initial TGT balance (demo: $100,000)
5. Updates user.hasWallet = true
6. Stores wallet type (Manual/MetaMask)Database Operations:
- Table:
database.wallets - Action: Create wallet record
- Fields: id: "wallet-{email}", address, type, tgtBalance: 100000, createdAt
➡️ Next Action
User is redirected to /dashboard/authenticated (main dashboard)