This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@farcaster/js
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

farcaster.js

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/js with the package manager of your choice

npm install @farcaster/js
yarn add @farcaster/js
pnpm install @farcaster/js

Quickstart

Fetching Data from Hubs

import { Client } from '@farcaster/js';

(async () => {
  // Connect to a known hub using its address of the form <ip_address>:<rpc_port>
  const client = new Client('127.0.0.1:8080');

  // Set the user whose casts we will be fetching
  const fid = 2;

  const castsResult = await client.getCastsByFid(fid);

  if (castsResult.isErr()) {
    console.log('Failed: ', castsResult.error);
  }

  castsResult.map((casts) => casts.map((c) => console.log(`${c.data.body.text}\n`)));
})();

Contributing

Please see our contributing guidelines before making a pull request.

License

MIT License

Readme

Keywords

none

Package Sidebar

Install

npm i @farcaster/js

Weekly Downloads

39

Version

0.3.0

License

MIT

Unpacked Size

3.71 kB

Total Files

5

Last publish

Collaborators

  • wazzymandias
  • ecm_merkle
  • sanjayprabhu
  • adityapk00
  • daddeo
  • varunsrin
  • sds