npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@farcaster-attestation/sdk

v1.0.1

Published

An SDK for onchain Farcaster wallet verification and attestation

Downloads

8

Readme

Farcaster Attestation SDK

Note: This is a beta version of the SDK and is not yet ready for production use. It's intended to be used for auditing and development purposes. It defaults to using Supersim forked OP and Base chains.

An SDK for on-chain Farcaster wallet verification and attestation.

Installation

npm install @farcaster-attestation/sdk

Example Usage

Below is an example of how to use the SDK to perform wallet verification and attestation on supersim forked OP and Base chains.

import { createWalletClient, createPublicClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base, optimism } from "viem/chains";
import { checkFarcasterVerificationOnResolver, farcasterAttest } from "../src";
import { VerificationNotFoundError } from "../src/error";

async function run() {
  // Get wallet and fid from user input
  const verifyingWallet = "0x...";
  const fid = BigInt(...);

  // Create wallet client from private key
  const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);

  const walletClient = createWalletClient({
    account,
    chain: optimism,
    transport: http(),
  });

  // Create public client
  const publicClient = createPublicClient({
    chain: optimism,
    transport: http(),
  });

  // Call farcasterAttest with input FID
  try {
    const hash = await farcasterAttest({
      fid,
      walletAddress: verifyingWallet,
      walletClient,
      publicClient,
      onVerificationAttesting: () => {
        console.log("Starting attestation on Optimism...");
      },
    });

    if (hash) {
      console.log("Wallet verified successfully! Hash:", hash);
    } else {
      console.log("Already verified on resolver");
    }
  } catch (error) {
    if (error instanceof VerificationNotFoundError) {
      console.log("Verification not found on the Farcaster Hub");
      return;
    } else {
      throw error;
    }
  }

  // TODO: Attest your message on EAS as usual
  console.log("TODO: Attest your message on EAS as usual");

  // checkFarcasterVerificationOnResolver
  const isVerified = await checkFarcasterVerificationOnResolver(
    fid,
    verifyingWallet,
    publicClient
  );
  console.log("Is verified on Optimism:", isVerified);
}

This example demonstrates how to:

  1. Initialize Clients: Set up wallet and public clients for different blockchain networks (Optimism and Base).
  2. Perform Verification Attestation: Use the farcasterAttest function to verify a wallet address with a Farcaster ID on the specified network.
  3. Perform Attestation: Call attest function on EAS Contract or using EAS SDK to attest your message as usual. (See this file in our example app for an example)
  4. Check Verification: Utilize the checkFarcasterVerificationOnResolver function to confirm the verification status on the resolver contracts.
  5. Handle Results: Log the outcomes of the attestation and verification processes.

Example Project

  • Source Code: https://github.com/Farcaster-Attestation/farcaster-attestation-chat
  • Live Demo: https://farcaster-attestation-chat.pages.dev