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

web3ql-client

v1.2.1

Published

Web3QL client SDK — end-to-end encrypted SQL-like storage on Celo. NaCl encryption, UUPS proxy contracts, full TypeScript. Includes CLI.

Downloads

26

Readme

@web3ql/sdk

TypeScript client SDK for the Web3QL on-chain encrypted database system. End-to-end NaCl encryption — plaintext never touches the chain.

Install

npm install @web3ql/sdk ethers tweetnacl @noble/hashes

Quick start

import { Web3QLClient, EncryptedTableClient, deriveKeypairFromWallet } from '@web3ql/sdk'
import { ethers } from 'ethers'

const provider = new ethers.JsonRpcProvider('https://forno.celo-sepolia.celo-testnet.org')
const wallet   = new ethers.Wallet(process.env.PRIVATE_KEY!, provider)

// Derive keypair — same result as browser Explorer
const keypair = await deriveKeypairFromWallet(wallet)

const client = new Web3QLClient('0x2cfE616062261927fCcC727333d6dD3D5880FDd1', wallet)
const db     = await client.createDatabase('my_app')
const table  = await db.createTable('users', '{"name":"string"}')

const enc = new EncryptedTableClient(table.address, wallet, keypair)
await enc.writeString('user_001', JSON.stringify({ name: 'Alice' }))
const plain = await enc.readString('user_001')  // decrypts on read

Key exports

| Export | Description | |---|---| | Web3QLClient | Top-level: createDatabase(), getUserDatabases() | | DatabaseClient | createTable(), getTable(), listTables() | | EncryptedTableClient | write/read/update/delete + grantAccess() | | TypedTableClient | Prisma-style: create(), findMany(), updateById() | | PublicKeyRegistryClient | register(), getPublicKey(), hasKey() | | deriveKeypairFromWallet(signer) | ✅ Recommended — browser-compatible | | deriveKeypair(privKey) | ⚠️ Deprecated — different keypair from browser |

Key derivation

// Signs 'Web3QL encryption key derivation v1' deterministically
// SHA-256(signature) → X25519 seed → NaCl keypair
// Identical result in browser (MetaMask) and server (ethers Wallet)
const keypair = await deriveKeypairFromWallet(wallet)

Always use deriveKeypairFromWallet so SDK-written records are readable in the Web3QL Cloud Explorer browser UI.

Encryption model

  • Per-record random 32-byte symmetric key → NaCl secretbox (XSalsa20-Poly1305)
  • Symmetric key wrapped per recipient → NaCl box (X25519 ECDH)
  • secretbox blob = [ 24-byte nonce | encrypted(plaintext, symKey) ]
  • key envelope = [ 24-byte nonce | box(symKey, myPriv, recipientPub) ]

Build

cd sdk && pnpm install && pnpm build