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

@starknetfoundation/krusty-kms-wasm

v2.0.0

Published

WASM bindings for krusty-kms account and protocol utilities

Readme

@starknetfoundation/krusty-kms-wasm

Browser-focused WebAssembly bindings for Krusty KMS account, signing, hashing, and Starknet utilities.

Install

npm install @starknetfoundation/krusty-kms-wasm

Use

Initialize the module before calling its exports:

import init, {
  getVersion,
  poseidonHash,
} from "@starknetfoundation/krusty-kms-wasm";

await init();

console.log(getVersion());
console.log(poseidonHash("0x1", "0x2"));

Felt inputs

Felt arguments accept decimal digit strings ("1000" means one thousand) or 0x/0X-prefixed hexadecimal strings ("0x1000" means 4096). This applies to felt values in compileCalls, transaction hashes, account addresses, signing, hashing, point coordinates, and proof inputs. Unprefixed hexadecimal text such as "abcd", whitespace, and values outside the Stark field are rejected. encodeFelt also accepts booleans and surrounding whitespace. Byte strings and Nostr identifiers have their own documented formats.

Behavior change: Earlier versions silently read unprefixed digit strings as hexadecimal in most exports. Callers that intended hexadecimal must add 0x; callers that intended decimal can keep their digit strings.

Run init() once and share its promise. Once init() has resolved, calling it again returns the same instance, but two calls that overlap (the second starting while the first is still loading) each instantiate the module. The one that finishes last replaces the instance under every object created on the other: their getters fail with RuntimeError: Out of bounds memory access, and their frees can release objects the new instance has since created.

// krusty.ts: the one place that initializes the module
import init from "@starknetfoundation/krusty-kms-wasm";

export const krustyReady = init();

signNostrMessage(privateKey, messageHex) signs the decoded message bytes directly with deterministic BIP-340 (aux_rand = 0); it does not hash the message first. For Nostr events, compute the canonical 32-byte event id and pass it to signNostrEventId.

Secrets

Exports that take a secret (mnemonic, passphrase, password, private key, seed, symmetric key, plaintext) wipe their WASM copy of it when the call returns. They cannot wipe your JavaScript string, and a non-ASCII string can leave a partial copy in freed WASM memory. Secrets an export returns (derived or decrypted keys, mnemonics, plaintexts, viewing keys) are plain JavaScript strings: keep them out of logs and persistent storage.

This package is generated with wasm-pack --target web and is intended for browser-oriented ESM toolchains that support loading WebAssembly modules.

This package takes the Krusty workspace version and is supported for production use on the stable 2.x line. Its JavaScript exports follow semantic versioning: removing or changing an export waits for a new major version. Security fixes go to the latest 2.x release; see SECURITY.md in the repository for how to report a vulnerability.

License

MIT OR Apache-2.0