psf-bch-wallet

October 16, 2024 ยท View on GitHub

This is a fork of the original psf-bch-wallet code base taken on 8/16/24, preserving the code and git history.

The scope of psf-bch-wallet was growing too large, and it was stuck in a CommonJS code base. The decision was made to start it from scratch and manually port the old code to the new code base. This repository is an archival copy of that old code base.


This is a command-line (CLI) app for working with the Bitcoin Cash (BCH) blockchain, and SLP tokens.

This app connects to a ipfs-bch-wallet-service over IPFS, using the ipfs-coord library. This app uses the oclif CLI framework.

This app is intended for developers who want to work with the BCH blockchain. It's an integral part of the Cash Stack.

How-To Videos

Install

  • git clone this repository.
  • npm install dependencies.
  • ./bin/run help to see a list of available commands.
  • ./bin/run wallet-create to create a wallet. Wallet files are stored in the .wallets directory.

Configuration

The ./bin/run conf command is used to set various configuration settings.

Blockchain Access

By default, this app uses free-bch.fullstack.cash as its back-end service for working with the BCH blockchain. That back-end service is simply a copy of ipfs-bch-wallet-consumer. By running your own copy of ipfs-bch-wallet-consumer, you can have greater reliability and can use this app to switch between different Cash Stack global back-ends. If free-bch.fullstack.cash goes down for some reason, running your own instance of ipfs-bch-wallet-consumer allows you to easily switch to any functional back end on the internet.

Switch to a local instance of ipfs-bch-wallet-consumer:

  • ./bin/run conf -k restURL -v http://localhost:5005
  • ./bin/run conf -k interface -v consumer-api

Switch back to free-bch.fullstack.cash:

  • ./bin/run conf -k restURL -v https://free-bch.fullstack.cash

Switch to using the web2 infrastructure with FullStack.cash:

  • ./bin/run conf -k restURL -v http://api.fullstack.cash/v5/
  • ./bin/run conf -k interface -v rest-api

Explore the other configuration settings:

  • ./bin/run conf

Advanced Commands

Because of the wide-range of applications and commands that psf-bch-wallet can interact with, some application-specific commands are hidden by default. This is an attempt to prevent new users from feeling overwhelmed. By default, these commands are not shown when running ./bin/run help. Setting their config value to true will cause them to show up in the help.

IPFS Diagnostics

When running your own instance of ipfs-bch-wallet-consumer, you will want to enable the ipfs-* commands. They will allow diagnostics and configuration of the IPFS node.

  • ./bin/run conf -k cmdIpfs -v true

Governance Voting

The PSF Governance vote can be initiated with the vote-* commands. These commands are not needed by normal users, so they are hidden by default.

  • ./bin/run conf -k cmdVote -v true

Minting Council

Members of the PSF Minting Council hold an NFT which allows them to participate in multisignature wallets. They can use the mc-* commands to interact with the multisig wallet. These commands are not needed by normal users, so they are hidden by default.

  • ./bin/run conf -k cmdMc -v true

License

MIT

Credit

Table of Contents

Usage

$ npm install
$ ./bin/run [COMMAND] --help
$ ./bin/run COMMAND

Commands

In the commands below, replace psf-bch-wallet with ./bin/run.

psf-bch-wallet conf [KEY] [VALUE]

manage configuration

USAGE
  $ psf-bch-wallet conf [KEY] [VALUE] [-h] [-k <value>] [-v <value>] [-d] [-p <value>] [-n <value>] [-d <value>]

ARGUMENTS
  KEY    key of the config
  VALUE  value of the config

FLAGS
  -d, --cwd=<value>      config file location
  -d, --delete           delete?
  -h, --help             show CLI help
  -k, --key=<value>      key of the config
  -n, --name=<value>     config file name
  -p, --project=<value>  project name
  -v, --value=<value>    value of the config

DESCRIPTION
  manage configuration

