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
# 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'
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))
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" }
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 |