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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zaiffer/sdk

v0.1.3

Published

SDK for encrypted tokens on FHEVM using Zama's fhEVM technology

Readme

Zaiffer SDK

TypeScript SDK for building encrypted token applications on FHEVM (Fully Homomorphic Encryption).

Features

  • 🔐 Encrypted Token Operations - Wrap, unwrap, and transfer tokens with full privacy
  • ⚛️ React Integration - Ready-to-use hooks for React applications
  • 🔧 Type-Safe - Full TypeScript support with comprehensive type definitions
  • 🚀 Developer Friendly - Simple, intuitive API with great DX
  • 🧪 Well Tested - 760+ tests ensuring reliability
  • 📦 Modular - Use only what you need with tree-shakeable exports

Documentation

Comprehensive documentation is available in the docs/ directory:

Quick Start

Installation

npm install zaiffer-sdk viem wagmi

Node.js Usage

import { initializeSDK, wrapToken } from "zaiffer-sdk";
import { createWalletClient, createPublicClient, http } from "viem";
import { privateKeyToAccount } from "viem/accounts";

// Initialize the SDK
initializeSDK({ network: "sepolia" });

// Create clients
const account = privateKeyToAccount("0x...");
const publicClient = createPublicClient({
  transport: http("https://rpc-url"),
});
const walletClient = createWalletClient({
  account,
  transport: http("https://rpc-url"),
});

// Wrap tokens
const txHash = await wrapToken({
  client: walletClient,
  publicClient,
  wrapperAddress: "0x...",
  amount: 1000000n,
  to: account.address,
});

React Usage

import { ZaifferProvider, useWrapToken } from "zaiffer-sdk/react";
import { WagmiProvider, createConfig, http } from "wagmi";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { sepolia } from "wagmi/chains";

// Configure Wagmi and React Query
const wagmiConfig = createConfig({
  chains: [sepolia],
  transports: { [sepolia.id]: http() },
});
const queryClient = new QueryClient();

function App() {
  return (
    <WagmiProvider config={wagmiConfig}>
      <QueryClientProvider client={queryClient}>
        <ZaifferProvider network="sepolia">
          <TokenManager />
        </ZaifferProvider>
      </QueryClientProvider>
    </WagmiProvider>
  );
}

function TokenManager() {
  const { wrapToken, isLoading } = useWrapToken({
    wrapper: "0x...",
    encryptedToken: "0x...",
  });

  return (
    <button onClick={() => wrapToken(1000000n)} disabled={isLoading}>
      {isLoading ? "Wrapping..." : "Wrap Tokens"}
    </button>
  );
}

Package Structure

The SDK is published with two main exports:

// Core SDK - Node.js and general use
import { initializeSDK, wrapToken, unwrapToken } from "zaiffer-sdk";

// React adapters - React-specific hooks and components
import { ZaifferProvider, useWrapToken, useUnwrap } from "zaiffer-sdk/react";

Core API

SDK Configuration

initializeSDK({ network: "mainnet" | "sepolia" });

Token Operations

// Wrap native tokens to encrypted tokens
wrapToken({ client, publicClient, wrapperAddress, amount, to });

// Unwrap encrypted tokens back to native tokens
unwrapToken({
  client,
  publicClient,
  encryptedTokenAddress,
  wrapperAddress,
  from,
  to,
  handle,
  inputProof,
});

// Finalize unwrap with decryption proof
finalizeUnwrap({
  client,
  publicClient,
  wrapperAddress,
  requestId,
  abiEncodedClearBurnAmounts,
  decryptionProof,
});

// Get encrypted balance
getEncryptedBalance({ client, encryptedTokenAddress, address });

FHEVM Operations

// Create FHEVM instance for encryption/decryption
const instance = await createFhevmInstance("sepolia");

// Encrypt values
const { handles, inputProof } = await encryptValues(contractAddress, [
  100n,
  200n,
]);

// Decrypt handles
const results = await decryptHandles(
  instance,
  handles,
  userAddress,
  signature,
  eip712Data
);

React Hooks

// Token operations
const { wrapToken, isLoading } = useWrapToken({ wrapper, encryptedToken });
const { unwrap } = useUnwrap({ wrapper, encryptedToken });
const { finalizeUnwrap } = useFinalizeUnwrap({ wrapper });

// Query hooks
const { balance } = useGetEncryptedBalance({ encryptedToken, userAddress });

// FHEVM operations
const instance = useFhevmInstance();
const { encrypt } = useEncryptValues();
const { decrypt } = useDecryptHandles();

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with Viem and Wagmi
  • Powered by FHEVM for encrypted computations
  • Developed by the Zaiffer team

Version: 0.1.0 Status: Active Development