See code: conf-cli

psf-bch-wallet help [COMMAND]

display help for psf-bch-wallet

USAGE
  $ psf-bch-wallet help [COMMAND] [--all]

ARGUMENTS
  COMMAND  command to show help for

FLAGS
  --all  see all commands in CLI

DESCRIPTION
  display help for psf-bch-wallet

See code: @oclif/plugin-help

psf-bch-wallet ipfs-connect

Connect to an IPFS peer

USAGE
  $ psf-bch-wallet ipfs-connect [-m <value>] [-d]

FLAGS
  -d, --getDetails         include details about the connection
  -m, --multiaddr=<value>  multiaddr to connect to an IPFS node

DESCRIPTION
  Connect to an IPFS peer

See code: src/commands/ipfs-connect.js

psf-bch-wallet ipfs-node

Query the state of the IPFS node

USAGE
  $ psf-bch-wallet ipfs-node

DESCRIPTION
  Query the state of the IPFS node

See code: src/commands/ipfs-node.js

psf-bch-wallet ipfs-peers

Query the state of subnet peers

USAGE
  $ psf-bch-wallet ipfs-peers [-a]

FLAGS
  -a, --all  Display all data about peers

DESCRIPTION
  Query the state of subnet peers

See code: src/commands/ipfs-peers.js

psf-bch-wallet ipfs-relays

Query the state of circuit relays

USAGE
  $ psf-bch-wallet ipfs-relays

DESCRIPTION
  Query the state of circuit relays

See code: src/commands/ipfs-relays.js

psf-bch-wallet ipfs-status

Query the state of the IPFS node

USAGE
  $ psf-bch-wallet ipfs-status

DESCRIPTION
  Query the state of the IPFS node

See code: src/commands/ipfs-status.js

psf-bch-wallet mc-collect-keys

Collect Voting Addresses

USAGE
  $ psf-bch-wallet mc-collect-keys

DESCRIPTION
  Collect Voting Addresses

  This command is run to prepare for a governance vote. It looks up the addresses
  holding all NFTs tied to a common group token. This list of addresses can
  then be used to air-drop voting tokens.

See code: src/commands/mc-collect-keys.js

psf-bch-wallet mc-finish

Retrieve signatures, sign multisig TX, and broadcast

USAGE
  $ psf-bch-wallet mc-finish [-n <value>] [-a <value>]

FLAGS
  -a, --txids=<value>  Array of TXIDs of messages containing signatures
  -n, --name=<value>   Name of wallet

DESCRIPTION
  Retrieve signatures, sign multisig TX, and broadcast

  This command expects a JSON string containing an array of transaction IDs (TXIDs)
  that contain e2ee messages containing signatures for the transaction generated
  by the mc-update-p2wdb-price command.

See code: src/commands/mc-finish.js

psf-bch-wallet mc-p2wdb-approval-tx

Generate a multsig TX for the Minting Council to update the price of P2WDB writes.

USAGE
  $ psf-bch-wallet mc-p2wdb-approval-tx [-n <value>] [-s <value>] [-m <value>] [-t <value>]

FLAGS
  -m, --message=<value>  Message attached to transaction sent to each NFT holder.
  -n, --name=<value>     Name of wallet paying to send messages to NFT holders
  -s, --subject=<value>  Subject of e2ee message.
  -t, --txid=<value>     TXID of the update transaction generated from the mc-update-tx command.

DESCRIPTION
  Generate a multsig TX for the Minting Council to update the price of P2WDB writes.

  This command creates a multisig wallet. As input, it takes address-public-key
  pairs generated from the multisig-collect-keys command. It uses that
  data to construct a P2SH multisig wallet. The wallet object is displayed
  on the command line as the output.

  This is a long-running command. It does the following:
  - It calls the mc-collect-keys commands to get the public keys for each holder of the Minting Council NFT.
  - It generates a multisignature wallet from those keys requiring 50% + 1 signers.
  - It generates a transaction for spending from the wallet, attaching an OP_RETURN to approve an update to the P2WDB write price.
  - It sends the unsigned transaction to each member of the Minting Council.

