Awesome Open Source
Awesome Open Source




Vulnerabilities Version Downloads GitHub Workflow Status Codecov



Get 5612 ERC-20 token balances with JavaScript. Supports Node.js and Deno.

JSON file is generated using TokenLists endpoitns

Usage

Node.js

import { ERC20Balance } from 'erc20-balance'
import * as dotenv from '@tinyhttp/dotenv'
import fetch from 'node-fetch'

globalThis.fetch = fetch

dotenv.config()

ERC20Balance({
  addr: '0xD3B282e9880cDcB1142830731cD83f7ac0e1043f',
  coin: 'LINK',
  apiKey: process.env.ETHERSCAN_KEY
}).then((res) => console.log(res))

Deno

import { ERC20Balance } from 'https://deno.land/x/erc20_balance/mod.ts'

ERC20Balance({
  addr: '0xD3B282e9880cDcB1142830731cD83f7ac0e1043f',
  coin: 'LINK',
  apiKey: Deno.env.get('ETHERSCAN_KEY')
}).then((res) => console.log(res))

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Typescript (251,857
Nodejs (53,830
Ethereum (6,963
Smart Contracts (2,243
Deno (1,453
Token (957
Erc20 (494
Erc20 Tokens (147
Related Projects