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 🙏

© 2025 – Pkg Stats / Ryan Hefner

chia-wallet-sdk-bundle

v0.30.0

Published

WASM bindings for the Chia Wallet SDK - Universal bundle compatible with both Node.js and web environments.

Readme

Chia Wallet SDK - WASM (Universal Bundle)

npm version License: Apache-2.0

WebAssembly (WASM) bindings for the Chia Wallet SDK, designed for universal compatibility with both Node.js and web environments.

Installation

npm install chia-wallet-sdk-bundle

Usage

Usage in Node.js

No special setup is required. You can import and use the module like any regular JavaScript library:

import { Clvm, Simulator, PublicKey, fromHex, toHex } from 'chia-wallet-sdk-bundle';

// Create a new CLVM instance
const clvm = new Clvm();

// Create a simulator for testing
const simulator = new Simulator();

// Generate a test wallet
const alice = simulator.bls(1n);
console.log('Public Key:', toHex(alice.pk.toBytes()));
console.log('Puzzle Hash:', toHex(alice.puzzleHash));

Usage in the Browser (with Vite)

By default, Vite does not support WebAssembly ESM integration out of the box. To use this package directly in a Vite frontend project, simply add the official vite-plugin-wasm plugin:

1. Install the plugin

npm install -D vite-plugin-wasm

2. Enable it in your vite.config.ts

import { defineConfig } from 'vite';
import wasm from 'vite-plugin-wasm';

export default defineConfig({
  plugins: [wasm()],
});

3. Import and use the SDK directly

import { Clvm, Simulator, PublicKey, fromHex, toHex } from 'chia-wallet-sdk-bundle';

// Create a new CLVM instance
const clvm = new Clvm();

// Create a simulator for testing
const simulator = new Simulator();

// Generate a test wallet
const alice = simulator.bls(1n);
console.log('Public Key:', toHex(alice.pk.toBytes()));
console.log('Puzzle Hash:', toHex(alice.puzzleHash));

Address Operations

import { Address } from 'chia-wallet-sdk-bundle';

// Create an address from puzzle hash
const puzzleHash = fromHex("aca490e9f3ebcafa3d5342d347db2703b31029511f5b40c11441af1c961f6585");
const address = new Address(puzzleHash, "xch");
const encodedAddress = address.encode();
console.log('XCH Address:', encodedAddress);

// Decode an address
const decodedAddress = Address.decode(encodedAddress);
console.log('Decoded puzzle hash:', toHex(decodedAddress.puzzleHash));

Coin Operations

import { Coin } from 'chia-wallet-sdk-bundle';

// Create a coin
const parentCoinId = fromHex("4bf5122f344554c53bde2ebb8cd2b7e3d1600ad631c385a5d7cce23c7785459a");
const puzzleHash = fromHex("dbc1b4c900ffe48d575b5da5c638040125f65db0fe3e24494b76ea986457d986");
const amount = 100n;

const coin = new Coin(parentCoinId, puzzleHash, amount);
const coinId = coin.coinId();
console.log('Coin ID:', toHex(coinId));

CLVM Operations

// Allocate different types of values
const nil = clvm.nil();
const number = clvm.alloc(42);
const bigNumber = clvm.alloc(100n);
const string = clvm.alloc("Hello, Chia!");
const bytes = clvm.alloc(fromHex("deadbeef"));
const boolean = clvm.alloc(true);

// Create pairs and lists
const pair = clvm.pair(number, string);
const list = clvm.alloc([1, 2, 3, "test", true]);

// Serialize and deserialize
const serialized = list.serialize();
const deserialized = clvm.deserialize(serialized);

NFT Operations

import { NftMetadata, NftMint, Constants } from 'chia-wallet-sdk-bundle';

// Create NFT metadata
const metadata = new NftMetadata(
    1n, // edition number
    1n, // edition total
    ["https://example.com/image.png"], // image URIs
    null, // image hash
    ["https://example.com/"], // external URIs
    null, // external hash
    ["https://example.com/description"], // description URIs
    null // description hash
);

// Mint NFTs
const result = clvm.mintNfts(alice.coin.coinId(), [
    new NftMint(
        clvm.nftMetadata(metadata),
        Constants.nftMetadataUpdaterDefaultHash(),
        alice.puzzleHash,
        alice.puzzleHash,
        300 // fee
    )
]);

Universal Compatibility

This package is designed to work in:

  • Node.js environments (16.0.0+)
  • Web browsers with WebAssembly and ES6 Modules support
  • Bundlers (webpack, vite, rollup, etc.)

Development

Building from Source

# Install dependencies
npm install

# Build the universal bundle
npm run build:bundle

Testing

# Run tests
npm test

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

Credits

Special thanks to:

Related Projects