See code: src/commands/mc-p2wdb-approval-tx.js

psf-bch-wallet mc-p2wdb-update-tx

Generate a PS009 Update Transaction to update the P2WDB write price

USAGE
  $ psf-bch-wallet mc-p2wdb-update-tx [-n <value>]

FLAGS
  -n, --name=<value>  Name of wallet paying to send messages to NFT holders

DESCRIPTION
  Generate a PS009 Update Transaction to update the P2WDB write price

  This command generates an 'Update Transaction' as per PS009 specification:
  https://github.com/Permissionless-Software-Foundation/specifications/blob/master/ps009-multisig-approval.md

  This command creates a multisig wallet. As input, it takes address-public-key
  pairs generated from the multisig-collect-keys command. It uses that
  data to construct a P2SH multisig wallet. The wallet object is displayed
  on the command line as the output.

  This is a long-running command. It does the following:
  - It calls the mc-collect-keys commands to get the public keys for each holder
  of the Minting Council NFT.
  - It generates a multisignature wallet from those keys requiring 50% + 1 signers.
  - It retrieves the current PSF token price and calculates the price of \$0.01 USD
  in PSF tokens.
  - It writes all the data to the P2WDB, pins the data with the P2WDB Pinning
  Cluster, and gets an IPFS CID for the data.
  - It then writes a PS009 Update Transaction to the BCH blockchain, containing
  the CID, returning a TXID.

  That BCH TXID is then used as input to the mc-update-p2wdb-price command, to
  generate a PS009 Approval Transaction, so that the price update can be approved
  by the Minting Council via the multisignature wallet.

See code: src/commands/mc-p2wdb-update-tx.js

psf-bch-wallet mc-read-tx

Read multisig TX proposal

USAGE
  $ psf-bch-wallet mc-read-tx [-n <value>] [-t <value>]

FLAGS
  -n, --name=<value>  Name of wallet
  -t, --txid=<value>  Transaction ID

DESCRIPTION
  Read multisig TX proposal

  This command reads the 'message' section of a proposed multisig transaction for
  Minting Council members. This command should be run *before* the mc-sign-tx
  command.

See code: src/commands/mc-read-tx.js

psf-bch-wallet mc-sign-tx

Read signed messages

USAGE
  $ psf-bch-wallet mc-sign-tx [-n <value>] [-t <value>]

FLAGS
  -n, --name=<value>  Name of wallet
  -t, --txid=<value>  Transaction ID

DESCRIPTION
  Read signed messages

  This command signs a multisig transaction for Minting Council members. The
  mc-read-tx command should be run *before* this command, so that you can
  read the context of the transaction.

  After signing the transaction, it will send the signature back to the message
  originator.

See code: src/commands/mc-sign-tx.js

psf-bch-wallet msg-check

Check signed messages

USAGE
  $ psf-bch-wallet msg-check [-n <value>]

FLAGS
  -n, --name=<value>  Name of wallet

DESCRIPTION
  Check signed messages

See code: src/commands/msg-check.js

psf-bch-wallet msg-read

Read signed messages

USAGE
  $ psf-bch-wallet msg-read [-n <value>] [-t <value>]

FLAGS
  -n, --name=<value>  Name of wallet
  -t, --txid=<value>  Transaction ID

DESCRIPTION
  Read signed messages

See code: src/commands/msg-read.js

psf-bch-wallet msg-send

Send encrypted messages

USAGE
  $ psf-bch-wallet msg-send [-a <value>] [-m <value>] [-s <value>] [-n <value>]

FLAGS
  -a, --bchAddress=<value>  BCH Address
  -m, --message=<value>     Message to send
  -n, --name=<value>        Name of wallet
  -s, --subject=<value>     Message Subject

