Socket
Book a DemoInstallSign in
Socket

@farcaster/js

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@farcaster/js

A lightweight, fast Typescript interface for Farcaster Hubs. Designed to work with [Hubble](https://github.com/farcasterxyz/hubble/) and any other Hub that implements the [Farcaster protocol](https://github.com/farcasterxyz/protocol).

latest
npmnpm
Version
0.3.0
Version published
Maintainers
2
Created
Source

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

FAQs

Package last updated on 12 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts