-
Notifications
You must be signed in to change notification settings - Fork 14
Closed
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program
Description
Label: wallet | stellar | integration
Priority: High
Estimated Time: 6-8 hours
Value: $150 USDC
📋 Overview
Implement Freighter wallet as the single wallet solution for AFRAMP. Stellar network only, no EVM chains, no multi-wallet complexity.
Live Site: https://aframp.vercel.app/
💡 Why Freighter Only?
- ✅ Most popular Stellar wallet (90%+ users)
- ✅ Simple UX - one clear choice
- ✅ Mobile app available
- ✅ Perfect for cNGN/African stablecoins
- ✅ Faster to build and maintain
🎯 What to Build
1. Connect Button (Header)
Not connected: [Connect Freighter]
Connected: GAXYZ...ABC123 [▼]
├─ Copy Address
├─ View on Explorer
└─ Disconnect
2. Connection Modal
If Freighter not installed:
- Show install guide
- Link to Chrome Web Store
- Link to mobile app
- Step-by-step instructions
If requesting connection:
- "Waiting for Freighter approval..."
- What AFRAMP can/cannot do
- Security messaging
If wrong network:
- Detect testnet vs mainnet
- Guide to switch networks
- Refresh button
3. Auto-Reconnect
- Save connection to localStorage
- Auto-reconnect on page load
- Silent if previously connected
- Clear if Freighter disconnected
4. Balance Fetching
- Fetch XLM + all assets (cNGN, USDC, etc.)
- Update every 30 seconds
- Show in wallet dropdown
- Handle unfunded accounts
5. Transaction Signing
- Open Freighter popup
- Sign transactions
- Handle approval/rejection
- Return transaction hash
📦 Core Files
src/
lib/wallet/
freighter.ts # SDK wrapper
walletStore.ts # State management
components/Wallet/
ConnectButton.tsx # Main button
WalletModal.tsx # Modals
WalletDropdown.tsx # Connected dropdown
hooks/
useWallet.ts # Main hook
✅ Acceptance Criteria
Connection:
- Detects if Freighter installed
- Shows install modal if not
- Connects on button click
- Saves to localStorage
- Auto-reconnects on refresh
Network:
- Detects mainnet/testnet
- Shows warning if wrong network
- Provides switch instructions
Balances:
- Fetches all asset balances
- Updates every 30 seconds
- Handles unfunded accounts
Transactions:
- Signs transactions via Freighter
- Handles user approval
- Handles user rejection
- Returns transaction hash
UI/UX:
- Mobile responsive
- Works on Freighter mobile app
- All errors handled gracefully
- Loading states everywhere
- Clean, professional design
Code:
- TypeScript (no
any) - No console errors
- Works in Chrome, Firefox, Edge
- Documented
🚀 Implementation Steps
Phase 1 (3-4 hours):
- Install
@stellar/freighter-api - Create wallet store (Zustand)
- Build connect button
- Implement connection logic
- Add localStorage persistence
Phase 2 (2-3 hours):
6. Build connection modals
7. Add balance fetching
8. Create wallet dropdown
9. Implement disconnect
Phase 3 (1-2 hours):
10. Error handling
11. Testing (desktop + mobile)
12. Documentation
📚 Resources
- [Freighter Docs](https://docs.freighter.app/)
- [Stellar SDK](https://stellar.github.io/js-stellar-sdk/)
- [Freighter Chrome Store](https://chrome.google.com/webstore/detail/freighter/bcacfldlkkdogcmkkibnjlakofdplcbk)
🎯 Success
Complete when:
- ✅ One-click connection works
- ✅ Auto-reconnect works
- ✅ Balances display correctly
- ✅ Transaction signing works
- ✅ Mobile works (Freighter app)
- ✅ All errors handled
Quality: Rock-solid. This is the foundation for everything.
Ready? Comment "Taking this" with your completion date! 🚀
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Stellar WaveIssues in the Stellar wave programIssues in the Stellar wave program