DESCRIPTION
  Send encrypted messages

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

psf-bch-wallet msg-sign

Cryptographically sign a message.

USAGE
  $ psf-bch-wallet msg-sign [-n <value>] [-m <value>]

FLAGS
  -m, --msg=<value>   Cleartext message to sign
  -n, --name=<value>  Name of wallet

DESCRIPTION
  Cryptographically sign a message.

  Generate a signature from a clear-text message and the private key of your wallet.
  The system verifying the signature will also need the BCH address of the walllet.

See code: src/commands/msg-sign.js

psf-bch-wallet msg-verify

Verify a signed message

USAGE
  $ psf-bch-wallet msg-verify [-b <value>] [-m <value>] [-s <value>]

FLAGS
  -b, --bchAddr=<value>  BCH address of signer.
  -m, --msg=<value>      Cleartext message used to generate the signature.
  -s, --sig=<value>      Signature to verify.

DESCRIPTION
  Verify a signed message

  Verify the authenticity of a signed message.

See code: src/commands/msg-verify.js

psf-bch-wallet p2wdb-json

Upload JSON to IPFS

USAGE
  $ psf-bch-wallet p2wdb-json [-n <value>] [-j <value>]

FLAGS
  -j, --json=<value>  A JSON string. Encase this argument in single quotes.
  -n, --name=<value>  Name of wallet

DESCRIPTION
  Upload JSON to IPFS

  This command uses the p2wdb npm library to upload a JSON object to an IPFS node.
  The node returns a CID representing the JSON. That CID can then be pinned using
  the P2WDB Pinning cluster, using the p2wdb-pin command.

See code: src/commands/p2wdb-json.js

psf-bch-wallet p2wdb-pin

Pin an IPFS CID using the P2WDB pinning service

USAGE
  $ psf-bch-wallet p2wdb-pin [-n <value>] [-c <value>]

FLAGS
  -c, --cid=<value>   IPFS CID to pin
  -n, --name=<value>  Name of wallet

DESCRIPTION
  Pin an IPFS CID using the P2WDB pinning service

  This command uses the p2wdb npm library to pin an IPFS CID using the P2WDB
  pinning service.

  Note: Currently only files 1MB or less are supported.

See code: src/commands/p2wdb-pin.js

psf-bch-wallet p2wdb-read

Read an entry from the P2WDB

USAGE
  $ psf-bch-wallet p2wdb-read [-h <value>]

FLAGS
  -h, --hash=<value>  Hash CID representing P2WDB entry

DESCRIPTION
  Read an entry from the P2WDB

See code: src/commands/p2wdb-read.js

psf-bch-wallet p2wdb-write

Write an entry to the pay-to-write database (P2WDB)

USAGE
  $ psf-bch-wallet p2wdb-write [-n <value>] [-d <value>] [-a <value>]

FLAGS
  -a, --appId=<value>  appId string to categorize data
  -d, --data=<value>   String of data to write to the P2WDB
  -n, --name=<value>   Name of wallet

DESCRIPTION
  Write an entry to the pay-to-write database (P2WDB)

  In order to execute this command, the wallet must contain some BCH and some PSF
  token, in order to pay for the write to the P2WDB.

See code: src/commands/p2wdb-write.js

psf-bch-wallet psffpp-download

Download a file, given its CID.

USAGE
  $ psf-bch-wallet psffpp-download [-c <value>]

FLAGS
  -c, --cid=<value>  CID of file to download

DESCRIPTION
  Download a file, given its CID.

  Query the ipfs-bch-wallet-consumer for a given CID. If the file is pinned by
  the ipfs-file-pin-service connected to it, it will attempt to download the
  file to the ipfs-files directory.

See code: src/commands/psffpp-download.js

psf-bch-wallet psffpp-info

Download a file, given its CID.

