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

@metalayer/viem-chains

v0.2.10

Published

Viem Chain configurations for Chains and Rollups in the Caldera and Metalayer ecosystem.

Downloads

46

Readme

@metalayer/viem-chains

A collection of viem Chain definitions for the rollups in the Caldera and Metalayer ecosystem.

Installation

pnpm add @metalayer/viem-chains
# or with npm
npm install @metalayer/viem-chains
# or with yarn
yarn add @metalayer/viem-chains

Usage

The Chain definitions in this package are fully compatible with viem. Import the chain you want to use in viem and create a client:

import { createPublicClient, http } from 'viem';
import { apechain } from '@metalayer/viem-chains';

const client = createPublicClient({
  chain: apechain,
  transport: http(),
});

Recommended Chains

For mainnet and testnet integrations with Caldera's Metalayer, use the following:

import { METALAYER_MAINNETS, METALAYER_TESTNETS } from '@metalayer/viem-chains';

These provide comprehensive configurations for mainnet and testnet environments.

CalderaMetadata

We include a metadata object in our Chains to append some additional information.

In order to access this metadata we provide a type guard function hasCalderaMetadata that validates that the metadata key is present in the chain and type casts the object.

import { apechain, hasCalderaMetadata } from '@metalayer/viem-chains';

if (hasCalderaMetadata(apechain)) {
  return apechain.metadata.stack;
}

Solana Support

This package also includes viem style Chain definitions for Solana and SolanaDevnet

import { solana, solanaDevnet } from '@metalayer/viem-chains';

Solana IDs

Because Solana doesn't have the concept of a chain id, different providers use their own ids to refer to the network.

In our case the ids are the following:

  1. Solana Mainnet - 501494 which stands for SOLANA if you think of the 9 as Nine
  2. Solana Devnet - 5017357 which stands for SOLTEST

Utility functions

We provide 2 utility functions getSolanaConfig and isSolana

import { getSolanaConfig, isSolana } from '@metalayer/viem-chains';

function getSolanaConfig(chainId: number): CalderaChain | undefined;
function isSolana(chain: Chain | number): boolean;
  • getSolanaConfig - given a chainId (number), it will return solana, solanaDevnet or undefined
  • isSolana - given a chainId (number) or a chain (Chain), it will return true or false to indicate if the input represents a Solana chain.

Provider Ids

As mentioned above, each provider defines their own IDs to refer to Solana. The solana objects also provide an optional providerIds object inside the metadata to return the known IDs that other providers use to identify chains.

At this time we only define relay, but in the future we might include other providers like coingecko, across, eco, etc

import { solana } from '@metalayer/viem-chains';

solana.metadata.providerIds?.relay