This directory contains a series of small example apps that illustrate how to code up common use cases for a Bitcoin Cash application.
contains low-level applications exercising a single feature of bitbox. Think of
these examples like lego blocks that can be used to build a bigger app.
applications directory contains example applications like wallets, voting,
and other ideas.
Prior to running these examples, you need to setup this code repository. In the root directory run these commands:
npm install npm run build npm run postbuild
You can run each example script by entering its directory and executing
Basic BCH Wallet Functions
These basic examples in the
applications/wallet directory are used to bootstrap
a BCH testnet wallet for use with the other examples. Recommended path:
- Create a wallet
- Fund it with a testnet faucet
- Check the balance
- Send some tBCH (testnet BCH)
- Send tBCH back to the faucet.
Once those objectives are achieved, you're ready explore some of the other examples.
create-walletCreate a BCH compatible HD Node wallet on the BCH testnet. Send test BCH using a testnet faucet (like this one) to the address saved in the wallet.json file generated by this app.
check-balanceCheck the balance of your BCH wallet.
send-bchSend BCH to another address. You can send small amounts of tBCH (testnet BCH) to the address in the address in the wallet to generate UTXOs and explore the difference between addresses and utxos in Bitcoin.
consolidate-utxosto combine multiple utxos in an address back into a single UTXO.
send-allsends all BCH in an address to another address. Great for sending you tBCH back to the testnet faucet.