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

coinmerge-libraries

v1.4.0

Published

Coinmerge blockchain tools

Readme

Coinmerge Libraries

Install with npm i @coinmerge/coinmerge-libraries

Test with npm test

Libraries

require('@coinmerge/coinmerge-libraries/interface/evm');
require('@coinmerge/coinmerge-libraries/interface/pools');
require('@coinmerge/coinmerge-libraries/interface/prices');
require('@coinmerge/coinmerge-libraries/interface/tokens');
require('@coinmerge/coinmerge-libraries/interface/transactions');
require('@coinmerge/coinmerge-libraries/interface/wallets');

EVMLib

Access blockchain data directly with web3 libraries.

const { EVMLib, EVMChain, ABILib } = require('@coinmerge/coinmerge-libraries/interface/evm');

// Access EVM sub-libraries (books)
const getEVMBooks = function() {
  const _lib = new EVMLib(EVMChain.ETH);
  const _erc20 = _lib.erc20;
  const _tx = _lib.tx;
  const _contracts = _lib.contracts;
  const _pools = _lib.pools;
  const _stats = _lib.stats;
  const _blocks = _lib.blocks;
}

// Organize EVM libs by chain
const getEVMLibs = function() {
  return {
    eth: new EVMLib(EVMChain.ETH),
    bsc: new EVMLib(EVMChain.BSC)
  }
}

Transactions

  • async getTransaction(_tx: address): Transaction
  • async getTransactionReceipt(_tx: address): Receipt
  • async didTransactionSucceedFromHash(_tx: address): boolean
  • async didTransactionSucceedFromReceipt(_receipt: Receipt): boolean
const { EVMLib, EVMChain, ABILib } = require('@coinmerge/coinmerge-libraries/interface/evm');

const getTransaction = async function() {
  const _lib = new EVMLib(EVMChain.ETH);
  _lib.resetCallStack();
  const _tx = new _lib.tx.getTransaction('0x2e2244b5c75b15922203cd7b69f9a598a6210ce8091afc40163d23de4dfca087');
  _lib.callStack.print();
  _lib.dispose();
  return _tx;
}

Contracts

  • async call(_addr: address, _func: string, _inT: string[], _in: string[], _outT: string[]): any
  • async getPastEvents(_addr: address, _evt: string, _startBlock: number, _endBlock: number, _abi: object): Transaction[]
const { EVMLib, EVMChain, ABILib } = require('@coinmerge/coinmerge-libraries/interface/evm');

const lib = new EVMLib(EVMChain.ETH);
lib.resetCallStack();

const getTotalSupply = async function() {
  const _supply = await lib.contracts.call('0x2b591e99afe9f32eaa6214f7b7629768c40eeb39', 'totalSupply', [], [], ['uint256']);
  return _supply;
}

const getTransferEvents = async function() {
  const _currentBlock = await lib.blocks.getBlock();
  const _evts = await lib.contracts.getPastEvents('0x2b591e99afe9f32eaa6214f7b7629768c40eeb39', 'Transfer', _currentBlock-10, _currentBlock, (new ABILib()).ABI_ERC20);
  return _evts;
}

const supply = await getTotalSupply();
const events = await getTransferEvents();

lib.callStack.print();
lib.dispose();

ERC20

  • async symbol(_addr: address): string
  • async name(_addr: address): string
  • async decimals(_addr: address): number
  • async totalSupply(_addr: address, _block?: number): number
  • async balanceOf(_addr: address, _holder: address, _block?: number): number
  • async allowance(_addr: address, _owner: address, _spender: address, _block?: number): number
  • async info(_addr: address): object
const { EVMLib, EVMChain, ABILib } = require('@coinmerge/coinmerge-libraries/interface/evm');

const getTokenInfo = async function() {
  const _lib = new EVMLib(EVMChain.ETH);
  _lib.resetCallStack();
  const _info = await _lib.erc20.info('0x2b591e99afe9f32eaa6214f7b7629768c40eeb39');
  _lib.callStack.print();
  _lib.dispose();
  return _info;
}

Pools

  • async getReserves(_pool: address, _block?: number): object
  • async getDataFromPairCreatedEvent(_e: Transaction): object
const { EVMLib, EVMChain, ABILib } = require('@coinmerge/coinmerge-libraries/interface/evm');
const { AuthorityPriceLib } = require('@coinmerge/coinmerge-libraries/interface/prices');

