coinblocks

1.0.3 • Public • Published

coinblocks

  • An event notifier for crypto currencies that emits an event once a new block is found on it's chain, supports btc-like coins and eth coins

Installation

npm install coinblocks --save

Options

  • options[Array]
const opts = [{
  coin: 'tbtc',
  rpc: {
    'host': '127.0.0.1',
    'port': 18332,
    'user': 'rpcusername',
    'pass': 'rpcpass',
    'timeout': 30000
  },
  'family': 'btc'
},
{
  coin: 'doge',
  'rpc': {
    'host': '127.0.0.1',
    'port': 22555,
    'user': 'rpcusername',
    'pass': 'rpcpass',
    'timeout': 30000
  },
  'family': 'btc'
},
{
  coin: 'eth',
  'rpc': {
    'host': '127.0.0.1',
    'port': 8545,
    'user': '',
    'pass': '',
    'timeout': 30000
  },
  'family': 'eth'
}];

Usage

const CoinBlocks = require('coinblocks');
 
// options from previous example
const coinblocks = new CoinBlocks(options);
 
//register a listener
coinblocks.on('newBlock', obj => {
  console.log('new block triggered for', obj.coin);
  console.log('block data info', obj.data);
});
 
//start coinblocks
coinblocks.start();
 
setTimeout(() => {
  // stops coinblocks
  coinblocks.close();
}, 10000);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    2
  • 1.0.2
    1
  • 1.0.1
    1
  • 1.0.0
    1

Package Sidebar

Install

npm i coinblocks

Weekly Downloads

5

Version

1.0.3

License

MIT

Unpacked Size

4.39 kB

Total Files

3

Last publish

Collaborators

  • unibtc