Quickstart
Install
bun add farcaster-snapchain-utilsyarn add farcaster-snapchain-utilsUsage
- read-only with the public node from Pinata
import { SnapChainClient } from 'farcaster-snapchain-utils'
const client = SnapChainClient();
// client.method... -> must be a read method only, or it will throw an error
- read-write with your node
import { SnapChainClient } from 'farcaster-snapchain-utils'
const userFid = 1791;
// Example signer must be a valid signer of the FID
const signer = "0x222ab147ccbaa2dc660717f28ea4aaeea13b93fe9df297669efdd12f7c1669df";
const client = new SnapChainClient({
// FID & PK are needed if you will do write actions on behalf of the user
FID: userFid,
PK: signer,
// your node address, ex, node.fosscaster.xyz you can include the port
NODE_URL: 'hub.merv.fun:3383',
// node auth user if needed
NODE_USER: '',
// node auth password if needed
NODE_PASS: '',
// if node GRPC has SSL, this is optional, will default to true
GRPC_SSL: false
})
// client.method... -> you can call read/write methods like follow / createCast, etc
- read-write with Neynar Key
- add/change node later
- add/change user (signer/fid) later
Last updated