0.2.15 • Published 3 years ago
balance-crypto v0.2.15
Get wallet balance for 5.8K+ cryptocurrencies with a single function.
Comparison to crypto-balances-2:
- 🔐 API keys support (for EtherScan and BlockCypher)
- 💙 written in TypeScript
- ⚡ doesn't depend on request libraries
- 📦 smaller library size
- 🦕 Deno and Node.js support
Install
# pnpm
pnpm i balance-crypto
# yarn
yarn add balance-crypto
# npm
npm i balance-crypto
To use the module in Deno import it like this: import { balance } from 'https://deno.land/x/balance_crypto/deno/mod.ts'
Example
Node.js
import { balance } from 'balance-crypto'
import fetch from 'node-fetch'
balance('3PxedDftWBXujWtr7TbWQSiYTsZJoMD8K5', 'BTC', {
keys: {
etherscan: process.env.ETHERSCAN_KEY,
blockcypher: process.env.BLOCKYCPHER_KEY
},
verbose: true
}).then((res) => console.log(res))
Deno
import { balance } from 'https://deno.land/x/balance_crypto/deno/mod.ts'
balance('3PxedDftWBXujWtr7TbWQSiYTsZJoMD8K5', 'BTC', {
keys: {
etherscan: Deno.env.get('ETHERSCAN_KEY'),
blockcypher: Deno.env.get('BLOCKYCPHER_KEY')
},
verbose: true
}).then((res) => console.log(res))
Result:
{ "balance": 0, "asset": "BTC" }
Supported cryptos
Asset | Service | API key |
---|---|---|
ETH, ERC-20 tokens | https://etherscan.io | ✔️ |
BTC, DASH, LTC, DOGE | https://blockcypher.com | ✔️ (optional) |
BTC-based tokens | https://chainz.cryptoid.info | |
ADA | https://explorer.cardano.org |
Donate
The best way to support the project is to stake it on DEV. Note that you also get rewarded by staking, as well as the project author.
These 3 addresses were rewarded with 10DEV as a bonus for staking:
- 0xE603eB00619E81d8b4954be13B59D7B6A2DC2B75
- 0x257f2d64A2C51584e2e650e9Fd9bC4A0621c549F
- 0xDEd284B5c60FFC7BdBe707a10de301D566eCA86D (jerryrigg411420)
0.2.15
3 years ago
0.2.14
3 years ago
0.2.13
3 years ago
0.2.8
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.18
3 years ago
0.1.0
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.2.7
3 years ago
0.2.6
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.5
3 years ago
0.2.4
3 years ago
0.0.15
3 years ago
0.0.14
3 years ago
0.0.11
3 years ago
0.0.13
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.4
3 years ago
0.0.3
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago
0.0.0
3 years ago