npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

blockexplorer

v1.0.1

Published

Unofficial Node.js client for blockexplorer.com API

Downloads

19

Readme

blockexplorer

npm version Build Status Coverage Status JavaScript Style Guide

Unofficial Node.js client for blockexplorer.com API

Install

npm i blockexplorer --save

Example

// require the module
const be = require('blockexplorer')

// get the genesis block hash
be.blockIndex(0)
  .then((result) => {
    console.log(result)
  })
  .catch((err) => {
    throw err
  })

Test

npm test

API

blockexplorer.block(hash)

Get block info by hash

  • Returns Promise

blockexplorer.rawBlock(hash)

Get raw block info by hash

  • Returns Promise

blockexplorer.blockIndex(height)

Get block hash by height

  • Returns Promise

blockexplorer.tx(txid)

Get transaction by txid

  • Returns Promise

blockexplorer.rawTx(txid)

Get raw transaction by txid

  • Returns Promise

blockexplorer.addrValidate(address)

Validate address

  • Returns Promise

blockexplorer.addr(address, [options])

Get address info

// Default options
{
  noTxList: false,
  noCache: false
}
  • Pass an Array as first parameter to get info on multiple addresses
  • Returns Promise

blockexplorer.balance(address)

Get address balance

  • Returns a Promise

blockexplorer.totalReceived(address)

Get address received funds

  • Returns a Promise

blockexplorer.totalSent(address)

Get address sent funds

  • Returns a Promise

blockexplorer.unconfirmedBalance(address)

Get address unconfirmed balance

  • Returns a Promise

blockexplorer.utxo(address, [options])

Get address unspent outputs

// Default options
{
  noCache: false
}
  • Pass an Array as first parameter to get info on multiple addresses
  • Returns a Promise

blockexplorer.txsBlock(hash)

Get transactions by hash

  • Returns a Promise

blockexplorer.txsAddress(address, [options])

Get transactions by address

// Default options
{
  from: '',
  to: ''
}
  • Pass an Array as first parameter to get info on multiple addresses
  • Returns a Promise

blockexplorer.txSend(rawtx)

Broadcast signed trasaction in hex format rawtx

  • Returns a Promise

blockexplorer.getInfo()

Get blockchain info

  • Returns a Promise

blockexplorer.getBlockCount()

Get block count

  • Returns a Promise

blockexplorer.getDifficulty()

Get difficulty

  • Returns a Promise

blockexplorer.getBestBlockHash()

Get best block hash

  • Returns a Promise

blockexplorer.getLastBlockHash()

Get last block hash

  • Returns a Promise

blockexplorer.sync()

Get historic blockchain data sync status

  • Returns a Promise

blockexplorer.peer()

Get live network p2p data sync status

  • Returns a Promise

blockexplorer.estimateFee([nbBlocks = 2])

Get fee estimate

  • Returns a Promise

For additional information see blockexplorer.com API reference

Contributing

Just send a PR

License

Licensed under MIT

The author is not affiliated in any way with blockexplorer.com