Files
hub-monorepo/packages/hub-nodejs
Sanjay 94eba62b91 feat: Update protos to support new storage unit type in snapchain v0.4.0 (#2625)
## Why is this change needed?

Update protos to support new storage unit type in snapchain v0.4.0

## 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 versioning of various packages,
enhancing the `StorageUnitType` enumeration with a new type, and
updating dependencies across the project. It also includes changes to
configuration files for better package management.

### Detailed summary
- Updated `@farcaster/core` version to `0.18.3`.
- Updated `@farcaster/hub-nodejs` version to `0.15.3`.
- Updated `@farcaster/hub-web` version to `0.11.3`.
- Added `UNIT_TYPE_2025` to `StorageUnitType` in multiple files.
- Updated changelogs for `core`, `hub-web`, and `hub-nodejs`.
- Updated `PROTO_REV` in `generate-protos.sh`.
- Added `overrides` in `pnpm-workspace.yaml` and `pnpm-lock.yaml`.

>  Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
2025-07-09 17:50:35 -07:00
..

@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