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

@blondfrogs/veil-wasm-wrapper

v1.1.0

Published

TypeScript wrapper for Veil blockchain - transaction builder, wallet management, and RPC client using WASM cryptography

Readme

Veil WASM Wrapper

TypeScript wrapper for Veil blockchain - transaction builder, wallet management, and RPC client

npm version License


🎯 Overview

This package provides a comprehensive TypeScript wrapper for the Veil blockchain, enabling transaction building, wallet management, and blockchain interaction in both browser and Node.js environments. Powered by @blondfrogs/secp256k1-wasm - a pure Rust WASM cryptographic library.

Features:

  • ✅ Type-safe TypeScript API
  • ✅ WASM-powered cryptography (no C dependencies!)
  • ✅ Stealth address generation and management
  • ✅ RingCT transaction building
  • ✅ Pedersen commitments & range proofs
  • ✅ MLSAG ring signatures
  • ✅ Wallet key generation and restoration
  • ✅ RPC client for blockchain communication
  • ✅ Output scanning and UTXO management
  • ✅ Transaction serialization/deserialization

📦 Installation

npm install @blondfrogs/veil-wasm-wrapper

This will automatically install the required @blondfrogs/secp256k1-wasm dependency.


🚀 Quick Start

Basic Usage

import { initWasm, createCommitment, generateRangeProof } from '@blondfrogs/veil-wasm-wrapper';

async function example() {
  // Initialize WASM module (call once at startup)
  await initWasm();

  // Create a Pedersen commitment
  const value = 1000000n; // Amount in satoshis
  const blind = crypto.getRandomValues(new Uint8Array(32));
  const commitment = createCommitment(value, blind);

  // Generate a range proof
  const proof = generateRangeProof({
    commitment,
    value,
    blind,
    nonce: commitment, // Use commitment as nonce
  });

  console.log('Proof size:', proof.proof.length, 'bytes');
}

Transaction Building

import { initWasm, createWallet, TransactionBuilder } from '@blondfrogs/veil-wasm-wrapper';

async function sendVeil() {
  await initWasm();

  // Create or restore wallet
  const wallet = createWallet();
  console.log('Address:', wallet.stealthAddress);

  // Build transaction
  const txBuilder = new TransactionBuilder(wallet);
  const result = await txBuilder.send(
    wallet.spendSecret,
    wallet.scanSecret,
    [{ address: 'sv1qqxxx...', amount: 100_000_000n }], // 1 VEIL
    myUTXOs
  );

  console.log('Transaction ID:', result.txid);
  console.log('Fee:', result.fee);
}

📚 API Reference

See API.md for complete documentation.

Quick reference:

Wallet Management

  • createWallet() - Create new wallet
  • restoreWallet() - Restore from keys
  • validateAddress() - Validate stealth addresses

Transaction Building

  • TransactionBuilder - Build RingCT transactions
  • fetchDecoyOutputs() - Get decoys for ring signatures

Scanning

  • scanTransaction() - Scan for your outputs
  • parseWatchOnlyTransactions() - Parse watch-only RPC data

RPC Client

  • RpcRequester - Interact with Veil nodes
  • checkKeyImages() - Check spent status

Cryptography

  • createCommitment() - Pedersen commitments
  • generateRangeProof() - Bulletproofs
  • rewindRangeProof() - Extract values
  • generateKeyImage() - Prevent double-spending

🧪 Examples

See the examples/ directory for complete working examples:

  • create-wallet.ts - Wallet creation
  • build-transaction.ts - Transaction building
  • scan-outputs.ts - Blockchain scanning
  • blockchain-integration.ts - RPC usage

🛠️ Development

Build

npm run build

Test

npm test
npm run test:watch

Lint

npm run lint

⚠️ Security Warning

⚠️ USE AT YOUR OWN RISK ⚠️

This library has not been formally audited. Use caution with real funds.


🤝 Contributing

Contributions welcome! Please open an issue or submit a pull request.


📄 License

MIT License - See LICENSE file for details


🔗 Links


Built with 🦀 Rust + TypeScript for the Veil community