Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

writing to Farcaster Snapchain network Oct 2025

s/o 🥩🧆 @meatballs who is, um, hilarious. They asked for guidance on casting from an existing fc account using a local snapchain node.

This repo shows POC of bringing your own signer and writing to the network. It is a stripped-down version of code that was running around April~June 2025 as my daily driver, before and after the Snapchain rollout, when I painted the chain with x402 transactions.

If you want to try x402 with Neynar, provide your EOA private key in src/constants.ts.

Getting Started

Prerequisites

  • Node.js 22.x
  • Bun 1.x (will also work with npm, yarn, pnpm, etc.)

Installing

bun install

update the src/constants.ts file with your own fid and signer_pk

to point to your own node, update its details in src/utils.ts around lines 29:37 and point to it in line 60

add your own code for handling embeds (including quote casts), mentions, channels, etc.

Running

in src/cast.ts, change the text to your own, and flip false to true

bun cast

Overview

The code herein is cobbled from:

  • Farcaster docs
  • healthbot by borodutch
  • x402 api documentation

Project Structure

  • src/cast.ts - A script that publishes a cast to the network
  • src/constants.ts - Constants for the user and the EOA key (optional)
  • src/utils.ts - Utility functions
  • src/use-x402-axios.ts - read/write to the network (incl. x402 payments)
  • package.json - Project configuration
  • tsconfig.json - TypeScript configuration

Discussion on signers

Snapchain will confirm that the signer key belongs to the fid from which you wish to cast.

Easiest way to get a signer private key is to run Cast Keys locally

When using your signer, your casts + activity will show up in Farcaster app as

Sent from [your username]

You may also consider creating a separate Farcaster account for your Snapchain node, and using that new account to create a signer which belongs to your primary account.

Here is an example account that was used to create fun little messages:

https://farcaster.xyz/dansbasement

About

bring your own signer, cast to Snapchain

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages