npm.io
0.26.1 • Published 1 week ago

@rocketh/core

Licence
MIT
Version
0.26.1
Deps
4
Size
232 kB
Vulns
0
Weekly
0
Stars
35

@rocketh/core

The types and utilities every rocketh package shares: Environment, Deployment, Artifact, Signer, UserConfig and the rest, plus ABI merging, bigint-safe JSON and withEnvironment, which turns extensions into methods of the environment a deploy script receives. It is the bottom of the dependency graph and has no runtime of its own.

Most projects never install it: it comes with rocketh and the extensions, which re-export its types. Install it to write your own extension against the types without pulling in a runtime.

Installation

pnpm add @rocketh/core
# or
npm install @rocketh/core

Example

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

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

An extension package's root may export only such curried (env) => ... functions (or getters); anything else goes on a subpath. The subpaths are @rocketh/core/types, /artifacts, /json, /environment and /providers.

Documentation

The whole documentation is at rocketh.dev, the hardhat-deploy section at rocketh.dev/hardhat-deploy.

License

MIT

Keywords