{"id":28301145,"url":"https://github.com/andrei0x309/farcaster-snapchain-utils","last_synced_at":"2026-05-01T18:31:56.536Z","repository":{"id":288977765,"uuid":"969704431","full_name":"andrei0x309/farcaster-snapchain-utils","owner":"andrei0x309","description":"farcaster-snapchain-utils a library for easy interaction with a snapchain node in read/write mode.","archived":false,"fork":false,"pushed_at":"2025-05-22T19:35:14.000Z","size":67,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-16T07:44:49.445Z","etag":null,"topics":["farcaster","farcaster-library","farcaster-protocol"],"latest_commit_sha":null,"homepage":"https://andrei0x309.gitbook.io/farcaster-snapchain-utils","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrei0x309.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-20T18:46:31.000Z","updated_at":"2025-05-26T00:41:29.000Z","dependencies_parsed_at":"2025-06-16T07:39:33.183Z","dependency_job_id":"cfc7b37f-e736-4cf4-94ee-fb3b1f277430","html_url":"https://github.com/andrei0x309/farcaster-snapchain-utils","commit_stats":null,"previous_names":["andrei0x309/farcaster-snapchain-utils"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/andrei0x309/farcaster-snapchain-utils","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-snapchain-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-snapchain-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-snapchain-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-snapchain-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrei0x309","download_url":"https://codeload.github.com/andrei0x309/farcaster-snapchain-utils/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-snapchain-utils/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32508900,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["farcaster","farcaster-library","farcaster-protocol"],"created_at":"2025-05-23T19:12:29.539Z","updated_at":"2026-05-01T18:31:56.466Z","avatar_url":"https://github.com/andrei0x309.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# farcaster-snapchain-utils\n\n## Description\n\nThis is a library to simplify the interaction with a Farcaster snapchain node.\n\nIt can be used in read-only mode or in read/write mode.\n\nIf you use it in read/write mode, you will need to provide a private key and a FID.\n\nIf a node is not provided, the library will use the Pinata public node.\n\nYou can also use it with Neynar, provided you pass the NEYNAR_API_KEY to the constructor or to changeNode the method.\n\nThe library allows you to change the node or signer, so you don't need to create a new instance every time you want to change the node or signer.\n\n## Full documentation\n\nDocs: [https://andrei0x309.gitbook.io/farcaster-snapchain-utils/](https://andrei0x309.gitbook.io/farcaster-snapchain-utils/)\n\n## Quickstart\n\n### Usage  - read-only with the public node from Pinata\n\n```typescript\nimport { SnapChainClient } from 'farcaster-snapchain-utils'\n\nconst client = SnapChainClient();\n\n// client.method... -\u003e must be a read method only, or it will throw an error\n\n```\n\n### - read-write with your node\n\n```typescript\nimport { SnapChainClient } from 'farcaster-snapchain-utils'\n\nconst userFid = 1791;\n// Example signer must be a valid signer of the FID\nconst signer = \"0x222ab147ccbaa2dc660717f28ea4aaeea13b93fe9df297669efdd12f7c1669df\";\n\nconst client = new SnapChainClient({\n    FID: userFid,\n    PK: signer,\n    NODE_URL: 'hub-grpc.pinata.cloud', // your node domain, ex, node.fosscaster.xyz\n    NODE_USER: '', // node auth user if needed\n    NODE_PASS: '', // node auth password if needed \n}) \n\n// client.method... -\u003e you can call read/write methods like follow / createCast, etc\n\n\n```\n\n### - read-write with Neynar Key\n\n```typescript\nimport { SnapChainClient } from 'farcaster-snapchain-utils'\n\nconst userFid = 1791;\n// Example signer must be a valid signer of the FID\nconst signer = \"0x222ab147ccbaa2dc660717f28ea4aaeea13b93fe9df297669efdd12f7c1669df\";\n// Example of a Neynar api key must be valid\nconst NEYNAR_API_KEY = \"A02E9451-6CFB-25B0-238E-15E18F2264DA\"; \n\nconst clientNeynar = new SnapChainClient({\n    FID: userFid,\n    PK: signer,\n    NEYNAR_API_KEY,\n});\n\n// client.method... -\u003e you can call read/write methods like follow / createCast, etc\n```\n\n### - add/change node later\n\nYou can also add or change either the node or key later, which is useful for avoiding creating multiple instances of `SnapChainClient` if you don't need to.\n\n```typescript\nimport { SnapChainClient } from 'farcaster-snapchain-utils'\n\nconst client = SnapChainClient();\n\n// changed to specific node \nclient.changeNode({\nNODE_URL: 'node.fosscaster.xyz',\nNODE_USER: 'secret-user',\nNODE_PASS: 'secret-pass'\n})\n\n//changed to using Neynar node\nclient.changeNode({\nNEYNAR_API_KEY: 'my-secret-api-key',\n})\n\n```\n\n`changeNode`needs either `NODE_URL` or `NEYNAR_API_KEY` if neither is provided, it will throw an error; if both are provided, it will default to using the Neynar key instead of the node.\\\n\n### - add/change user (signer/fid) later\n\n```typescript\nimport { SnapChainClient } from 'farcaster-snapchain-utils'\n\nconst client = SnapChainClient();\n\n// changed to specific signer\nclient.changeSigner({\nFID: 1791, // a public user fid\n// my secret signer PK\nPK: '0x1111111111111111111111111111111111111111111111111111111111111111' \n})\n\nawait client.follow(3) // follow dwr.eth with user andrei0x309\n\nclient.changeSigner({\nFID: 3, // a public user fid\n// my secret signer PK\nPK: '0x1111111111111111111111111111111111111111111111111111111111111111' \n})\n\nawait client.follow(1791) // follow andrei0x309 with user dwr.eth\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei0x309%2Ffarcaster-snapchain-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrei0x309%2Ffarcaster-snapchain-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei0x309%2Ffarcaster-snapchain-utils/lists"}