flowchart TD
%% ===== STYLES (Soft + Minimal) =====
classDef base fill:#F8FAFC,stroke:#CBD5E1,stroke-width:1.5px,color:#0F172A
classDef action fill:#E0F2FE,stroke:#7DD3FC,color:#075985
classDef decision fill:#FEF3C7,stroke:#FCD34D,color:#78350F
classDef success fill:#ECFDF5,stroke:#86EFAC,color:#065F46
classDef error fill:#FEE2E2,stroke:#FCA5A5,color:#7F1D1D
classDef external fill:#F1F5F9,stroke:#CBD5E1,color:#334155
%% ===== FLOW =====
A([Open pool page]):::base --> B[Enter amount]:::action
B --> C{WETH balance sufficient}:::decision
C -->|Yes| D[Check allowance]:::action
C -->|No| E[Insufficient balance]:::error
E --> F[Open Etherscan]:::external
F --> G[Call WETH deposit]:::external
G --> H[Return to app]:::external
H --> B
D --> I{Allowance sufficient}:::decision
I -->|Yes| J[Submit buy]:::success
I -->|No| K[Approve WETH]:::action
K --> J
1. Problem
The frontend relies on
@rainbow-me/rainbowkitand WalletConnect/Reown infrastructure, which introduces a cloud dependency and a Single Point of Failure (SPOF). This violates the core architectural directive of zero cloud dependencies for wallet connections.lib/config.ts,providers/providers.tsx, andcomponents/ui/ConnectBtn.tsxare tightly coupled toNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID.2. Current Behavior
<RainbowKitProvider>and<ConnectButton.Custom>. Mobile and general connections attempt to ping WalletConnect's relay endpoints.lib/config.tscurrently importsgetDefaultConfigand requires a WalletConnectprojectIdwhich actively makes network calls to Reown infrastructure upon initialization and connection.projectIdbreaks the components. We need a complete, atomic replacement of the connection layer to guarantee pure client-side wallet discovery.flowchart TD %% ===== STYLES (Soft + Minimal) ===== classDef base fill:#F8FAFC,stroke:#CBD5E1,stroke-width:1.5px,color:#0F172A classDef action fill:#E0F2FE,stroke:#7DD3FC,color:#075985 classDef decision fill:#FEF3C7,stroke:#FCD34D,color:#78350F classDef success fill:#ECFDF5,stroke:#86EFAC,color:#065F46 classDef error fill:#FEE2E2,stroke:#FCA5A5,color:#7F1D1D classDef external fill:#F1F5F9,stroke:#CBD5E1,color:#334155 %% ===== FLOW ===== A([Open pool page]):::base --> B[Enter amount]:::action B --> C{WETH balance sufficient}:::decision C -->|Yes| D[Check allowance]:::action C -->|No| E[Insufficient balance]:::error E --> F[Open Etherscan]:::external F --> G[Call WETH deposit]:::external G --> H[Return to app]:::external H --> B D --> I{Allowance sufficient}:::decision I -->|Yes| J[Submit buy]:::success I -->|No| K[Approve WETH]:::action K --> J3. Proposed Solution
Migrate to pure
wagmiv2 usingmultiInjectedProviderDiscovery: true(EIP-6963) to allow decentralized, peer-to-peer browser wallet discovery without external APIs.@rainbow-me/rainbowkitand any@walletconnect/*dependencies.lib/config.tsto usecreateConfigfromwagmiwithout the WalletConnect connector.ConnectBtn.tsxnatively usinguseConnect,useAccount, anduseDisconnectto maintain functionality and visual flow.NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDfrom.env.example.flowchart TD %% ===== STYLES ===== classDef base fill:#F8FAFC,stroke:#CBD5E1,stroke-width:1.5px,color:#0F172A classDef action fill:#E0F2FE,stroke:#7DD3FC,color:#075985 classDef remove fill:#FEE2E2,stroke:#FCA5A5,color:#7F1D1D classDef success fill:#ECFDF5,stroke:#86EFAC,color:#065F46 %% ===== FLOW ===== A([Start]):::base --> B[Remove WalletConnect + RainbowKit]:::remove B --> C[Setup wagmi v2 config]:::action C --> D[Enable EIP-6963 discovery]:::action D --> E[Build Connect Button using wagmi hooks]:::action E --> F[Browser detects wallets]:::base F --> G[User connects wallet]:::success G --> H([Direct connection established]):::success4. Acceptance Criteria
*.walletconnect.comor*.reown.com.@rainbow-me/rainbowkitpackage successfully removed frompackage.json.wagmihooks correctly handles connect, network switching, and disconnects.