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 🙏

© 2024 – Pkg Stats / Ryan Hefner

hd-cli-wallet

v1.5.0

Published

npm lib and CLI app for working with HD wallets

Downloads

13

Readme

hd-cli-wallet

This JavaScript library is several things in one:

  • A Bitcoin Cash (BCH) HD wallet
  • A command line interface (CLI) application
  • A npm library

This app can be run from source to generate wallets, send, and receive BCH. It has hooks to interface with colab-coinjoin-api in order to preserve privacy by anonymizing your BCH using the Collaborative CoinJoin protocol.

This code is also compiled into a the hd-cli-wallet npm library. This library is included into the electron-bch-coinjoin-wallet desktop application, in order to provide a BCH wallet with a graphical user interface (GUI).

NPM Usage

The npm library can be included in your own app to instantly give it the ability to send and receive BCH transactions, including SLP tokens. Here is an example of how to include it in your own app. This example will generate a new HD wallet.

// Instantiate the Create Wallet class from this library.
const CreateWallet = require('hd-cli-wallet')
const createWallet = new CreateWallet()

const walletFile = './wallet.json'

async function makeNewWallet() {
  const wallet = await createWallet.createWallet(walletFile)

  console.log(`wallet: ${JSON.stringify(wallet, null, 2)}`)
}
makeNewWallet()

Node and NPM Versions

This app is tested on the following versions for npm and node.js:

  • npm: v16.19.0
  • node.js: v8.19.3

Install Dev Environment

While this npm library can be used globally, the intended audience is developers familiar with the usage of npm and git. Here is how to set up your own developer environment:

  • Clone this repo with git clone.
  • Install npm dependencies with npm install
  • Execute the commands like this: ./bin/run help

Running the wallet this way, you can edit the behavior of the wallet by making changes to the code in the src/commands directory.

Command Line Usage

$ npm install -g hd-cli-wallet
$ hd-cli-wallet COMMAND
running command...
$ hd-cli-wallet (-v|--version|version)
hd-cli-wallet/1.5.0 linux-x64 node-v16.14.2
$ hd-cli-wallet --help [COMMAND]
USAGE
  $ hd-cli-wallet COMMAND
...

Commands

hd-cli-wallet coinjoin-single

Pariticipate in a single CoinJoin round

USAGE
  $ hd-cli-wallet coinjoin-single

OPTIONS
  -n, --name=name  Name of wallet

DESCRIPTION
  This command will initiate a CoinJoin round, and will exit after a single
  successful round.

See code: src/commands/coinjoin-single.js

hd-cli-wallet create-wallet

Generate a new HD Wallet.

USAGE
  $ hd-cli-wallet create-wallet

OPTIONS
  -d, --description=description  Description of the wallet
  -n, --name=name                Name of wallet
  -t, --testnet                  Create a testnet wallet

See code: src/commands/create-wallet.js

hd-cli-wallet get-address

Generate a new address to recieve BCH.

USAGE
  $ hd-cli-wallet get-address

OPTIONS
  -n, --name=name  Name of wallet
  -s, --slp        Generate a simpledger: token address
  -t, --testnet    Create a testnet wallet

See code: src/commands/get-address.js

hd-cli-wallet help [COMMAND]

display help for hd-cli-wallet

USAGE
  $ hd-cli-wallet help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

hd-cli-wallet list-wallets

List existing wallets.

USAGE
  $ hd-cli-wallet list-wallets

See code: src/commands/list-wallets.js

hd-cli-wallet remove-wallet

Remove an existing wallet.

USAGE
  $ hd-cli-wallet remove-wallet

OPTIONS
  -n, --name=name  Name of wallet

See code: src/commands/remove-wallet.js

hd-cli-wallet send

Send an amount of BCH

USAGE
  $ hd-cli-wallet send

OPTIONS
  -a, --sendAddr=sendAddr  Cash address to send to
  -b, --bch=bch            Quantity in BCH
  -n, --name=name          Name of wallet

See code: src/commands/send.js

hd-cli-wallet send-all

Send all BCH in a wallet to another address. Degrades Privacy

USAGE
  $ hd-cli-wallet send-all

OPTIONS
  -a, --sendAddr=sendAddr  Cash address to send to
  -n, --name=name          Name of wallet

DESCRIPTION
  Send all BCH in a wallet to another address.

  This method has a negative impact on privacy by linking all addresses in a
  wallet. If privacy of a concern, CoinJoin should be used.
  This is a good article describing the privacy concerns:
  https://bit.ly/2TnhdVc

See code: src/commands/send-all.js

hd-cli-wallet split-utxo

Send an amount of BCH

USAGE
  $ hd-cli-wallet split-utxo

OPTIONS
  -n, --name=name  Name of wallet

See code: src/commands/split-utxo.js

hd-cli-wallet update-balances

Poll the network and update the balances of the wallet.

USAGE
  $ hd-cli-wallet update-balances

OPTIONS
  -i, --ignoreTokens  Ignore and burn tokens
  -n, --name=name     Name of wallet

See code: src/commands/update-balances.js