Start here
Platform Overview
What SocialPay is, what it is made of, and which parts run on Arc and which do not.
Main components
| Component | What it does | Where it lives |
|---|---|---|
| Web app | Pay, Messages, Explore, Swap, Bridge, Activity, Settings | src/App.tsx, src/components/ |
| ArcSocialPay contract | Payments and tips with an onchain memo | contracts/ArcSocialPay.sol |
| API routes | Chat, social data, explorer history, receipt checks | app/api/ |
| Database (optional) | Stores chat and social data when configured | lib/turso.ts |
| Wallet layer | Connect, sign and switch network | src/config.ts, wagmi, viem, ConnectKit |
Your device
SocialPay web app
- Next.js 15, React 18, Tailwind
- Pay, Swap, Bridge, Messages, Explore
- src/App.tsx, src/components/
Your wallet
- Injected wallet via ConnectKit and wagmi
- You sign every transaction
- Keys never leave the wallet
Browser storage
- Settings, drafts, activity cache
- Used for chat when no database is set
- src/store/appStore.ts
SocialPay services (Next.js API routes)
Chat and social API
- app/api/conversations, messages, posts
- Wallet-signed sessions guard private data
- Optional Turso (LibSQL) database
Explorer and upstream proxies
- app/api/explorer, tx, upstream
- Optional Blockscout key for history
- Token and chain lists, cached
Transaction verification
- app/api/tx reads the Arc node
- Checks receipt, transaction and logs
- src/server/arcRpc.ts
Arc Mainnet (chain 5042)
ArcSocialPay
- pay() and tip() with a memo
- Pulls USDC, forwards it at once, holds nothing
- 0x3b61...bf54
Circle USDC, EURC, cirBTC
- USDC is also the gas token
- 6 decimals as ERC-20, 18 as gas
- src/lib/arcTokens.ts
Swap and bridge protocols
- Uniswap v3, KyberSwap, LI.FI
- Circle App Kit, CCTP, Across, Relay
- Contracts called directly or via quotes
Onchain and off-chain data
| Data | Where it is kept |
|---|---|
| USDC balances and transfers | Arc Mainnet |
| Payment memos and tip post ids | Arc Mainnet, as events from ArcSocialPay |
| Chat messages, posts, comments, follows, profiles | SocialPay database when configured, otherwise your browser |
| Settings, approval limit, scheduled reminders | Your browser |
| Activity cache | Your browser (IndexedDB) |
Self-hosting note
Chat history persists on the server only when TURSO_DATABASE_URL and TURSO_AUTH_TOKEN are set. Without them the app keeps data in the browser.
USDC on Arc
On Arc, USDC is the native gas token and also a normal ERC-20. It is one pool of money exposed two ways: the ERC-20 view uses 6 decimals and the native gas view uses 18 decimals. SocialPay shows a single USDC balance and uses exact integer math, so the two views are never added together.
Found something unclear or out of date? Open an issue on GitHub.