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

bch-cli-wallet

v1.5.0

Published

A command line wallet for Bitcoin Cash, built with BITBOX

Downloads

97

Readme

bch-cli-wallet

This is an npm library and Bitcoin Cash (BCH) wallet that runs on the command line. Add this library to your app to instantly give it the ability to transact on the BCH network!

This project has the following goals:

  • Create a code base for a wallet that is easily forkable and extensible by JavaScript developers.
  • Explore the potential for bounty-tagged development

If you want a wallet with a graphical user interface, check out Badger Wallet. BCH functionality is implemented in both wallets with BITBOX, and the command line interface for this project is built with oclif.

Also, be sure to check out the design decisions and trade-offs that went into the creation of this project in the docs directory

Build Status Coverage Status semantic-release Greenkeeper badge

NPM Usage

The npm library can be included in your own app to instantly give it the ability to send and receive BCH transactions. 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('bch-cli-wallet/src/commands/create-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()

Command Line Usage

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

Commands

bch-cli-wallet create-wallet

Generate a new HD Wallet.

USAGE
  $ bch-cli-wallet create-wallet

OPTIONS
  -n, --name=name  Name of wallet
  -t, --testnet    Create a testnet wallet

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

bch-cli-wallet get-address

Generate a new address to recieve BCH.

USAGE
  $ bch-cli-wallet get-address

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

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

bch-cli-wallet get-key

Generate a new private/public key pair.

USAGE
  $ bch-cli-wallet get-key

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

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

bch-cli-wallet hello

Example command from oclif

USAGE
  $ bch-cli-wallet hello

OPTIONS
  -n, --name=name  name to print

DESCRIPTION
  ...
  Leaving it here for future reference in development.

See code: src/commands/hello.js

bch-cli-wallet help [COMMAND]

display help for bch-cli-wallet

USAGE
  $ bch-cli-wallet help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

bch-cli-wallet list-wallets

List existing wallets.

USAGE
  $ bch-cli-wallet list-wallets

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

bch-cli-wallet remove-wallet

Remove an existing wallet.

USAGE
  $ bch-cli-wallet remove-wallet

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

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

bch-cli-wallet send

Send an amount of BCH

USAGE
  $ bch-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

bch-cli-wallet send-all

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

USAGE
  $ bch-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. **Degrades Privacy**
  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

bch-cli-wallet sweep

Sweep a private key

USAGE
  $ bch-cli-wallet sweep

OPTIONS
  -a, --address=address  Address to sweep funds to.
  -b, --balanceOnly      Balance only, no claim.
  -t, --testnet          Testnet
  -w, --wif=wif          WIF private key

DESCRIPTION
  ...
  Sweeps a private key in WIF format.

See code: src/commands/sweep.js

bch-cli-wallet update-balances

Poll the network and update the balances of the wallet.

USAGE
  $ bch-cli-wallet update-balances

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

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