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

@avalabs/crypto-wasm

v0.3.1

Published

WebAssembly build of avalabs-crypto-core. Ships a single-file JS bundle (wasm inlined as base64) plus a thin TypeScript wrapper exposing pubkey-only batched address derivation for the web app, Chrome extension, and Node. Most callers should depend on @ava

Readme

@avalabs/crypto-wasm

WebAssembly build of @avalabs/crypto-core. Ships:

  • dist/index.{js,cjs,d.ts,d.cts} — thin TypeScript wrapper exposing the pubkey-only public surface documented under API below.
  • dist/crypto.js — Emscripten loader with the WASM binary base64- inlined inside it (single artifact, MV3 extension-safe). When built with CRYPTO_WASM_SINGLE_FILE=OFF, also emits dist/crypto.wasm next to it for web-app builds that prefer streaming compile + a smaller bundle.

Most callers should depend on @avalabs/crypto-sdk instead — it routes to this package on web / extension / Node (via the browser / import exports conditions) and to @avalabs/crypto-nitro on React Native. The direct exports on this package carry @deprecated JSDoc hints to nudge consumers toward the unified entry point.

Build prerequisites

The build needs Emscripten (emcc, emcmake, emmake) on $PATH. libsecp256k1 is vendored on demand into packages-internal/crypto-core/deps/secp256k1 by scripts/build-wasm.sh — no separate setup step needed for a clean checkout.

# One-time emsdk setup (if not already installed)
~/emsdk/emsdk install latest
~/emsdk/emsdk activate latest
source ~/emsdk/emsdk_env.sh

Build

pnpm --filter @avalabs/crypto-wasm run build

Runs the TypeScript wrapper build (tsdown) and the WASM build (scripts/build-wasm.sh). The WASM build:

  1. Sources ~/emsdk/emsdk_env.sh if EMSDK isn't already exported.
  2. Vendors libsecp256k1 into packages-internal/crypto-core/deps/secp256k1 if missing.
  3. emcmake cmake against CMakeLists.txt, which transitively includes packages-internal/crypto-core/CMakeLists.txt.
  4. emmake make -j compiles the artifacts.
  5. Copies them into dist/ (and into src/ so tsdown can resolve import createCryptoModule from './crypto.js' at TypeScript-bundle time).

Override the artifact mode with:

CRYPTO_WASM_SINGLE_FILE=OFF pnpm --filter @avalabs/crypto-wasm run build:wasm

API

ℹ️ Most consumers should import these from @avalabs/crypto-sdk — same signatures, but the SDK picks the right backend (nitro on React Native, this package elsewhere) at bundle time. The direct exports below carry @deprecated JSDoc tags.

import {
  init,
  deriveAddressesFromXpubs,
  deriveAddressesForEvm,
  deriveAddressesForSvm,
  deriveAddressesForBtc,
  deriveAddressesForAvalanche,
  MAX_BATCH_SIZE,
  type DerivedSecp256k1Addresses,
  type DerivedAvalancheAddresses,
} from '@avalabs/crypto-wasm';

// 1. Load the WASM module. Required once before any derive*() call.
//    Idempotent — repeated invocations re-use the cached promise.
await init();

// 2. Xpub-driven batch derivation (Ledger / watch-only flow).
//    `avalancheXpubs[i]` and `accountIndices[i]` pair up.
const rows: DerivedSecp256k1Addresses[] = await deriveAddressesFromXpubs(
  'xpub...',                  // EVM xpub at m/44'/60'/0'
  ['xpub...', 'xpub...'],     // Avalanche xpubs (one per account)
  false,                      // isTestnet
  [0, 1],                     // account indices
);
// rows[i] === { accountIndex, evm, btc, avm, pvm, coreEth }

// 3. Per-chain encoders for batches of already-derived pubkeys.
//    Each accepts Uint8Array | ArrayBuffer per element; the wrapper
//    takes a tight copy at the boundary, so slices of a larger buffer
//    work correctly.
const evmAddrs = await deriveAddressesForEvm(compressedSecp256k1PubKeys33);
const btcAddrs = await deriveAddressesForBtc(compressedSecp256k1PubKeys33, false);
const svmAddrs = await deriveAddressesForSvm(ed25519PubKeys32);
const avaxBundles: DerivedAvalancheAddresses[] =
  await deriveAddressesForAvalanche(
    compressedAvaxPubKeys33,   // drives X- / P-
    compressedEvmPubKeys33,    // drives C-
    false,                     // isTestnet
  );
// avaxBundles[i] === { x, p, coreEth }

// Hard upper bound on items per batch (currently 1024). Re-exported so
// callers can chunk deterministically instead of catching `RangeError`.
console.log(MAX_BATCH_SIZE);

What's not in the surface here

signSchnorr, verifySchnorr, sign, verify, getPublicKey*, getExtendedPublicKey, and pointAddScalar currently exist only in @avalabs/crypto-nitro. Adding them here is a follow-up — track via the crypto-wasm milestone.