├── vercel.json ├── docs ├── assets │ ├── hub.png │ ├── contracts.png │ ├── frame_app.png │ ├── frame_og.png │ ├── frame_poll.png │ ├── high-level.png │ ├── usernames.png │ ├── architecture.png │ ├── actions │ │ ├── frame_type.png │ │ └── message_type.png │ └── registry-contracts.png ├── developers │ ├── utilities.md │ ├── guides │ │ ├── writing │ │ │ ├── submit-messages.md │ │ │ ├── verify-address.md │ │ │ ├── casts.md │ │ │ └── messages.md │ │ ├── advanced │ │ │ ├── query-signups.md │ │ │ └── decode-key-metadata.md │ │ ├── querying │ │ │ ├── fetch-casts.md │ │ │ ├── fetch-profile.md │ │ │ ├── setting-up.md │ │ │ └── fetch-channel-casts.md │ │ ├── accounts │ │ │ ├── find-by-name.md │ │ │ ├── change-fname.md │ │ │ ├── change-recovery.md │ │ │ └── change-custody.md │ │ ├── apps │ │ │ └── replicate.md │ │ └── frames │ │ │ └── poll.md │ ├── index.md │ └── resources.md ├── public │ ├── .DS_Store │ ├── icon.png │ └── og-image.png ├── .vitepress │ └── theme │ │ ├── index.js │ │ └── custom.css ├── hubble │ ├── tutorials.md │ ├── hubble.md │ ├── networks.md │ ├── monitoring.md │ └── troubleshooting.md ├── examples │ └── contracts │ │ ├── signer.ts │ │ ├── clients.ts │ │ └── metadata.ts ├── reference │ ├── hubble │ │ ├── httpapi │ │ │ ├── fids.md │ │ │ ├── info.md │ │ │ ├── storagelimits.md │ │ │ ├── verification.md │ │ │ ├── usernameproof.md │ │ │ ├── userdata.md │ │ │ ├── events.md │ │ │ ├── links.md │ │ │ ├── onchain.md │ │ │ ├── httpapi.md │ │ │ └── casts.md │ │ ├── grpcapi │ │ │ ├── fids.md │ │ │ ├── message.md │ │ │ ├── events.md │ │ │ ├── storagelimits.md │ │ │ ├── grpcapi.md │ │ │ ├── verification.md │ │ │ ├── userdata.md │ │ │ ├── casts.md │ │ │ ├── usernameproof.md │ │ │ ├── links.md │ │ │ ├── onchain.md │ │ │ ├── reactions.md │ │ │ └── sync.md │ │ └── architecture.md │ ├── warpcast │ │ ├── embeds.md │ │ └── cast-composer-intents.md │ ├── index.md │ ├── contracts │ │ ├── deployments.md │ │ ├── index.md │ │ ├── reference │ │ │ ├── storage-registry.md │ │ │ └── bundler.md │ │ └── faq.md │ └── fname │ │ └── api.md ├── auth-kit │ ├── examples.md │ ├── introduction.md │ ├── hooks │ │ ├── use-sign-in-message.md │ │ └── use-profile.md │ ├── client │ │ ├── introduction.md │ │ ├── app │ │ │ ├── client.md │ │ │ ├── create-channel.md │ │ │ ├── verify-sign-in-message.md │ │ │ ├── status.md │ │ │ └── watch-status.md │ │ └── wallet │ │ │ ├── parse-sign-in-uri.md │ │ │ ├── client.md │ │ │ ├── build-sign-in-message.md │ │ │ └── authenticate.md │ ├── auth-kit-provider.md │ ├── installation.md │ └── sign-in-button.md ├── learn │ ├── contributing │ │ ├── governance.md │ │ ├── overview.md │ │ └── fips.md │ ├── architecture │ │ ├── overview.md │ │ ├── ens-names.md │ │ ├── contracts.md │ │ └── hubs.md │ └── what-is-farcaster │ │ ├── frames.md │ │ ├── apps.md │ │ ├── accounts.md │ │ ├── channels.md │ │ ├── usernames.md │ │ └── messages.md └── index.md ├── .husky └── pre-commit ├── .prettierrc.yml ├── README.md ├── package.json └── .gitignore /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "cleanUrls": true 3 | } 4 | -------------------------------------------------------------------------------- /docs/assets/hub.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/hub.png -------------------------------------------------------------------------------- /docs/developers/utilities.md: -------------------------------------------------------------------------------- 1 | # Links 2 | 3 | - https://github.com/a16z/awesome-farcaster 4 | -------------------------------------------------------------------------------- /docs/public/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/public/.DS_Store -------------------------------------------------------------------------------- /docs/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/public/icon.png -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | yarn lint-staged 5 | -------------------------------------------------------------------------------- /docs/assets/contracts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/contracts.png -------------------------------------------------------------------------------- /docs/assets/frame_app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/frame_app.png -------------------------------------------------------------------------------- /docs/assets/frame_og.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/frame_og.png -------------------------------------------------------------------------------- /docs/assets/frame_poll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/frame_poll.png -------------------------------------------------------------------------------- /docs/assets/high-level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/high-level.png -------------------------------------------------------------------------------- /docs/assets/usernames.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/usernames.png -------------------------------------------------------------------------------- /docs/public/og-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/public/og-image.png -------------------------------------------------------------------------------- /docs/assets/architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/architecture.png -------------------------------------------------------------------------------- /docs/assets/actions/frame_type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/actions/frame_type.png -------------------------------------------------------------------------------- /docs/assets/actions/message_type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/actions/message_type.png -------------------------------------------------------------------------------- /docs/assets/registry-contracts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fortunaaaa/docs/HEAD/docs/assets/registry-contracts.png -------------------------------------------------------------------------------- /.prettierrc.yml: -------------------------------------------------------------------------------- 1 | semi: true 2 | trailingComma: 'es5' 3 | singleQuote: true 4 | printWidth: 80 5 | tabWidth: 2 6 | useTabs: false 7 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/index.js: -------------------------------------------------------------------------------- 1 | // .vitepress/theme/index.js 2 | import DefaultTheme from 'vitepress/theme' 3 | import './custom.css' 4 | 5 | export default DefaultTheme -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docs.farcaster.xyz 2 | 3 | Documentation for the Farcaster Protocol 4 | 5 | ### Getting Started 6 | 7 | 1. Run `npm install -D vitepress` 8 | 2. Run `npm run docs:dev` 9 | -------------------------------------------------------------------------------- /docs/hubble/tutorials.md: -------------------------------------------------------------------------------- 1 | # Tutorials 2 | 3 | Guides to set up a Hubble instance using various cloud providers. 4 | 5 | - [AWS EC2](https://warpcast.notion.site/Set-up-Hubble-on-EC2-Public-23b4e81d8f604ca9bf8b68f4bb086042) 6 | - [Digital Ocean](https://warpcast.notion.site/Set-up-Hubble-on-DigitalOcean-Public-e38173c487874c91828665e73eac94c1) 7 | -------------------------------------------------------------------------------- /docs/.vitepress/theme/custom.css: -------------------------------------------------------------------------------- 1 | /* .vitepress/theme/custom.css */ 2 | :root { 3 | --vp-c-green: #8a63d2; 4 | --vp-c-green-light: #9c83d5; 5 | --vp-c-green-lighter: #c2b2e5; 6 | --vp-c-green-dark: #6950a3; 7 | --vp-c-green-darker: #5d468e; 8 | --vp-c-green-dimm-1: rgba(138, 99, 210, 0.05); 9 | --vp-c-green-dimm-2: rgba(138, 99, 210, 0.2); 10 | --vp-c-green-dimm-3: rgba(138, 99, 210, 0.5); 11 | } 12 | -------------------------------------------------------------------------------- /docs/developers/guides/writing/submit-messages.md: -------------------------------------------------------------------------------- 1 | # Submit data to the hub 2 | 3 | ::: info Pre-requisites 4 | 5 | - Write access to a hubble instance 6 | - Private key of an account key registered to an fid 7 | - Local typescript development environment 8 | 9 | ::: 10 | 11 | To see a full example of how to submit different kinds of messages to the hub, 12 | see [here](https://github.com/farcasterxyz/hub-monorepo/tree/main/packages/hub-nodejs/examples/write-data) 13 | -------------------------------------------------------------------------------- /docs/examples/contracts/signer.ts: -------------------------------------------------------------------------------- 1 | import * as ed from '@noble/ed25519'; 2 | import { NobleEd25519Signer } from '@farcaster/hub-web'; 3 | 4 | const privateKeyBytes = ed.utils.randomPrivateKey(); 5 | export const accountKey = new NobleEd25519Signer(privateKeyBytes); 6 | 7 | export const getPublicKey = async () => { 8 | const accountKeyResult = await accountKey.getSignerKey(); 9 | if (accountKeyResult.isOk()) { 10 | return accountKeyResult.value; 11 | } 12 | }; 13 | -------------------------------------------------------------------------------- /docs/reference/hubble/httpapi/fids.md: -------------------------------------------------------------------------------- 1 | # Fids API 2 | 3 | ## fids 4 | 5 | Get a list of all the FIDs 6 | 7 | **Query Parameters** 8 | | Parameter | Description | Example | 9 | | --------- | ----------- | ------- | 10 | | | This endpoint accepts no parameters | | 11 | 12 | **Example** 13 | 14 | ```bash 15 | curl http://127.0.0.1:2281/v1/fids 16 | ``` 17 | 18 | **Response** 19 | 20 | ```json 21 | { 22 | "fids": [1, 2, 3, 4, 5, 6], 23 | "nextPageToken": "AAAnEA==" 24 | } 25 | ``` 26 | -------------------------------------------------------------------------------- /docs/examples/contracts/clients.ts: -------------------------------------------------------------------------------- 1 | import { createWalletClient, createPublicClient, custom, http } from 'viem'; 2 | import { privateKeyToAccount } from 'viem/accounts'; 3 | import { optimism } from 'viem/chains'; 4 | 5 | export const publicClient = createPublicClient({ 6 | chain: optimism, 7 | transport: http(), 8 | }); 9 | 10 | export const walletClient = createWalletClient({ 11 | chain: optimism, 12 | transport: custom(window.ethereum), 13 | }); 14 | 15 | // JSON-RPC Account 16 | export const [account] = await walletClient.getAddresses(); 17 | 18 | // Local Account 19 | export const account = privateKeyToAccount('0x...'); 20 | -------------------------------------------------------------------------------- /docs/reference/warpcast/embeds.md: -------------------------------------------------------------------------------- 1 | # Warpcast Embeds Reference 2 | 3 | Warpcast follows the [Open Graph protocol](https://ogp.me) when rendering rich previews for URL embeds. 4 | 5 | Developers can reset existing embed caches on Warpcast at https://warpcast.com/~/developers/embeds. 6 | 7 | #### Additional details 8 | 9 | - Resetting an embed cache, does not reset Open Graph image caches. If you are experiencing a stale image on your Open Graph, change the image file path served as the `og:image`. 10 | - Developers have to be logged in to Warpcast to access this page. 11 | - To render rich previews of NFTs, follow the [Farcaster Frames spec](/reference/frames/spec). 12 | -------------------------------------------------------------------------------- /docs/developers/guides/advanced/query-signups.md: -------------------------------------------------------------------------------- 1 | # Counting signups by day 2 | 3 | ::: info Pre-requisites 4 | 5 | - Read access to a replicator database 6 | 7 | ::: 8 | 9 | To count the number of signups by day, we can use the `chain_events` table to query the number 10 | of [`ID_REGISTER`](/reference/hubble/datatypes/events#onchaineventtype) events 11 | and group by day. 12 | 13 | ```sql 14 | SELECT DATE_TRUNC('day', created_at) AS day, COUNT(*) AS count 15 | FROM chain_events 16 | WHERE type = 3 -- ID_REGISTER (see event types reference page) 17 | GROUP BY day 18 | ORDER BY day desc; 19 | ``` 20 | 21 | For more information on the schema, see the [replicator schema](/reference/replicator/schema). 22 | -------------------------------------------------------------------------------- /docs/reference/index.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | The reference sections documents API's, standards and protocols used commonly used by Farcaster developers. 4 | 5 | - [Frames](/reference/frames/spec) - A specification for writing and rendering frames. 6 | - [Warpcast](/reference/warpcast/api) - An overview of Warpcast APIs that are publicly available. 7 | - [Hubble](/reference/hubble/architecture) - A design overview and API reference for Farcaster Hubs. 8 | - [Replicator](/reference/replicator/schema) - An overview and schema for the replicator. 9 | - [Contracts](/reference/contracts/index) - A design overview and ABI reference for Farcaster contracts. 10 | - [FName Registry](/reference/fname/api) - An overview and API reference for the Farcaster Name Server. 11 | -------------------------------------------------------------------------------- /docs/examples/contracts/metadata.ts: -------------------------------------------------------------------------------- 1 | import { ViemLocalEip712Signer } from '@farcaster/hub-web'; 2 | import { privateKeyToAccount } from 'viem/accounts'; 3 | import { getDeadline } from './helpers.ts'; 4 | import { getPublicKey } from './signer.ts'; 5 | 6 | // App account 7 | export const appAccount = privateKeyToAccount('0x...'); 8 | 9 | const deadline = getDeadline(); 10 | const publicKey = await getPublicKey(); 11 | 12 | export const getMetadata = async () => { 13 | const eip712signer = new ViemLocalEip712Signer(appAccount); 14 | const metadata = await eip712signer.getSignedKeyRequestMetadata({ 15 | requestFid: 9152n, // App fid 16 | key: publicKey, 17 | deadline, 18 | }); 19 | if (metadata.isOk()) { 20 | return metadata.value; 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "www-farcaster-xyz", 3 | "version": "1.0.0", 4 | "main": "index.js", 5 | "license": "UNLICENSED", 6 | "devDependencies": { 7 | "husky": "^8.0.3", 8 | "lint-staged": "^15.2.0", 9 | "prettier": "^2.8.7", 10 | "vitepress": "1.0.0-rc.41" 11 | }, 12 | "scripts": { 13 | "docs:dev": "vitepress dev docs", 14 | "docs:build": "vitepress build docs", 15 | "docs:preview": "vitepress preview docs", 16 | "lint": "prettier --config \"./.prettierrc.yml\" --write \"**/*.{json,md}\"", 17 | "lint:check": "prettier --config \"./.prettierrc.yml\" --check \"**/*.{json,md}\"", 18 | "postinstall": "husky install" 19 | }, 20 | "lint-staged": { 21 | "*.md": "prettier --config \"./.prettierrc.yml\" --write \"**/*.{json,md}\"" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /docs/reference/hubble/httpapi/info.md: -------------------------------------------------------------------------------- 1 | # Info API 2 | 3 | ## info 4 | 5 | Get the Hub's info 6 | 7 | **Query Parameters** 8 | | Parameter | Description | Example | 9 | | --------- | ----------- | ------- | 10 | | dbstats | Whether to return DB stats | `dbstats=1` | 11 | 12 | **Example** 13 | 14 | ```bash 15 | curl http://127.0.0.1:2281/v1/info?dbstats=1 16 | 17 | ``` 18 | 19 | **Response** 20 | 21 | ```json 22 | { 23 | "version": "1.5.5", 24 | "isSyncing": false, 25 | "nickname": "Farcaster Hub", 26 | "rootHash": "fa349603a6c29d27041225261891bc9bc846bccb", 27 | "dbStats": { 28 | "numMessages": 4191203, 29 | "numFidEvents": 20287, 30 | "numFnameEvents": 20179 31 | }, 32 | "peerId": "12D3KooWNr294AH1fviDQxRmQ4K79iFSGoRCWzGspVxPprJUKN47", 33 | "hubOperatorFid": 6833 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /docs/auth-kit/examples.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | ## Client Side 4 | 5 | A frontend-only app which lets users Sign in with Farcaster and shows them their profile picture and username. 6 | 7 |