USAGE
  $ psf-bch-wallet psffpp-info [-c <value>]

FLAGS
  -c, --cid=<value>  CID of file to download

DESCRIPTION
  Download a file, given its CID.

  Query the ipfs-bch-wallet-consumer for a given CID. It will request the file
  status from the ipfs-file-pin-service connected to it. This is a good way
  to check if the file has been pinned by that service.

See code: src/commands/psffpp-info.js

psf-bch-wallet psffpp-pin

Pin a file to the PSFFPP network

USAGE
  $ psf-bch-wallet psffpp-pin [-f <value>] [-n <value>]

FLAGS
  -f, --fileName=<value>  fileName to pin to PSF network
  -n, --name=<value>      Name of wallet

DESCRIPTION
  Pin a file to the PSFFPP network

  This command leverages the psffpp-upload command. It will upload the file
  using that command, then use the CID returned by that command to generate
  a Proof-of-Burn and a Pin Claim transaction.

See code: src/commands/psffpp-pin.js

psf-bch-wallet psffpp-upload

Upload a file to the IPFS node

USAGE
  $ psf-bch-wallet psffpp-upload [-f <value>]

FLAGS
  -f, --fileName=<value>  filename to upload

DESCRIPTION
  Upload a file to the IPFS node

  If you are trying to pin a file to the PSFFPP network, you do not need to run
  this command. This command is automatically  used by the psffpp-pin command to
  upload the file.

  This command is useful in isolation if you want to test uploading and passing
  files between IPFS nodes, independant of the PSFFPP.

See code: src/commands/psffpp-upload.js

psf-bch-wallet psffpp-upload2

Upload a file to the psffpp-client

USAGE
  $ psf-bch-wallet psffpp-upload2 [-f <value>]

FLAGS
  -f, --fileName=<value>  filename to upload

DESCRIPTION
  Upload a file to the psffpp-client

  This command will upload a file to the psffpp-client via the REST API.

See code: src/commands/psffpp-upload2.js

psf-bch-wallet send-bch

Send BCH

USAGE
  $ psf-bch-wallet send-bch [-n <value>] [-q <value>] [-a <value>]

FLAGS
  -a, --sendAddr=<value>  Cash address to send to
  -n, --name=<value>      Name of wallet
  -q, --qty=<value>       Quantity in BCH

DESCRIPTION
  Send BCH

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

psf-bch-wallet send-tokens

Send Tokens

USAGE
  $ psf-bch-wallet send-tokens [-n <value>] [-t <value>] [-a <value>] [-q <value>]

FLAGS
  -a, --sendAddr=<value>  Cash or SimpleLedger address to send to
  -n, --name=<value>      Name of wallet
  -q, --qty=<value>
  -t, --tokenId=<value>   Token ID

DESCRIPTION
  Send Tokens

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

psf-bch-wallet token-burn

Burn a specific quantity of SLP tokens.

USAGE
  $ psf-bch-wallet token-burn [-n <value>] [-q <value>] [-t <value>]

FLAGS
  -n, --name=<value>     Name of wallet
  -q, --qty=<value>      Quantity of tokens to burn. If quantity is 0, all tokens will be burned.
  -t, --tokenId=<value>  tokenId of token to burn

DESCRIPTION
  Burn a specific quantity of SLP tokens.

See code: src/commands/token-burn.js

psf-bch-wallet token-create-fungible

Create a new SLP Type1 fugible token.

USAGE
  $ psf-bch-wallet token-create-fungible [-n <value>] [-t <value>] [-m <value>] [-d <value>] [-q <value>] [-u <value>] [-h <value>] [-b]

FLAGS
  -b, --baton               (optional Boolean) create a minting baton
  -d, --decimals=<value>    Decimals used by the token
  -h, --hash=<value>        (optional) Document hash of the group
  -m, --tokenName=<value>   Name of token
  -n, --walletName=<value>  Name of wallet to pay for transaction
  -q, --qty=<value>         Quantity of tokens to create
  -t, --ticker=<value>      Ticker of the group
  -u, --url=<value>         (optional) Document URL of the group

