Simple Wallet for Bitcoin Cash
For a web developers building applications for Bitcoin Cash, Simple Wallet provides an easy and quick way to create BCH wallets and sen bitcoin around. Simple wallets gives developers high-level interfaces that hides most of the complexity required for such functionality. The mission is to make the interaction with Bitcoin Cash Blockchain it as simple as possible.
How to use it?
Import
Add to your HTML scripts
<script src="https://honest.cash/js/simplewallet.min.js" />
Node module
npm install simple-wallet --save
// module import; // nodejs modulesconst SimpleWallet = ;
Create new wallets
const simpleWallet = ; // 12 words seed phrase for the walletconsole; // cash address derived from the seed (derivation path: m/44'/145'/0/0/1')console; // legacy address derived from the seed (derivation path: m/44'/145'/0/0/1')console; // private key for the BCH address derived from the seed (derivation path: m/44'/145'/0/0/1')console;
Initialize wallet with mnemonic
// initialize with 12 words seed phrase for the walletconst simpleWallet = "<mnemonic>";
Send transactions
You can send funds to other BCH wallets. You are able distribute funds to N users.
const simpleWallet = "<mnemonic>"; const tx = await simpleWallet; // Transaction ID// you can then see the transaction in one of the explorers// example: `https://explorer.bitcoin.com/bch/tx/${tx.txid}`;console;
Error Handling
try tx = await simpleWallet; catch err console; if errmessage && errmessage > -1 return ; ;
Save keys in the browser
const simpleWallet1 = ; localStorage; const simpleWallet2 = localStorage;
Under the hood
-
Simple wallet is a wallet programmed for honest.cash. It combines functionality of multiple libraries and recombines them in a way that it is simple for developers to begin working with Bitcoin Cash blockchain.
-
Simple wallet is powered by Bitbox SDK and communicates with rest.bitcoin.com Cloud API.
Author
Adrian Barwicki
Licence
Unlicenced.
Copyright 2018 Adrian Barwicki (adrianbarwicki@gmail.com)
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
PS. This library is still in alpha. We will open-source it once it becomes mature.