Docs
Farcaster Token Frame
Farcaster Token Frame
This is the self-host app that generates the Farcaster Frame for the token.
Features
This project is built on Frog Framework, it will render a preview of token as a farcaster frame:
- Display Token image
- Provide Token-related interactive operations
- Support for multiple chains and contracts
Project Structure
app/
: Source code directoryapi/[[...routes]]/route
: Frame route definitionservice/externalApi
: Library for fetching token view data
tsconfig.json
: TypeScript configuration filepackage.json
: Project dependencies and scripts
Setting enviroment
There are three params for env:
- COMMON_API_ROOT: The root url for getting metadata
- API_KEY: The api key for COMMON_API_ROOT
- VIEWER_ROOT: The root url for token actions
You can copy .env.example
and rename to .env
, then set your own env params.
Run
- Run
npm run install
to install dependencies - Use
npm run dev
to start the dev server
Dev console
The project includes a dev console for developer to preview the frame locally, once you start the server, it will run on http://localhost:3000
developer provider the following attributes in the url at the top of the console to preview the frame
- chain (path param)
- contract (path param)
- tokenId (optional, query string)
- scriptId (optional, query string)