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

@rocketh/core

v0.23.1

Published

Core types and utilities for rocketh, the framework-agnostic deployment system for EVM smart contracts.

Readme

@rocketh/core

Shared types and utilities for the rocketh packages. This is the bottom of the dependency graph: it defines the Environment, Deployment, Artifact and Signer types every other package speaks, plus the helpers they all need (ABI merging, bigint-safe JSON, the extension mechanism).

Most users never install this directly. You get it transitively through rocketh, @rocketh/node and the extension packages, and the types are re-exported from those. Install it when you are writing your own rocketh extension and need the types without pulling in a runtime.

Installation

# Using pnpm
pnpm add @rocketh/core

# Using npm
npm install @rocketh/core

# Using yarn
yarn add @rocketh/core

Subpath exports

The package is split so a consumer can import just the slice it needs.

| Subpath | Contents | | --------------------------- | ----------------------------------------------------------------------------------------------------- | | @rocketh/core | Everything below, re-exported. | | @rocketh/core/types | All types: Environment, Deployment, Artifact, Signer, DeploymentConstruction, and the rest. | | @rocketh/core/artifacts | mergeABIs, mergeArtifacts. | | @rocketh/core/json | bigint-safe JSON helpers. | | @rocketh/core/environment | withEnvironment, enhanceEnvIfNeeded. | | @rocketh/core/providers | TransactionHashTrackerProvider. |

Account resolution is not a standalone helper: resolveAccount and resolveAccountOrUndefined are methods on Environment.

const deployer = env.resolveAccount('deployer'); // -> `0x${string}`

Type-only imports should use @rocketh/core/types:

import type {Environment, Deployment, Artifact} from '@rocketh/core/types';

Writing an extension

An extension is a package whose root exports curried (env) => … functions. withEnvironment turns each one into a method on the environment a deploy script receives, which is why a script writes deploy(...) and never threads env by hand.

// my-extension/src/index.ts
import type {Environment} from '@rocketh/core/types';

export function greet(env: Environment): (name: string) => void {
	return (name: string) => {
		env.showMessage(`hello ${name} on chain ${env.network.chain.id}`);
	};
}

Users spread it alongside the others:

// rocketh/config.ts
import * as deployExtension from '@rocketh/deploy';
import * as myExtension from 'my-extension';

const extensions = {...deployExtension, ...myExtension};

The root export surface may contain only curried functions

withEnvironment calls value(env) on every entry it is given. A class or a plain constant on the root is therefore refused by name:

extension entry "Foo" is a class, which cannot be called with the environment

Since this surfaces when a deploy script runs rather than at build time, the naming is what makes it diagnosable. Put anything that is not a curried function on a subpath export. @rocketh/unknown-signer keeps UnknownSignerError on ./errors for exactly this reason.

A getter, meaning (env) => value returning a non-function, is a supported second shape and becomes a property. The check is on the entry being callable, never on what it returns.

Utilities

mergeABIs(abis, options?) / mergeArtifacts(artifacts)

Combine several ABIs into one, detecting selector collisions. This is what lets @rocketh/diamond present a set of facets as a single contract.

JSON helpers

Deployment records contain bigint values, which JSON.stringify refuses. JSONToString and stringToJSON round-trip them, with postfixBigIntReplacer / postfixBigIntReviver as the underlying replacer/reviver pair, and toJSONCompatibleLinkedData for linkedData.

UnknownSignerError

Thrown when a transaction's from is an address rocketh cannot get a signature for. Carries the transaction and, where the call site knew it, the contract method and arguments, so the message names the call to run out of band rather than just an address. See @rocketh/unknown-signer for the catchUnknownSigner helper built on it.

TransactionHashTrackerProvider

An EIP-1193 provider wrapper that records the transaction hashes passing through it.

A note on Signer

The Signer union has three variants, and they are easy to get backwards:

| Variant | Meaning | Broadcast path | | ------------ | ------------------------------------------------------------------- | ---------------------------------------------------- | | signerOnly | We hold the signing material and sign locally. | eth_signTransaction, then eth_sendRawTransaction | | wallet | An external wallet signs on the user's behalf (browser / injected). | eth_sendTransaction | | remote | The node or provider signs. | eth_sendTransaction |

signerOnly, not wallet, is the locally-signing one. @rocketh/signer's privateKey protocol returns it, as should any user-supplied protocol exposing eth_signTransaction (a hardware wallet, an HSM).

Note also that signability is not the same as having an entry in addressSigners: a named account declared as a bare address resolves to a remote signer whether or not the node actually knows it.

Related packages

For full documentation, visit rocketh.dev.

For hardhat-deploy documentation, see rocketh.dev/hardhat-deploy/.