Frontend Wallet Integration
The current frontend working tree includes external wallet integration for Arc Testnet using RainbowKit, Wagmi, and Viem. Planned public frontend:Wallet Stack
| Layer | Implementation |
|---|---|
| Wallet UI | RainbowKit |
| Wallet state/actions | Wagmi |
| EVM utilities | Viem |
| Config file | apps/web/src/lib/wagmi.ts |
| Contract constants | apps/web/src/lib/contracts.ts |
Chain
| Field | Value |
|---|---|
| Network | Arc Testnet |
| Chain ID | 5042002 |
| RPC | https://rpc.testnet.arc.network |
| Explorer | https://testnet.arcscan.app |
| Native currency label in frontend config | USDC |
WalletConnect Project ID
WalletConnect support requires a WalletConnect Project ID.- Local value:
apps/web/.env.local - Variable:
NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID - Deployment value: configure in Vercel environment variables later.
- Do not commit a real project ID.
NEXT_PUBLIC_* values are exposed to the browser. They must not contain private keys, Circle API keys, database URLs, RPC secrets, or server credentials.
User Flow
- Open the app.
- Connect an external wallet through the header wallet control.
- Verify the connected address appears.
- Verify the network state.
- Switch to Arc Testnet if the wallet is on another network.
- Open a market detail page.
- If the market is open and the contract reports
isOpen(), enter a USDC amount. - Approve USDC for the
SignalArcMarketcontract. - Submit
openPosition. - Wait for transaction receipts.
- View transaction hashes through Arcscan links.
Implemented Arc Testnet Trade Flow
The currenttrade-intent-panel.tsx uses browser wallet actions for:
approve(address,uint256)on the Arc Testnet USDC ERC20 interface.openPosition(uint8,uint256)on the deployedSignalArcMarketprototype.isOpen()read check before enabling execution.- Arcscan transaction links after submission.
| UI outcome | Contract enum value |
|---|---|
| YES | 1 |
| NO | 2 |
1 USDC becomes 1000000 base units.
Safety Boundaries
- Browser wallet signs user transactions.
- Backend does not sign user transactions.
- Frontend and backend must not contain private keys.
- Circle embedded wallet is not implemented.
- Circle SDK/API integration is not implemented.
- This is Arc Testnet prototype behavior only.
- No production settlement approval is claimed.
- No audit is claimed.