Pandacash Core
This is the core code that powers the Pandacash application and the the Pandacash command line tool - pandacash-cli
.
Prerequisites
To run pandacash-cli
, make sure that Node.js is installed.
On macOS these tools can be installed through Homebrew.
brew install node
Installation
npm install pandacash-core
Usage
As a general HTTP server
const panda = ; const server = panda; const pandaCashCore = await server; console;console;console;console;
In Jasmine/Mocha tests
const panda = ;
Pandacash and bch.js
bch.js is a lightweight RPC client for Bitcoin Cash. Panda is fully integrated with bchjs
. An instance of the library is exposed under pandacashCore.bch
.
RPC Calls
const panda = ; const server = panda; const pandacashCore = await server; const blockchainInfo = await pandacashCorebch; console;
Creating a test transaction
const pandaCashCore = await server; // bch rpc works only with the bcash format!// find full documentation here: https://www.npmjs.com/package/bchjsconst unspentTxs = await pandaCashCorebch; const _utxo = unspentTxs0;console;/* { txid: 'a5872579aec7e509f17461e19d3d94c52ef29eceb2ba2116e6c5db164d3d0a57', vout: 0, address: 'bchreg:qzhv7vkn72wd5egeum0su9jjkjzv6q70zg83rchfz5', account: 'default', scriptPubKey: '76a914aecf32d3f29cda6519e6df0e1652b484cd03cf1288ac', amount: 25, confirmations: 20, spendable: true, solvable: true }*/ const utxo = 'txId' : _utxotxid 'outputIndex' : _utxovout 'address' : pandaCashCoreaccountkeyPairs0legacyAddress 'script' : _utxoscriptPubKey 'satoshis' : _utxoamount * 1000000; bchNetworks; const privateKey = pandaCashCoreaccountkeyPairs0privateKey "regtest"; const transaction = ; console;
Under the hood
Pandacash is powered by the bcash implementation of Bitcoin Cash.
Licence
Copyright 2018 Panda Suite
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
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.