Settle is a Next.js offramp app that converts Stellar USDC to Naira bank payout using:
- Allbridge for bridge flow (Stellar -> Base)
- Paycrest for fiat payout orchestration (USDC -> NGN)
- Freighter/Lobstr for Stellar wallet signing
This project is API-driven and currently stores transaction history in browser localStorage (no database required).
- Next.js 15 (App Router)
- React 19 + TypeScript
- Tailwind CSS v4
- Stellar SDK + Freighter API
- Allbridge Bridge Core SDK
- viem (Base chain transfer)
- Connect Stellar wallet (Freighter auto-detect first, Lobstr fallback)
- Get USDC -> NGN quote
- Build and sign bridge transaction (XDR)
- Submit Stellar tx and poll bridge status
- Execute payout from server (Base USDC transfer + Paycrest order)
- Poll payout status
- Track user transactions locally in browser storage
npm installcp .env.example .env.localSet values in .env.local:
PAYCREST_API_KEYPAYCREST_WEBHOOK_SECRETBASE_PRIVATE_KEYBASE_RETURN_ADDRESSBASE_RPC_URL(optional, defaults tohttps://mainnet.base.org)STELLAR_SOROBAN_RPC_URL(optional, defaults tohttps://soroban-rpc.mainnet.stellar.gateway.fm)STELLAR_HORIZON_URL(optional, defaults tohttps://horizon.stellar.org)STELLAR_RPC_URL(legacy optional fallback)NEXT_PUBLIC_BASE_RETURN_ADDRESS
npm run devOpen http://localhost:3000.
- User connects wallet in UI.
- User enters amount and beneficiary details in the form.
- App requests quote and estimated payout.
- App calls
POST /api/offramp/bridge/build-tx. - User signs transaction in wallet.
- Client submits tx to Stellar Horizon.
- App polls
GET /api/offramp/bridge/status/[txHash]. - App calls
POST /api/offramp/execute-payout. - App polls
GET /api/offramp/status/[orderId]until terminal status.
POST /api/offramp/quoteGET /api/offramp/currenciesGET /api/offramp/institutions/[currency]POST /api/offramp/verify-accountPOST /api/offramp/execute-payoutGET /api/offramp/status/[orderId]
POST /api/offramp/bridge/build-txGET /api/offramp/bridge/status/[txHash]
POST /api/webhooks/paycrest
- Transaction records are stored in browser
localStorage - Key:
stellaramp_transactions - Max retained records:
50 - Scoped in UI by connected wallet address
npm run dev
npm run build
npm run start
npm run lint- This implementation is production-oriented in flow, but still uses local browser storage instead of a backend DB.
- Keep
.env.local,.next, andnode_modulesout of version control (already covered by.gitignore).