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

@tonresistor/zkresistor-sdk

v2.0.1

Published

TypeScript SDK for ZKResistor, a trustless ZK privacy pool on TON. Builds messages, generates proofs, reads pool state.

Readme

@tonresistor/zkresistor-sdk

TypeScript SDK for ZKResistor privacy pools on TON.

It reads contract state, reconstructs verified Merkle state, generates Groth16 proofs, and builds protocol messages. It never selects a deployment, signs, or broadcasts; the application supplies the transport, persistence, wallet, and pool policy.

Install

Requires Node.js 20.19 or newer.

npm install @tonresistor/[email protected] @ton/core

Select Pools

No Factory is hardcoded. Applications choose a Factory, filter its registry, or read a known pool directly:

import { Factory, Pool, TonPool } from "@tonresistor/zkresistor-sdk";

const pools = await Factory.listPools(client, factoryAddress);
const visible = pools.filter((pool) =>
  pool.kind === "jetton" &&
  pool.jettonMaster === selectedJettonMaster &&
  allowedPoolAddresses.has(pool.poolAddress),
);

const jettonState = await Pool.readState(client, jettonPoolAddress);
const tonState = await TonPool.readState(client, tonPoolAddress);

For several Factories, call Factory.listPools() for each address and retain the Factory address beside each result.

Protocol Flows

  • prepareDeposit() creates the secret note and deposit inputs. Persist prep.noteString before requesting a wallet signature.
  • finalizeDeposit() creates the insert proof and message.
  • buildWithdraw() synchronizes verified state, creates the withdrawal proof, and returns a wallet-ready message.
  • Message builders return { address, value, payload, queryId }; the SDK never handles private keys.

Withdrawals bind the complete recipient address and verify the exact Pool or TonPool code before proving. relaySafe is true only for this binding. Legacy binding requires explicit legacySelfBroadcastOnly: true and must never be shared with a relayer.

Local State and Transport

Flows use a caller-provided Client and MerkleStateProvider. LocalMerkleStateProvider replays successful on-chain events and checks state against pool heads and sparse roots before exposing paths. Transaction paging uses exclusive { lt, hash } cursors and external-out messages as events.

The depth-20 tree has 1,048,576 slots. Near full capacity, implement MerkleStateProvider over a compact local transactional database; the bundled in-memory provider is a reference implementation.

The SDK does not bundle circuit files. Use the finalized ceremony WASM and proving keys matching the deployed verifier keys.

Development

npm ci
npm run lint
npm test
npm run build

Contracts: TONresistor/zk-resistor-contracts

MIT License. See LICENSE.