This guide will help you get the anchor selection feature up and running.
✅ Backend API for anchor provider data ✅ Frontend React component with dropdown UI ✅ Fee structure display ✅ Transaction limits display ✅ Compliance requirements display ✅ Filtering by currency and status ✅ Unit tests for both backend and frontend
api/
├── src/
│ ├── routes/
│ │ └── anchors.ts # Anchor API endpoints
│ ├── types/
│ │ └── anchor.ts # TypeScript interfaces
│ ├── __tests__/
│ │ └── anchors.test.ts # API tests
│ └── app.ts # Updated with anchors route
frontend/
├── src/
│ └── components/
│ ├── AnchorSelector.tsx # Main component
│ ├── AnchorSelector.css # Styling
│ └── __tests__/
│ └── AnchorSelector.test.tsx # Component tests
cd api
npm install
npm run devThe API will be available at http://localhost:3000
# Get all anchors
curl http://localhost:3000/api/anchors
# Get anchors for USD
curl http://localhost:3000/api/anchors?currency=USD
# Get specific anchor
curl http://localhost:3000/api/anchors/anchor-1import { AnchorSelector } from './components/AnchorSelector';
function RemittanceForm() {
const handleAnchorSelect = (anchor) => {
console.log('Selected anchor:', anchor);
// Use anchor data for your remittance
};
return (
<AnchorSelector
onSelect={handleAnchorSelect}
currency="USD"
apiUrl="http://localhost:3000"
/>
);
}- Click to open dropdown
- View all available anchors
- See ratings and verification status
- Quick view of fees, limits, and processing time
- Click "Show Details" to expand
- Complete fee structure
- All transaction limits
- Full compliance requirements
- Supported countries and restrictions
Fees:
- Deposit fee (% + fixed)
- Withdrawal fee (% + fixed)
- Min/max fee caps
Limits:
- Per transaction (min/max)
- Daily limits
- Monthly limits
Compliance:
- KYC level (Basic/Standard/Enhanced)
- Required documents
- Supported countries
- Restricted countries
Currently includes 3 anchor providers:
- MoneyGram Access - Global coverage, intermediate KYC
- Circle USDC - Instant settlement, enhanced KYC
- AnchorUSD - Americas focus, basic KYC
-
Database Integration
- Replace mock data with database queries
- Add anchor CRUD operations
- Implement caching
-
Authentication
- Add API authentication
- Implement rate limiting per user
- Add admin endpoints
-
Real-time Updates
- WebSocket for status changes
- Live fee updates
- Availability notifications
-
Smart Contract Integration
- Store anchor verification on-chain
- Integrate with remittance contract
- Add settlement tracking
# Backend tests
cd api
npm test
# Frontend tests
cd frontend
npm testFull API documentation is available in api/README.md
interface AnchorSelectorProps {
onSelect: (anchor: AnchorProvider) => void;
selectedAnchorId?: string;
currency?: string;
apiUrl?: string;
}The component uses CSS modules. Customize by editing:
frontend/src/components/AnchorSelector.css
For issues or questions, refer to:
ANCHOR_SELECTION.md- Full implementation detailsapi/README.md- API documentation- Component source code with inline comments