mirror of
https://github.com/farcasterxyz/hub-monorepo.git
synced 2026-01-10 05:38:07 -05:00
## Why is this change needed? Release client library for snapchain 0.3 ## Merge Checklist _Choose all relevant options below by adding an `x` now or at any time before submitting for review_ - [x] PR title adheres to the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) standard - [x] PR has a [changeset](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#35-adding-changesets) - [x] PR has been tagged with a change label(s) (i.e. documentation, feature, bugfix, or chore) - [ ] PR includes [documentation](https://github.com/farcasterxyz/hub-monorepo/blob/main/CONTRIBUTING.md#32-writing-docs) if necessary. <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on updating the versions of various `@farcaster` packages, enhancing features related to the snapchain 0.3 protocol, and adjusting dependencies. ### Detailed summary - Deleted `.changeset/thick-radios-end.md` - Updated `@farcaster/hub-nodejs` to version `0.14.0` - Updated `@farcaster/core` to version `0.17.0` - Updated `@farcaster/hub-web` to version `0.10.0` - Updated version numbers in `package.json` files for `@farcaster/core`, `@farcaster/hub-web`, `@farcaster/shuttle`, and `@farcaster/hub-nodejs` - Added support for snapchain 0.3 protocol features in `CHANGELOG.md` files > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
@farcaster/hub-nodejs
A lightweight, fast Typescript interface for Farcaster Hubs. Designed to work with Hubble and any other Hub that implements the Farcaster protocol.
Features
- Call any Hub endpoint from a NodeJS environment.
- Serializes and deserializes Farcaster protobufs into Javascript objects.
- Has helpers to create and sign Farcaster messages.
- Written entirely in TypeScript, with strict types for safety.
Read the documentation, see more examples or get started with the guide below.
Installation
Install @farcaster/hub-nodejs with the package manager of your choice
npm install @farcaster/hub-nodejs
yarn add @farcaster/hub-nodejs
pnpm install @farcaster/hub-nodejs
Quickstart
Fetching Data from Hubs
import { getSSLHubRpcClient } from '@farcaster/hub-nodejs';
client.$.waitForReady(Date.now() + 5000, async (e) => {
if (e) {
console.error(`Failed to connect to ${hubRpcEndpoint}:`, e);
process.exit(1);
} else {
console.log(`Connected to ${hubRpcEndpoint}`);
const castsResult = await client.getCastsByFid({ fid: 8928 });
castsResult.map((casts) => casts.messages.map((cast) => console.log(cast.data?.castAddBody?.text)));
client.close();
}
});
Documentation
The HTTP API endpoints are documented here.
An OpenAPI spec is provided here.
Contributing
Please see our contributing guidelines before making a pull request.
License
MIT License