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

@range-security/asset-resolver

v1.0.5

Published

Cross-chain token resolver.

Readme

@range-security/asset-resolver

Cross-chain token resolver.

Install

yarn add @range-security/asset-resolver

Environment

| Variable | Required | |---|---| | ASSET_REDIS_URL | Yes | | EVM_REDIS_URL | Yes | | IDL_REDIS_URL | For getProgramIdl | | HISTORIC_PRICES_URL | For historical prices |

Production Environments

Resolve a denom/address to symbol, decimals and live USD price, or convert a raw on-chain amount to a human-readable form.

import {
  resolveToken,
  resolveAmount,
  disconnectAll,
} from '@range-security/asset-resolver';

const token = await resolveToken('uatom', 'cosmoshub');
// { symbol: 'ATOM', decimals: 6, usd: 4.21, cg: 'cosmos', ... }

const amount = await resolveAmount('1500000', 'uatom', 'cosmoshub');
// { amount: '1.5', symbol: 'ATOM', usd: 6.31, tokenUsdString: '1.5 ATOM($6.31)', ... }

await disconnectAll(); // close redis on shutdown

Routing:

  • network === 'solana' → Solana resolver
  • network === 'stellar' → Stellar resolver
  • everything else → cosmos/EVM cascade (priced assets → cosmos registry → IBC fallback → EVM registry)

Test Environment

Override resolutions in tests without hitting Redis. All setup helpers throw unless NODE_ENV=test.

import {
  setupToken,
  setupNetwork,
  setupNetworkMapping,
  resetTestOverrides,
  resolveToken,
} from '@range-security/asset-resolver';

beforeEach(() => resetTestOverrides());

setupToken('uatom', 'cosmoshub', {
  symbol: 'ATOM',
  decimals: 6,
  usd: 10,
  cg: 'cosmos',
});

setupNetwork({ id: 'cosmoshub', /* ... */ });
setupNetworkMapping({ from: 'cosmoshub', bridge: 'ibc', to: 'cosmos-hub' });

const token = await resolveToken('uatom', 'cosmoshub'); // returns the override

Historical Prices

Switch the resolver into historical mode — resolveToken / resolveAmount return USD as of the given day for any token with a cg (CoinGecko id). Snapshots are cached on disk under <cwd>/.asset-resolver-cache/<YYYY-MM-DD>.json.

import {
  setHistoricalPrices,
  clearHistoricalPrices,
  resolveAmount,
} from '@range-security/asset-resolver';

await setHistoricalPrices('2024-01-15');           // ISO string
// or: await setHistoricalPrices(Date.now() - 86_400_000);
// or: await setHistoricalPrices(dayjs().subtract(7, 'day'));

const amount = await resolveAmount('1500000', 'uatom', 'cosmoshub');
// amount.usd uses the 2024-01-15 price; amount.priceHistorical === true

clearHistoricalPrices(); // back to live prices

Tokens without a cg id, or missing from that day's snapshot, pass through with their live price and priceHistorical: false. State is module-level — concurrent callers in the same process share one date.