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

chaingate

v1.1.1

Published

Multi-chain cryptocurrency SDK for TypeScript — unified API for Bitcoin, Ethereum, Litecoin, Dogecoin, Bitcoin Cash, Polygon, Arbitrum, and any EVM-compatible chain. Create wallets, query balances, send transactions, and manage tokens and NFTs across UTXO

Downloads

1,069,548

Readme



Features

  • 👛 Wallet management -- Create HD wallets from mnemonics, import from seed, xpriv, xpub, private key, WIF, or keystores
  • ⛓️ Multi-chain -- Bitcoin, Litecoin, Dogecoin, Bitcoin Cash, Ethereum, and any EVM chain via RPC
  • 📍 Address derivation -- BIP-44/84/86 with segwit, legacy, taproot, cashaddr, and EOA
  • 🔍 Blockchain explorer -- Balances, transactions, UTXOs, blocks, fees, tokens, and NFT metadata
  • 📤 Transactions -- Send coins, ERC-20 tokens, NFTs, and call smart contracts with suggested fees
  • 🔒 Encryption -- AES-256-GCM wallet encryption with password protection
  • ✍️ Message signing -- EIP-191 (EVM) and Bitcoin-standard signing and verification
  • 💱 Fiat conversion -- Live conversion to 160+ currencies
  • 👁️ View-only wallets -- Read-only access from xpub or public key

Install

npm install chaingate

Examples

Send $20 in Bitcoin

import { ChainGate, importWallet } from 'chaingate';

const cg = new ChainGate({ apiKey: 'your-api-key' });
const wallet = importWallet({ phrase: 'abandon abandon abandon ...' });
const btc = cg.connect(cg.networks.bitcoin, wallet);

// Convert $20 USD to the equivalent BTC amount at current market rate
const amount = await cg.networks.bitcoin.amountFromCurrency('usd', 20);

const tx = await btc.transfer(amount, 'bc1qRecipient...');

// Review suggested fees and pick one
const fees = tx.recommendedFees();
console.log(fees.normal.estimatedFeeSat); // estimated fee in satoshis
console.log(fees.normal.enoughFunds); // true if balance covers amount + fee
tx.setFee(fees.high);

const broadcasted = await tx.signAndBroadcast();
console.log('txid:', broadcasted.transactionId);

Token Balances (ERC-20, ERC-721, ERC-1155)

const eth = cg.connect(cg.networks.ethereum, wallet);

const tokens = await eth.addressTokenBalances();

for (const token of tokens) {
  if (token.isNFT) {
    // ERC-721 or ERC-1155
    console.log(`${token.name} -- ${token.ownedTokens.length} NFTs`);
  } else {
    // ERC-20
    console.log(`${token.base()} ${token.symbol}`); // e.g. "1500.50 USDC"
  }
}

Transaction History (EVM)

Full decoded history with token transfers, approvals, wraps, and more:

const eth = cg.connect(cg.networks.ethereum, wallet);
const history = await eth.addressHistory();

for (const tx of history.transactions) {
  console.log(tx.txHash, new Date(tx.timestamp * 1000));

  // Decoded actions relevant to your address
  for (const action of tx.actions) {
    // action.type: "transfer_in", "transfer_out", "mint", "burn", "wrap", "unwrap", ...
    // action.token: { name, symbol, decimals, logoUrl }
    // action.contract: contract address or "native" for ETH transfers
    console.log(`  ${action.type} on ${action.token.symbol ?? 'ETH'}`);
  }
}

Transaction History (UTXO)

const btc = cg.connect(cg.networks.bitcoin, wallet);
const history = await btc.addressHistory();

for (const tx of history.transactions) {
  const usd = await tx.amount.toCurrency('usd');
  console.log(`${tx.txid}: ${tx.amount.base()} BTC ($${usd})`);
}

Create a Wallet and Check Balance

import { ChainGate, newWallet } from 'chaingate';

const cg = new ChainGate({ apiKey: 'your-api-key' });

const { phrase, wallet } = newWallet();
console.log('Mnemonic:', phrase);

const eth = cg.connect(cg.networks.ethereum, wallet);
const balance = await eth.addressBalance();
const usd = await balance.confirmed.toCurrency('usd');
console.log(`${balance.confirmed.base()} ${balance.confirmed.symbol} ($${usd})`);

Import a Wallet

import { importWallet, createWalletFromString } from 'chaingate';

// From mnemonic
const wallet = importWallet({ phrase: 'abandon abandon abandon ...' });

// From private key
importWallet({ privateKey: '0x...' });

// From xpub (view-only)
importWallet({ xpub: 'xpub...' });

// Auto-detect any format
const wallet = createWalletFromString('xprv9s21ZrQH143K...');

Send ERC-20 Tokens

const eth = cg.connect(cg.networks.ethereum, wallet);

const usdc = cg.networks.ethereum.amount('100', {
  contractAddress: '0xA0b8...eB48',
  decimals: 6,
  symbol: 'USDC',
});

const tx = await eth.transferToken(usdc, '0xRecipient...');
await tx.signAndBroadcast();

Send NFTs

// ERC-721
const tx = await eth.transferNft('0xNftContract...', '0xRecipient...', tokenId);

// ERC-1155 (with quantity)
const tx = await eth.transferErc1155('0xNftContract...', tokenId, 5, '0xRecipient...');

Connect to Any EVM Chain

const bsc = cg.networks.evmRpc({
  rpcUrl: 'https://bsc-dataseed.binance.org',
  chainId: 56,
  name: 'BNB Smart Chain',
  symbol: 'BNB',
});

const conn = cg.connect(bsc, wallet);
const balance = await conn.addressBalance();

Encrypt and Save a Wallet

await wallet.encrypt('my-password');
const data = wallet.serialize();

// Restore later
import { deserializeWallet } from 'chaingate';
const restored = deserializeWallet(data, async () => {
  return prompt('Enter password:');
});

Validate Addresses

cg.networks.bitcoin.isValidAddress('bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4'); // true
cg.networks.ethereum.isValidAddress('0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'); // true
cg.networks.bitcoincash.isValidAddress('bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a'); // true

cg.networks.bitcoin.isValidAddress('0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B'); // false
cg.networks.ethereum.isValidAddress('not-an-address'); // false

Sign Messages

import { signEvmMessage, verifyEvmMessage } from 'chaingate';

// EVM (EIP-191)
const signature = signEvmMessage('Hello', privateKey);
const isValid = verifyEvmMessage('Hello', signature, address);

Supported Networks

| Network | Address Types | | --------------- | ----------------------- | | Bitcoin | segwit, legacy, taproot | | Litecoin | segwit, legacy | | Dogecoin | legacy | | Bitcoin Cash | cashaddr, legacy | | Bitcoin Testnet | segwit, legacy, taproot | | Ethereum | EOA | | Any EVM via RPC | EOA |

RPC proxy URLs included for Ethereum, Polygon, Arbitrum, Avalanche, BNB Chain, Base, and Sonic.