const getReserves = async function() {
  const _authorityPriceLib = new AuthorityPriceLib();
  const _evmLib = new EVMLib(EVMChain.ETH).attachAuthorityPriceLib(_authorityPriceLib);
  _evmLib.resetCallStack();
  const _reserves = await _lib.pools.getReserves('0x2b591e99afe9f32eaa6214f7b7629768c40eeb39');
  _evmLib.callStack.print();
  _evmLib.dispose();
  return _reserves;
}

Stats

  • async getIntervalPriceChanges(_stats: object, _base: object, _token: object, _pool: address): object
  • async getTokenStats(_base: object, _token: object, _pool: address, _block?: number): object
  • async getPrice(_token: object, _base: object, _pool: address, _block?: number): number
  • async getTokenInfoFromPoolAddress(_pool: address): object
  • async getFullyDilutedMarketCap(_token: object, _base: object, _pool: address): number
  • async getPooledBase(_base: object, _token: object, _pool: address, _block?: number): number
  • async getPooledToken(_token: object, _pool: address, block?: number): number
const { EVMLib, EVMChain, ABILib } = require('@coinmerge/coinmerge-libraries/interface/evm');

const getTokenInfoFromPoolAddress = async function() {
  const _lib_ = new EVMLib(EVMChain.ETH);
  _lib_.resetCallStack();
  const _stats = await _lib.stats.getTokenInfoFromPoolAddress('0x2b591e99afe9f32eaa6214f7b7629768c40eeb39');
  _lib_.callStack.print();
  _lib_.dispose();
  return _stats;
}

Blocks

  • async getBlock(): number
  • async getBlockAt(_number: number): number
  • async getBlockAtTimestamp(_timestamp: EpochSeconds, _padding?: number): number
  • async getBlockIntervals(): object
const { EVMLib, EVMChain, ABILib } = require('@coinmerge/coinmerge-libraries/interface/evm');

const getBlockAtTimestamp = async function() {
  const _lib_ = new EVMLib(EVMChain.ETH);
  _lib_.resetCallStack();
  const _block = await _lib.blocks.getBlockAtTimestamp((Date.now()/1000) - 1*24*60*60);
  _lib_.callStack.print();
  _lib_.dispose();
  return _block;
}

ABILib

  • ABI_ERC20: object
  • ABI_EXCHANGE_FACTORY: object
  • ABI_EXCHANGE_PAIR: object
  • ABI_EXCHANGE_ROUTER: object
  • ABI_MULTICALL: object

EVM Scanner

const { EVMLib, EVMChain } = require('@coinmerge/coinmerge-libraries/interface/evm');

const scanOnce = async function() {
  const _lib = new EVMLib(EVMChain.ETH);
  const _db_identifier = 'test_scanner';
  const _scanner = await _lib.createScanner(_db_identifier);
  _scanner.onBlocksReceived = (_blocks) => {
      console.log(`received ${_blocks.length} blocks`);
      // do processing
  };
  await _scanner.scan(true);
  _scanner.dispose();
  _lib.dispose();
}

Pools

Access pool data stored in the database

const { PoolLib } = require('@coinmerge/coinmerge-libraries/pools');

const getData = async function() {
  // impl
}

TODO

Prices

Access price data stored in the database

const { AuthorityPriceLib, PriceLib } = require("@coinmerge/coinmerge-libraries/interface/db/prices");
const { EVMLib, EVMChain } = require("@coinmerge/coinmerge-libraries/interface/evm");

const authorityPriceLib = new AuthorityPriceLib();
const evmLib = {
  eth: new EVMLib(EVMChain.ETH).attachAuthorityPriceLib(authorityPriceLib),
  bsc: new EVMLib(EVMChain.BSC).attachAuthorityPriceLib(authorityPriceLib)
}
const priceLib = {
  eth: (new PriceLib()).attachEVMLib(evmLib.eth),
  bsc: (new PriceLib()).attachEVMLib(evmLib.bsc),
} 

const getData = async function() {
  const _pool = '0x8dd01a6c31415549f5e7565c189156f52a3887c7';
  const _token = '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce';
  const _poolPrice = await priceLib.eth.getPriceOfPool(_pool);
  const _allPoolPricesForToken = await priceLib.eth.getPoolPricesForToken(_token);
  priceLib.eth.dispose();
}

TODO

Tokens

Access token data stored in the database

const { TokenLib } = require('@coinmerge/coinmerge-libraries/tokens');

const getData = async function() {
  // impl
}

TODO

Transactions

Access transaction data stored in the database

const { TransactionLib } = require('@coinmerge/coinmerge-libraries/transactions');

const getData = async function() {
  // impl
}

TODO

Wallets

Access wallet data stored in the database

const { WalletLib } = require('@coinmerge/coinmerge-libraries/wallets');

const getData = async function() {
  // impl
}

TODO