1 | # crypto-balance
|
2 |
|
3 | Query various crypto tokens for their address balances.
|
4 |
|
5 | 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.
|
6 |
|
7 |
|
8 | ## Supported Tokens
|
9 |
|
10 | - Bitcoin
|
11 | - Litecoin
|
12 | - Dogecoin
|
13 | - All tokens created on Counterparty
|
14 | - All tokens created on Dogeparty
|
15 |
|
16 |
|
17 | ## Installation
|
18 |
|
19 | ```
|
20 | ~ » npm install crypto-balance
|
21 | ```
|
22 |
|
23 |
|
24 | ## How to Use
|
25 |
|
26 |
|
27 | ### Command Line
|
28 |
|
29 | ```
|
30 | ~ » npm install -g crypto-balance # for global installation of _balance_
|
31 | ~ » balance DDogepartyxxxxxxxxxxxxxxxxxxw1dfzr ~
|
32 | 1,009,968,741.03499746 DOGE
|
33 | ~ » balance 1LARSvRshS9Nm3D3aWLELQjNYtaBrWGzg2 ~
|
34 | 0.00010860 BTC
|
35 | 42.00000000 XCP/LARS
|
36 | ```
|
37 |
|
38 |
|
39 | ### Node.js
|
40 |
|
41 | ```
|
42 | var balance = require('crypto-balance');
|
43 | balance("DCt8sxHX634ghqdDhWFtCPQUyZ3TEfLBCo", function(error, assets) {
|
44 | console.log(assets);
|
45 | });
|
46 |
|
47 | // [ { address: 'DCt8sxHX634ghqdDhWFtCPQUyZ3TEfLBCo',
|
48 | // balance: 100000000,
|
49 | // token: 'XDP/DOGEPARTY' },
|
50 | // { address: 'DCt8sxHX634ghqdDhWFtCPQUyZ3TEfLBCo',
|
51 | // balance: 500000000000,
|
52 | // token: 'XDP/DOLLARS' },
|
53 | // ...
|
54 | // ]
|
55 | ```
|
56 |
|
57 |
|
58 | ### Promise
|
59 |
|
60 | ```
|
61 | var balance = require("crypto-balance");
|
62 | balance("DDogepartyxxxxxxxxxxxxxxxxxxw1dfzr").then(function(balances) {
|
63 | console.log(balances);
|
64 | });
|
65 |
|
66 | // [ { address: 'DDogepartyxxxxxxxxxxxxxxxxxxw1dfzr',
|
67 | // balance: '1399253366.95050883',
|
68 | // token: 'DOGE' } ]
|
69 | ```
|
70 |
|
71 |
|
72 | ## License
|
73 |
|
74 | [MIT](https://github.com/larskluge/crypto-balance/blob/master/LICENSE)
|
75 |
|