Giter VIP home page Giter VIP logo

blockexplorer's Introduction

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

blockexplorer's People

Contributors

barto- avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.