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

crypto-balances-2

v1.0.9

Published

Extended from the original deprecated package by [@litvintech](https://github.com/litvintech/crypto-balances) to provide API services and re-formatted results.

Downloads

21

Readme

Extended from the original deprecated package by @litvintech to provide API services and re-formatted results.

Crypto balances

Easily check address balances of various crypto tokens. Script automaticaly recognizes a protocol by address and returns balances of tokens associated with it.

Supported Protocols

  • Using https://blockcypher.com: Bitcoin, Litecoin, Dash, Dogecoin
  • Using https://blockchain.info: Bitcoin Xpub
  • Using https://ethplorer.io: Ethereum, ERC20 Tokens
  • Using https://chainz.cryptoid.info: LTC Segwit, Stratis, DigiByte
  • Using https://neoscan.io: NEO, NEP5 Tokens

As a dependency

Require the package and use it as any other promise:

~ » npm install --save crypto-balances-2
const balance = require('crypto-balances-2');

balance("0xfc30a6c6d1d61f0027556ed25a670345ab39d0cb")
.then(result => console.log(result))
.catch(error => console.log(`OH NO! ${error}`));

// logs: { "address_type": "ETH", balances: {"ETH": 0.29, "OMG": 124.448} }

// balance takes an optional second coin type parameter.
// eg. balance("0xfc30a6c6d1d61f0027556ed25a670345ab39d0cb", "BTC")

As an API

~ » git clone https://github.com/danielheyman/crypto-balances
~ » cd crypto-balances
~ » npm install
~ » npm start

An API call can be made to port 8888 with a given address to http://127.0.0.1:8888/address_to_check.

It will return a json response such as { "address_type": "ETH", balances: {"ETH": 0.29, "OMG": 124.448} }.

If an error occurs, it will return a json response such as { "error": "ethplorer: Invalid API key" }.

For a specific coin, a call can be made to http://127.0.0.1:8888/coin/address_to_check. eg. http://127.0.0.1:8888/eth/0xfc30a6c6d1d61f0027556ed25a670345ab39d0cb

As an API using Docker

Useful when running on a machine with multiple node applications, each requiring different specifications.

Run docker-compose up to get the container up.

An API call can be made on port 8888 with a given address to http://0.0.0.0:8888/address_to_check.

Tests

~ » npm run test

License

Under MIT License

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request