DESCRIPTION
  Create a new SLP Type1 fugible token.

  Creating a minting baton is optional. If a baton address is not specified, then the
  baton is burned and makes the it a 'fixed supply' token.

See code: src/commands/token-create-fungible.js

psf-bch-wallet token-create-group

Create a new SLP Group token.

USAGE
  $ psf-bch-wallet token-create-group [-n <value>] [-m <value>] [-t <value>] [-q <value>] [-u <value>] [-h <value>]

FLAGS
  -h, --hash=<value>        (optional) Document hash of the group
  -m, --tokenName=<value>   Name of token
  -n, --walletName=<value>  Name of wallet to pay for transaction
  -q, --qty=<value>         (optional) Quantity of tokens to create. Defaults to 1
  -t, --ticker=<value>      Ticker of the group
  -u, --url=<value>         (optional) Document URL of the group

DESCRIPTION
  Create a new SLP Group token.

  Group tokens are used to generate NFTs. Read more about the relationship:
  https://github.com/Permissionless-Software-Foundation/bch-js-examples/tree/master/bch/applications/slp/nft

See code: src/commands/token-create-group.js

psf-bch-wallet token-create-nft

Create a new SLP Group token.

USAGE
  $ psf-bch-wallet token-create-nft [-n <value>] [-m <value>] [-t <value>] [-u <value>] [-h <value>] [-i <value>]

FLAGS
  -h, --hash=<value>        (optional) Document hash of the group
  -i, --tokenId=<value>     Token ID of Group token to burn, to generate the NFT
  -m, --tokenName=<value>   Name of token
  -n, --walletName=<value>  Name of wallet to pay for transaction
  -t, --ticker=<value>      Ticker of the group
  -u, --url=<value>         (optional) Document URL of the group

DESCRIPTION
  Create a new SLP Group token.

  Group tokens are used to generate NFTs. Read more about the relationship:
  https://github.com/Permissionless-Software-Foundation/bch-js-examples/tree/master/bch/applications/slp/nft

See code: src/commands/token-create-nft.js

psf-bch-wallet token-info

Get information on a token

USAGE
  $ psf-bch-wallet token-info [-t <value>]

FLAGS
  -t, --tokenId=<value>  The ID of the token to lookup

DESCRIPTION
  Get information on a token

  Retrieves the Genesis data for a token. If PS002 mutable and immutable data is
  attached to the token, it is retrieved from IPFS.

See code: src/commands/token-info.js

psf-bch-wallet token-mda-tx

Create TXID for token mutable data

USAGE
  $ psf-bch-wallet token-mda-tx [-n <value>] [-a <value>]

FLAGS
  -a, --mda=<value>         Mutable data address
  -n, --walletName=<value>  Name of wallet to pay for transaction

DESCRIPTION
  Create TXID for token mutable data

  MDA is an acrynym for 'Mutable Data Address'

  This command is used to generate a TXID for attaching mutable data to a token.
  Given a BCH address, it generates a transaction to turn that address into
  the controller of mutable data for a token. This generates a TXID which is
  used in the tokens 'documentHash' field when creating the token.

  PS002 specification for mutable data:
  https://github.com/Permissionless-Software-Foundation/specifications/blob/master/ps002-slp-mutable-data.md

See code: src/commands/token-mda-tx.js

psf-bch-wallet token-mint

Mint new Fungible (Type 1) or Group tokens

USAGE
  $ psf-bch-wallet token-mint [-n <value>] [-q <value>] [-t <value>] [-r <value>]

FLAGS
  -n, --name=<value>      Name of wallet to pay for transaction
  -q, --qty=<value>       Quantity of tokens to create
  -r, --receiver=<value>  (optional) Receiver of new baton. Defaults to same wallet. null burns baton.
  -t, --tokenId=<value>   Token ID

