{"id":15427712,"url":"https://github.com/andrei0x309/farcaster-hub-utils","last_synced_at":"2025-04-19T16:34:13.583Z","repository":{"id":247325466,"uuid":"825214943","full_name":"andrei0x309/farcaster-hub-utils","owner":"andrei0x309","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-16T08:55:02.000Z","size":151,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-16T11:28:09.978Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"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":null,"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":"2024-07-07T06:21:38.000Z","updated_at":"2025-04-16T08:55:04.000Z","dependencies_parsed_at":"2024-07-08T05:19:53.842Z","dependency_job_id":"5fb958e9-50f6-4552-82f5-3ac9b82d25f3","html_url":"https://github.com/andrei0x309/farcaster-hub-utils","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"0b8044bcfea29709fa3467aa1e3ec2e54e37dbd3"},"previous_names":["andrei0x309/farcaster-hub-utils"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-hub-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-hub-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-hub-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrei0x309%2Ffarcaster-hub-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrei0x309","download_url":"https://codeload.github.com/andrei0x309/farcaster-hub-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249245835,"owners_count":21236938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-01T18:01:14.360Z","updated_at":"2025-04-19T16:34:13.576Z","avatar_url":"https://github.com/andrei0x309.png","language":"TypeScript","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"## farcaster-hub-utils\n\nSimple library to simplify the interaction with the Farcaster Hub.\nWorks with a private an authorized signer key and account fid.\n\n### Basic Usage\n\n```typescript\nimport { FCHubUtils } from 'farcaster-hub-utils';\nimport { PK, FID, HUB_URL, HUB_USER, HUB_PASS } from './secret';\n\nconst fcHubUtils = new FCHubUtils(PK, FID, HUB_URL?, HUB_USER?, HUB_PASS?);\n\n// Invoke some interaction with the hub\n\nconst castText = 'Hello World!';\n\nfcHubUtils.createFarcasterPost({\n    content: castText,\n})\n\n```\n\n### Available Methods\n\n#### Methods user should use\n\n- `createFarcasterPost` - Create a new cast\n- `createCast` - Alias for `createFarcasterPost`\n- `deleteCast` - Delete a cast\n- `getCastsByFid` - Get casts for feed in a specific time range, time range can be used to paginate\n- `changeHub` - Change The instance to use a different hub (useful for balancing)\n- `changeSigner` - Change The instance to use a different signer (useful to switch between accounts and conserve memory)\n- `addLike` - Add a like to a cast\n- `removeLike` - Remove a like from a cast\n- `addRecast` - Add a recast to a cast\n- `removeRecast` - Remove a recast from a cast\n- `getFidFromUsername` - Get the fid from a username\n- `getCastFromHash` - Get a specific cast by hash and fid\n\n**Note 1:** The `createFarcasterPost` method is an alias for `createCast`\n\n**Note 2:** Also check [Changelog](./CHANGELOG.md) for more methods\n\n#### Internal Methods ( lower level )\n\n- `publishCast` - Publish a cast to the hub\n- `byteLength` - Get the byte length of a string\n- `parseEmbeds` - Parse embeds from a string as { url: string }[]\n- `parseFarcasterMentions` - Parse mentions from a string as { mentions, mentionsPositions, mentionsText }\n- `addReaction` - Lower level method to add a reaction to a cast\n- `removeReaction` - Lower level method to remove a reaction from a cast\n\n\n### Changelog\n\n[Changelog](./CHANGELOG.md)\n\n### Notes\n\n- The `PK` is the private key of the signer.\n- The `FID` is the account fid.\n- HUB_URL, HUB_USER, HUB_PASS are optional parameters to connect to the hub, if not provided, an public hub will be used.\n- creating cast methods support, posting to channels, and replying to posts and post media if you have supported media public urls.\n\n### Upcoming Features\n\n- add more features\n- add more tests\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei0x309%2Ffarcaster-hub-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrei0x309%2Ffarcaster-hub-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrei0x309%2Ffarcaster-hub-utils/lists"}