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

@glasel/client

v0.2.0

Published

TypeScript client SDK for the Glasel Network — confidential computing on Base. X25519 + Rescue encryption and computation lifecycle helpers.

Readme

@glasel/client — Glasel Network SDK (Phase 2)

TypeScript client + encryption stack for the Glasel Network (§6, §8.2 of the architecture). Runs on Bun.

What's here

| Module | Responsibility | |--------|----------------| | src/field.ts | F_p arithmetic over p = 2²⁵⁵−19 + element/byte serialization | | src/rescue.ts | Rescue-Prime permutation, sponge KDF, CTR-mode stream cipher | | src/x25519.ts | X25519 keygen + ECDH (→ field element for the KDF) | | src/crypto.ts | encrypt / decrypt / seal — ECDH + KDF + CTR | | src/codec.ts | Typed value ↔ field-element codec; encInputs wire format | | src/client.ts | GlaselClient — cluster key reads, encrypt, watch, decrypt (viem) | | src/abi.ts | Minimal read ABIs + ComputationStatus |

Quick start

import { GlaselClient, ORDER_SCHEMA } from "@glasel/client";

const client = new GlaselClient({ publicClient, addresses: { coordinator, clusterManager, mxeFactory } });

const clusterKey = await client.getClusterPublicKeyForMXE(mxeId);
const { encInputs } = client.encrypt({
  schema: ORDER_SCHEMA,
  value: { price: 1000n, quantity: 5n, side: false, buyerKey },
  clusterKey,
});
// submit encInputs via your app contract, then:
const result = await client.watchComputation({ computationId });
if (result.success) {
  const trade = client.decryptResult({ encResult: result.encResult, privateKey, schema: ORDER_SCHEMA });
}

Tests

bun install
bun test            # 24 unit tests: field, rescue/CTR, ECDH, seal, codec, wire format
bun run typecheck
bun run scripts/e2e.ts   # cross-stack: deploys to anvil, runs full lifecycle, SDK reads+decrypts (needs forge+anvil)

The e2e (scripts/e2e.ts) deploys the contracts with forge script Deploy, then drives propose→activate→commission→submit from viem (reading each id from its event, signing with EIP-191 to match the contract's toEthSignedMessageHash), and finally uses GlaselClient to read the cluster key, watch the computation, and decrypt the on-chain result — 9 assertions, all green.

Design note — Rescue cipher

This is a self-consistent Rescue-Prime instantiation: the MDS matrix (Cauchy) and round constants are generated deterministically from a domain-separated seed, so the SDK and the (future) node implementation agree exactly. Arcium's published constant set is not fully public; swapping it in is a drop-in change since the algorithmic structure (α-S-box, inverse-S-box, MDS, sponge, CTR) is unchanged. See the header of src/rescue.ts.