npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yaring/coinscheck

v1.0.0

Published

Blockchain balance checker

Readme

Here’s a technical English translation of your provided README:


CoinsCheck

A multi-network library for checking cryptocurrency wallet balances with support for a wide range of blockchains.

Supported Networks

  • EVM (Ethereum, BSC, Polygon, etc.)
  • Bitcoin
  • Litecoin
  • Dogecoin
  • Cardano
  • Cosmos
  • Monero
  • Polkadot
  • Solana
  • TON
  • TRON

Installation

npm install @yaring/coinscheck

Key Features

  • Balance checks across various blockchain networks
  • Provider caching for performance optimization
  • Address validation for all supported networks
  • Informative error handling
  • TypeScript support

Usage Examples

Basic Usage

const { BalanceChecker } = require('@yaring/coinscheck');
const checker = new BalanceChecker({
  timeout: 30000 // optional, timeout in ms
});

// Single network balance check
const chain = {
  chainId: '1',
  rpc: 'https://eth-mainnet.public.blastapi.io',
  chainType: 'EVM',
};

const balance = await checker.checkSingleChainBalance(
  '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  chain
);
console.log(balance);
// {
//   chainId: '1',
//   balance: '1000000000000000000',
//   chainType: 'EVM'
// }

Multi-network Balance Check

const balances = await checker.checkBalances([
  {
    address: '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
    chain: {
      chainId: '1',
      rpc: 'https://eth-mainnet.public.blastapi.io',
      chainType: 'EVM',
    },
  },
  {
    address: 'DRpbCBMxVnDK7maPM5tGv6MvB3v1sRMC86PZ8okm21hy',
    chain: {
      chainId: 'solana-mainnet',
      rpc: 'https://api.mainnet-beta.solana.com',
      chainType: 'SOLANA',
    },
  },
]);

Address Validation

const { AddressValidator } = require('@yaring/coinscheck');

// EVM address validation
const isValidEvm = AddressValidator.validateAddress(
  '0x742d35Cc6634C0532925a3b844Bc454e4438f44e',
  'EVM'
);

// Solana address validation
const isValidSolana = AddressValidator.validateAddress(
  'DRpbCBMxVnDK7maPM5tGv6MvB3v1sRMC86PZ8okm21hy',
  'SOLANA'
);

API Reference

Class BalanceChecker

Constructor

new BalanceChecker(options?: {
  timeout?: number; // timeout in milliseconds, default is 30000
});

Methods

checkSingleChainBalance(address: string, chain: Chain): Promise<Balance>

Checks the balance for a single address in a specified network.

interface Chain {
  chainId: string;
  rpc: string;
  chainType: string;
  name?: string;
  nativeDenom?: string; // for Cosmos-based networks
}
interface Balance {
  chainId: string;
  balance: string;
  chainType: string;
  error?: string;
}
checkBalances(items: CheckItem[]): Promise<Balance[]>

Checks balances for an array of addresses across different networks.

interface CheckItem {
  address: string;
  chain: Chain;
}
dispose(): void

Releases resources and closes connections to providers.

Class AddressValidator

Static Methods

validateAddress(address: string, chainType: string): boolean

Validates the address format for a given network type.

validateAddressFormat(address: string, chainType: string): boolean

Checks if the address matches the regular expression for the specified network type.

getAddressExamples(): Record<string, string>

Returns examples of valid addresses for each network type.

getTestAddresses(): Record<string, { valid: string[], invalid: string[] }>

Provides sets of valid and invalid addresses for testing.

Supported Address Formats

  • EVM: 0x[0-9a-fA-F]{40}
  • Solana: [1-9A-HJ-NP-Za-km-z]{32,44}
  • Cosmos: [chain-prefix]1[a-zA-Z0-9]{38}
  • Bitcoin: (1|3|bc1)[a-zA-HJ-NP-Z0-9]{25,62}
  • Polkadot: [1-9A-HJ-NP-Za-km-z]{47,48}
  • TRON: T[A-Za-z1-9]{33}
  • TON: (?:EQ|UQ)[a-zA-Z0-9_-]{48}

Error Handling

The library provides informative error messages for each network:

try {
  const balance = await checker.checkSingleChainBalance(address, chain);
} catch (error) {
  console.error(error.message);
  // Example messages:
  // "EVM balance check failed: invalid response from RPC"
  // "Solana balance check failed: invalid address"
  // "TRON balance check failed: network error"
}

License

MIT


Let me know if you need further adjustments!