[go: up one dir, main page]

bitcoin-rpc-promise

2.1.6 • Public • Published

bitcoin-rpc-promise

A modern promise based node.js library for communicating with Bitcoin daemon.

npm package

NPM version Dependency Status Known Vulnerabilities Downloads FOSSA Status

Install

npm install --save bitcoin-rpc-promise

Usage

Start bitcoin daemon with rpc support:

./bitcoind --server=1 --rpcuser=user --rpcpassword=password

Connect to daemon endpoint and send rpc commands:

const BitcoinRpc = require('bitcoin-rpc-promise');
 
let btc = new BitcoinRpc('http://user:password@localhost:8332');
 
// call named wrappers
btc.getBlockHash(100).then(result => {
  console.log(result);
});
 
// or call named wrappers with all lower case
btc.getblockhash(100).then(result => {
  console.log(result);
});
 
// or call raw commands
btc.call('getblockhash', 100).then(result => {
  console.log(result);
});

Documentation

Bitcoin Wiki

Package Sidebar

Install

npm i bitcoin-rpc-promise

Weekly Downloads

34

Version

2.1.6

License

MIT

Unpacked Size

6.88 kB

Total Files

6

Last publish

Collaborators

  • nikcool1995