Code Monkey home page Code Monkey logo

crypto-balance's Introduction

crypto-balance

Query various crypto tokens for their address balances.

Warning: this is a very early version--use at your own risk. Pull requests are very much welcome as well as support for other tokens, blockchains, and services.

Supported Tokens

  • Bitcoin
  • Litecoin
  • Dogecoin
  • All tokens created on Counterparty
  • All tokens created on Dogeparty
  • Mastercoin
  • Ethereum (pre-sale)
  • Open Assets

.. and maybe more by now, in case we forget to update this section again, check the code src/services.

Installation

~ » npm install crypto-balance

How to Use

Command Line

~ » npm install -g crypto-balance # for global installation of _balance_
~ » balance DDogepartyxxxxxxxxxxxxxxxxxxw1dfzr                                                                      ~
1,009,968,741.03499746 DOGE
~ » balance 1LARSvRshS9Nm3D3aWLELQjNYtaBrWGzg2                                                                      ~
0.00010860 BTC
42.00000000 XCP/LARS

Node.js

var balance = require('crypto-balance');
balance("DCt8sxHX634ghqdDhWFtCPQUyZ3TEfLBCo", function(error, assets) {
  console.log(assets);
});

// [ { address: 'DCt8sxHX634ghqdDhWFtCPQUyZ3TEfLBCo',
//    quantity: 100000000,
//    asset: 'XDP/DOGEPARTY' },
//  { address: 'DCt8sxHX634ghqdDhWFtCPQUyZ3TEfLBCo',
//    quantity: 500000000000,
//    asset: 'XDP/DOLLARS' },
//  ...
// ]

Promise

var balance = require("crypto-balance");
balance("DDogepartyxxxxxxxxxxxxxxxxxxw1dfzr").then(function(balances) {
  console.log(balances);
});

// [ { address: 'DDogepartyxxxxxxxxxxxxxxxxxxw1dfzr',
//  quantity: '1399253366.95050883',
//  asset: 'DOGE' } ]

Tests

npm test

License

MIT

crypto-balance's People

Contributors

larskluge avatar mondoreale 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.