DESCRIPTION
  Mint new Fungible (Type 1) or Group tokens

  If the wallet contains a minting baton from creating a Fungible or Group token,
  this command can be used to mint new tokens into existence.

  The '-r' flag is optional. By default the minting baton will be sent back to the
  origionating wallet. A different address can be specified by the -r flag. Passing
  a value of 'null' will burn the minting baton, removing the ability to mint
  new tokens.

See code: src/commands/token-mint.js

psf-bch-wallet token-tx-history

Get transaction history for a token

USAGE
  $ psf-bch-wallet token-tx-history [-t <value>]

FLAGS
  -t, --tokenId=<value>  The ID of the token to lookup

DESCRIPTION
  Get transaction history for a token

  Retrieves the transaction history for a token. This is every transaction that
  has involved the token. The data is more informative for an NFT than it is for
  a fungible token.

See code: src/commands/token-tx-history.js

psf-bch-wallet token-update

Update token mutable data.

USAGE
  $ psf-bch-wallet token-update [-n <value>] [-c <value>]

FLAGS
  -c, --cid=<value>   A CID that resolves to the new mutable data JSON
  -n, --name=<value>  Name of wallet

DESCRIPTION
  Update token mutable data.

  This command is used to update the mutable data for a token.

  Data updates are effected by writing a new
  CID to an OP_RETURN inside a transaction, published to the Mutable Data Address
  (MDA), as described in PS002.

  The wallet used to pay for the transaction must control the MDA, otherwise the
  update will be ignored.

  To use this command, you'll need a CID that resolves to the updated data.
  The p2wdb-json command can be used for that.

  New mutable data follows the PS002 spec by uploading JSON data to IPFS and
  then including the CID in an OP_RETURN. The JSON data should also follow the
  schema in the PS007 specification:

  https://github.com/Permissionless-Software-Foundation/specifications/blob/master/ps002-slp-mutable-data.md
  https://github.com/Permissionless-Software-Foundation/specifications/blob/master/ps007-token-data-schema.md

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

psf-bch-wallet vote-addrs

Collect Voting Addresses

USAGE
  $ psf-bch-wallet vote-addrs

DESCRIPTION
  Collect Voting Addresses

  This command is run to prepare for a governance vote. It looks up the addresses
  holding all NFTs tied to a common group token. This list of addresses can
  then be used to air-drop voting tokens.

See code: src/commands/vote-addrs.js

psf-bch-wallet vote-airdrop

Airdrop Voting Tokens

USAGE
  $ psf-bch-wallet vote-airdrop [-n <value>] [-a <value>] [-t <value>]

FLAGS
  -a, --addrs=<value>    JSON string containing array of addresses
  -n, --name=<value>     Name of wallet holding voting tokens
  -t, --tokenId=<value>  Token ID to air-drop to each address

DESCRIPTION
  Airdrop Voting Tokens

  This command is used to air-drop voting tokens to an array of addresses. It
  is expected the array of addresses is generated from the vote-addrs command.
  One token will be sent to each address in the list.

See code: src/commands/vote-airdrop.js

psf-bch-wallet wallet-addrs

List the different addresses for a wallet.

USAGE
  $ psf-bch-wallet wallet-addrs [-n <value>]

FLAGS
  -n, --name=<value>  Name of wallet

DESCRIPTION
  List the different addresses for a wallet.

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

psf-bch-wallet wallet-balances

Display the balances of the wallet

USAGE
  $ psf-bch-wallet wallet-balances [-n <value>] [-v]

FLAGS
  -n, --name=<value>  Name of wallet
  -v, --verbose       Show verbose UTXO information

DESCRIPTION
  Display the balances of the wallet

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

psf-bch-wallet wallet-create

Generate a new HD Wallet.

