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

@parallel-protocol/chains

v0.5.0

Published

Parallel Protocol on-chain catalogue — chain ids, contract addresses, viem-typed ABIs

Readme

@parallel-protocol/chains

On-chain catalogue for the Parallel Protocol — viem chain objects, Parallel-specific contract addresses, and viem-typed ABIs.

Install

npm install @parallel-protocol/chains viem

viem is a peer dependency.

Design

Each entry in CHAINS_STATIC is a Parallel overlay on top of a canonical viem Chain object:

interface ChainStaticConfig {
  viem: ViemChain;        // id, name, native currency, RPCs, explorers, multicall3 — from viem/chains
  status: ChainStatus;    // "active" | "paused" | "sunset"
  lzEid: number;          // LayerZero V2 endpoint id
  contracts: ChainContracts; // Parallel-specific: usdp, parallelizer, susdp, bridgeableUsdp, …
}

viem stays the source of truth for chain id, name, native currency, default RPCs, block explorers, and multicall3. The two chains that don't ship multicall3 in viem (hyperEvm, hemi) get the canonical address injected.

Usage

import {
  CHAINS_STATIC,
  ACTIVE_CHAINS,
  PARALLELIZER_CHAINS,
  getUSDpAddress,
  isParallelizerChain,
} from "@parallel-protocol/chains";

CHAINS_STATIC.ethereum.viem.id;           // 1
CHAINS_STATIC.ethereum.viem.name;         // "Ethereum"
CHAINS_STATIC.ethereum.contracts.parallelizer;
// → "0x6efeDDF9269c3683Ba516cb0e2124FE335F262a2"

ACTIVE_CHAINS;
// → ["ethereum", "base", "arbitrum", …] (status: "active")

isParallelizerChain("ethereum"); // true
getUSDpAddress("base");          // "0x76A9A0062ec…"

Metered x402 payments (scheme upto) settle through the UptoEscrow contract, deployed per chain. UPTO_CHAINS lists the chains that carry one and getUptoEscrowAddress returns it; payers and facilitators take the address from here, never from an invoice.

import { UPTO_CHAINS, getUptoEscrowAddress } from "@parallel-protocol/chains";

UPTO_CHAINS;                   // → ["base"]
getUptoEscrowAddress("base");  // "0xcCA03ed95Ab…"

ABIs are exposed under the /abi subpath:

import { PARALLELIZER_ABI, ERC20_ABI, UPTO_ESCROW_ABI } from "@parallel-protocol/chains/abi";

Payment tokens

getTokenDecimals is the single source of truth for the decimals of every Parallel payment token — USDp, sUSDp, USDC and the Parallelizer backing collaterals — so merchant and payer sides price amounts identically:

import { getTokenDecimals, COLLATERAL_TOKENS } from "@parallel-protocol/chains";

getTokenDecimals("base", "0x76A9A0062ec…"); // 18  (USDp)
getTokenDecimals("base", "0x833589fCD6…"); // 6   (USDC)
getTokenDecimals("base", "0x820C137fa7…"); // 18  (USDS, a backing collateral)
getTokenDecimals("base", "0xdead…");       // undefined — outside the catalogue

COLLATERAL_TOKENS.base; // { "0x820c…": { symbol: "USDS", decimals: 18 }, … }

Values are verified on-chain and immutable per token; undefined lets callers decide their own fallback for tokens outside the catalogue.

Staking

SPRL2_CHAIN_ADDRESSES lists the sPRL2 v2 vault per chain (Ethereum and Base), BPT_POOL_IDS the Balancer V3 80PRL/20WETH pool it stakes on each of them (on V3 the pool id is the BPT address), and SPRL2_V2_ABI its interface. SPRL2_ADDRESS, BPT_POOL_ID and SPRL2_ABI are kept for existing code: the first two now point at the Ethereum v2 vault and pool, the ABI is still the v1 one. SPRL2_V1_ADDRESS is the paused v1 vault and SPRL2_MIGRATOR_ADDRESS the contract that moves a v1 position to v2 on Ethereum. PRL_CHAIN_ADDRESSES and WETH_CHAIN_ADDRESSES give the pool's two tokens on each chain, and REWARD_MERKLE_DISTRIBUTOR_CHAIN_ADDRESSES the epoch reward distributor per chain (Base since the migration, Polygon for the legacy history).

Composing your RPC layer

Pass .viem straight to createPublicClient — RPC URLs are intentionally not bundled so consumers stay free to pick Alchemy, Infura, public RPCs, or any combination:

import { createPublicClient, http } from "viem";
import { CHAINS_STATIC, PARALLELIZER_ABI } from "@parallel-protocol/chains";

const eth = createPublicClient({
  chain: CHAINS_STATIC.ethereum.viem,
  transport: http(`https://eth-mainnet.g.alchemy.com/v2/${process.env.ALCHEMY_KEY}`),
});

const fees = await eth.readContract({
  address: CHAINS_STATIC.ethereum.contracts.parallelizer!,
  abi: PARALLELIZER_ABI,
  functionName: "getCollateralRatio",
});

License

MIT