Farcaster Frames
The app exposes HTML frame responses and PNG image routes so a Farcaster cast can open into a wallet-specific ClankerCats browser.
Entry points
GET /api/frame
GET /api/frame/<wallet>
POST /api/frame/<wallet>?idx=<n>&count=<total>
Behavior:
GET /api/framereturns the landing frame with an input box for a wallet address.GET /api/frame/<wallet>validates the address, readsOwnerUpegsCount, and returns the first cat view for that wallet.POST /api/frame/<wallet>handles button clicks and moves backward or forward through the wallet's cats.- Invalid or missing wallet paths fall back to the landing frame.
Image routes used by the frame
| Endpoint | Output |
|---|---|
GET /api/frame-landing-image | 1200x630 PNG for the landing state |
GET /api/cat-image?wallet=<address>&idx=<n> | 1200x630 PNG for the selected cat |
GET /api/no-cats | 1200x630 PNG for empty-state wallets |
Notes:
cat-imagereads the wallet's cats fromOwnerUpegsPage(owner, 0, 100)and clampsidxinto bounds.cat-imagereturns400for invalid wallets and404if the wallet has no cats.- Frame and image routes are rate-limited to 60 requests per minute per IP.
Button behavior
The wallet frame builds its button row dynamically:
Prevonly appears when the current index is greater than zero.- The center button shows the current position as
🐱 current/total. Nextonly appears when there are more cats ahead.Buy CCATis always a link button to the app's Uniswap URL.
Base URL requirement
The frame route builds absolute image and post URLs from NEXT_PUBLIC_URL.
Current fallback behavior in code:
- If
NEXT_PUBLIC_URLis set, frame metadata uses that value. - If it is unset, the route falls back to
https://clankercats.xyz.
If the production public site is https://clankercats.com, set NEXT_PUBLIC_URL explicitly so shared frames point at the intended domain.