Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bitcoin-cash-rpc

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitcoin-cash-rpc

JSON-RPC library for use with Bitcoin Cash Nodes, promise-based and async/await support.

  • 0.4.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
increased by400%
Maintainers
1
Weekly downloads
 
Created
Source

Bitcoin Cash JSON-RPC library

Javascript Library to communicate with your Bitcoin Unlimited / Bitcoin ABC / Bitcoin Classic Node.

header

This is a promise-based library and async/await compatible. Includes a couple additional helpers, such as a QRcode generator as well as Bitpay's Address translator. Supports both address formats.

Installation

grab from NPM

  npm i bitcoin-cash-rpc

Usage

let bchRPC = require("bitcoin-cash-rpc");
let bch = new bchRPC(host, username, password, port, timeout, debugging);

// timeout is 3000 by default
// debugging is true by default, false makes the library silent and requires try/catch on the app level.


 let info = await bch.getInfo();

 console.log(info)

 // results in
 //{
 //  "version": 1010101,
 //  "protocolversion": 80003,
 //  "walletversion": 60000,
 //  "balance": 0.00000000,
 //  "blocks": 478559,
 //  "timeoffset": 0,
 //  "connections": 12,
 //  "proxy": "",
 //  "difficulty": 29829733124.04042,
 //  "testnet": false,
 //  "keypoololdest": 1506057198,
 //  "keypoolsize": 100,
 //  "paytxfee": 0.00000000,
 //  "relayfee": 0.00001000,
 //  "errors": "",
 //  "fork": "Bitcoin Cash"
 //}

or

 p = Promise.resolve(bch.getInfo());
 p.then(info=>{
    console.log(info);
 })

Available Methods

there is incomplete coverage at the moment. Please submit a PR if you'd like to have a method added.

getInfo getBlockCount getWalletInfo getUnconfirmedBalance getBalance getWalletInfo getBlockHash getNewAddress setTxFee validateAddress sendToAddress sendFrom getAccountAddress getBlock getTxOut listTransactions listUnspent estimateSmartFee getTransaction getRawTransaction getRawMempool getRawChangeAddress signRawTransaction sendRawTransaction decodeRawTransaction getTxoutProof

Compatible Node Implementations

You must be running a Node (Pruned mode is fine)

Bitcoin ABC

Bitcoin XT

Bitcoin Unlimited (Cash)

Tested on Node v7.10, and npm v5.4.1

Keywords

FAQs

Package last updated on 15 Jan 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc