-
-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Summary
Integrate the Quidli Social Name Service (SNS) API to resolve Farcaster FIDs to additional ETH wallet addresses in the right sidebar's author context panel.
Background
The SNS API resolves social identities (Twitter, Discord, Telegram, Farcaster, email) to associated ETH wallet addresses. This could surface wallet addresses that users haven't explicitly verified on Farcaster but have linked via other platforms.
Current state: AuthorContextPanel.tsx displays verified_addresses.eth_addresses from Neynar API.
Proposed: Add a new "SNS Wallet" section showing addresses resolved via Quidli.
API Details
Base URL: https://api.sns.quid.li
Endpoint: POST /lookup
{
"recipients": [
{ "type": "farcaster", "fid": "3" }
]
}Response:
{
"status": "completed",
"results": [
{
"type": "farcaster",
"fid": "3",
"walletAddress": "0x91e547D48CF666495A8eFbBa26c65286B6af8aBf"
}
]
}Rate Limits (Important):
- 5 requests/second
- 20 requests/minute
Note: Some lookups may return status: "processing" with a pendingRequestId, requiring a follow-up GET /lookup/follow-up/{id} call.
Proposed Implementation
Caching Strategy
Given strict rate limits, use aggressive caching following existing patterns:
| Layer | Technology | TTL | Rationale |
|---|---|---|---|
| Server | unstable_cache |
7 days | Wallet addresses rarely change (matches onchain data pattern) |
| Client | React Query | 24h stale, 7d gc | Long-lived data |
Files to Create/Modify
-
/app/api/sns/lookup/route.ts- API route- Check
unstable_cachefirst - Handle async
processingstatus with polling - Return cached or fresh data
- Check
-
/src/hooks/queries/useSnsWallet.ts- React Query hook- Debounce to avoid rapid selection changes (500ms)
- Long stale/gc times
-
/src/common/components/Sidebar/AuthorContextPanel.tsx- UI- Add "SNS Wallet" section below "Verified Addresses"
- Show loading/resolved/not-found states
- Copy-to-clipboard (reuse existing utility)
Architecture
AuthorContextPanel
└─ useSnsWallet(fid) [debounced 500ms]
└─ React Query (staleTime: 24h)
└─ /api/sns/lookup?fid=X
└─ unstable_cache (7 days)
└─ Quidli SNS API
Future Enhancement: Request Batching
SNS API supports batch lookups. Could implement batshit pattern (like profileBatcher.ts) with 100ms window to batch FIDs from visible feed items.
Environment
Requires QUIDLI_SNS_API_KEY environment variable.
Tasks
- Add
QUIDLI_SNS_API_KEYto environment - Create
/app/api/sns/lookup/route.tswithunstable_cache - Handle async
processingstatus (polling or skip) - Create
useSnsWallet.tshook with debounce - Add SNS wallet section to
AuthorContextPanel.tsx - Add loading/error/empty states
- Test rate limit handling
Questions
- Should we show SNS wallet even if it matches a verified address? (dedupe?)
- What label? "Quidli Wallet" / "SNS Wallet" / "Linked Wallet"?
- Auto-fetch or manual "Resolve" button?