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

@root/merchant-wallet

v1.1.0

Published

> HD Wallet + QR Code Generator

Readme

Merchant Wallet

HD Wallet + QR Code Generator

Generate secure (unique) per-customer Payment Addresses (PubKeyHash) and QR Codes for receiving payments via Digital Cash (Dash, or similar).

    ====== [DASH] (Derived) Public Key Hash ======

       DASH: XcsLKywcU85QginxhJNYibJc3j4Aawa41Q

Use this library and included tools to generate a private key, and an "extended" public key, which will allow you to create payment addresses on your server without storing your private key on your server.

Watch the Video

https://youtu.be/Q01nLQ74xUI

Features

  • QuickStart
    • [x] Get a Wallet and "Extended" Public Key
    • [x] Generate Payment QR Codes
    • [x] Generate WIFs & QR Codes
      (for importing private keys)
  • Config
    • [x] Generate Passphrase
    • [x] Generate XPub Key
  • Tools for Exploring & Debugging
    • [x] Payment Addresses via Private Key & XPub Key
    • [x] QR Codes for Payment Addresses
    • [x] QR Codes (WIF) for Payment import

Usage & QuickStart

npm install --save @root/merchant-wallet

Create XPub Key

"use strict";

require("dotenv").config({ path: ".env" });
require("dotenv").config({ path: ".env.secret" });

let Coins = require("@root/merchant-wallet/lib/coins.json");
let Wallet = require("@root/merchant-wallet").Wallet;

let wallet = Wallet.create(Coins.dash);

// The mnemonic *is* the wallet, more or less
// (it can be used by any wallet app)
let mnemonic = process.env.BASE2048_PASSPHRASE;

let xpubkey = await wallet.xpubKeyFromMnemonic(mnemonic);

Generate Payment Addrs & QR Codes

let index = 0;
let amount = 0.01;

let paymentAddr = await wallet.addrFromXPubKey(xpubKey, index);
let qr = await wallet.qrFromXPubKey(xpubKey, index, amount, { format: "svg" });
let qrAscii = await wallet.qrFromXPubKey(xpubKey, index, amount, {
  format: "ascii",
});

console.info(`Wallet Import Format for Private Key:\n${wifQrAscii}`);
console.info(`${wif}`);

Generate Private Key WIFs & QR Codes

let index = 0;

let wif = await wallet.wifFromMnemonic(mnemonic, index);
let wifQr = await wallet.wifQrFromMnemonic(mnemonic, index, {
  format: "svg",
});
let wifQrAscii = await wallet.wifQrFromMnemonic(mnemonic, index, {
  format: "ascii",
});

console.info(`Wallet Import Format for Private Key:\n${wifQrAscii}`);
console.info(`${wif}`);

Config

See ./example.env.

  1. Add your wallet passphrase (mnemonic) to .env.secret as BASE2048_PASSPHRASE, or generate a new one:
    bash bin/mnemonic-to-secret-env.sh
  2. Add your xpub (extended public) key to .env as XPUB_KEY, or generate it from the existing ENVs:
    bash bin/xpubkey-to-env.sh

Examples

.env:

WALLET_TYPE=dash
XPUB_KEY=xpub6EVfukfarxzs7NhxQbMQybLvsfLDEYrex5SdDsEuZ7oddnPxaLSW4wX9ZAR5zVYSFnxAum6oiSH4CYmLvJrpe75NXNnVuyWGoz9vdNcwGVJ

.env.secret:

BASE2048_PASSPHRASE="peanut valley bargain affair zebra antenna govern bind myth doll weekend elbow"

Exploring & Debugging

git clone https://github.com/therootcompany/merchant-wallet.js.git
pushd ./merchant-wallet.js/

Passphrase (mnemonic) + Extended Public Key (xpub)

# Create a passphrase / mnemonic
bash bin/mnemonic-to-secret-env.sh

# See derived keys
node bin/derive-xpub-key.js

Generate Payment Addresses & QR Codes

  • index should start from 0 and count up sequentially
  • amount is optional for Dash
# node bin/addr-from-xpub.js <customer-index> <amount>
node bin/addr-from-xpub.js 0

Generate Wallet Import Addresses & QR Codes

From the Dash app you can choose "Send" to scan a wallet (private key) and send the money to your primary wallet.

node bin/wif-from-mnemonic.js 0