USAGE
  $ psf-bch-wallet wallet-create [-n <value>] [-d <value>]

FLAGS
  -d, --description=<value>  Description of the wallet
  -n, --name=<value>         Name of wallet

DESCRIPTION
  Generate a new HD Wallet.

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

psf-bch-wallet wallet-list

List existing wallets.

USAGE
  $ psf-bch-wallet wallet-list

DESCRIPTION
  List existing wallets.

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

psf-bch-wallet wallet-optimize

Optimize a wallet

USAGE
  $ psf-bch-wallet wallet-optimize [-n <value>]

FLAGS
  -n, --name=<value>  Name of wallet

DESCRIPTION
  Optimize a wallet

  This command 'optimizes' a wallet by consolidating the UTXOs with in it. This
  consolidation can significantly reduce the number of API calls, which speeds
  up the the network calls and results in an improved user experience (UX).

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

psf-bch-wallet wallet-remove

Remove an existing wallet.

USAGE
  $ psf-bch-wallet wallet-remove [-n <value>]

FLAGS
  -n, --name=<value>  Name of wallet

DESCRIPTION
  Remove an existing wallet.

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

psf-bch-wallet wallet-scan

Scan different derivation paths of a 12 word mnemonic for tx history.

USAGE
  $ psf-bch-wallet wallet-scan [-m <value>]

FLAGS
  -m, --mnemonic=<value>  mnemonic phrase to generate addresses, wrapped in quotes

DESCRIPTION
  Scan different derivation paths of a 12 word mnemonic for tx history.

  Scans the first 20 addresses of each derivation path for
  history and balance of the given mnemonic. If any of them had a history, scans
  the next 20, until it reaches a batch of 20 addresses with no history. The -m
  flag is used to pass it a mnemonic phrase. Be sure to enclose the words in
  quotes.

  This command is handy for people who maintain multiple wallets. This allows easy
  scanning to see if a mnemonic holds any funds on any of the commonly used
  derivation paths.

  Derivation pathes used:
  145 - BIP44 standard path for Bitcoin Cash
  245 - BIP44 standard path for SLP tokens
  0 - Used by common software like the Bitcoin.com wallet and Honest.cash

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

psf-bch-wallet wallet-service

List and/or select a wallet service provider.

USAGE
  $ psf-bch-wallet wallet-service [-s <value>]

FLAGS
  -s, --select=<value>  Switch to a given IPFS ID for wallet service.

DESCRIPTION
  List and/or select a wallet service provider.

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

psf-bch-wallet wallet-service-test

Run end-to-end tests on the selected wallet service.

USAGE
  $ psf-bch-wallet wallet-service-test

DESCRIPTION
  Run end-to-end tests on the selected wallet service.

  This command will run a series of end-to-end (e2e) tests on a current global
  back end selected with the 'wallet-service' command. It will test that the
  selected service if fully function, and this app can adaquately communicate
  with that service.

See code: src/commands/wallet-service-test.js

psf-bch-wallet wallet-sweep

Sweep funds from one wallet into another

USAGE
  $ psf-bch-wallet wallet-sweep [-n <value>] [-m <value>] [-w <value>] [-d <value>]

FLAGS
  -d, --derivation=<value>  Derivation path. Will default to 245 if not specified. Common values are 245, 145, and 0
  -m, --mnemonic=<value>    12-word mnemonic phrase, wrapped in quotes
  -n, --name=<value>        name of receiving wallet
  -w, --wif=<value>         WIF private key controlling funds of a single address

DESCRIPTION
  Sweep funds from one wallet into another

  Sweep funds from a single private key (WIF) or a whole HD wallet (mnemonic)
  into another wallet. Works for both BCH and tokens.

  If the target wallet does not have enough funds to pay transaction fees, fees
  are paid from the receiving wallet. In the case of a mnemonic, a derivation path
  can be specified.

  Either a WIF or a mnemonic must be specified.

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