bitcoin-promise

1.3.1 • Public • Published

node-bitcoin-promise

Summary

Add Promise support to bitcoin package. It is backward compatible with the original package. If no callback function is passed in to a command a Promise is returned

Installation

npm install bitcoin-promise

Example

var bitcoin = require( 'bitcoin-promise' ) ;

var client = new bitcoin.Client({
	host: 'rcorbish.ydns.eu',
	port: 18332,
	user: 'bitcoinrpc',
	pass: 'password',
	timeout: 30000
});

// get a new address and return details about it
client.getNewAddress()
.then( function(addr){
	return client.validateAddress( addr ) ;
}) 
.then( function(addrInfo){
	console.log( addrInfo ) ;
}) 
.catch( function(err){
	console.log( err ) ;
}) ;

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i bitcoin-promise

    Weekly Downloads

    8

    Version

    1.3.1

    License

    Unlicense

    Last publish

    Collaborators

    • rcorbish