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/verifier

v0.18.5

Published

submit verification proof to verifier services (blockchain explorer, sourcify...

Readme

@rocketh/verifier

Contract verification tool for Rocketh. Submit your deployed contracts for verification on Etherscan, Sourcify, Blockscout, and other verification services.

Features

  • Multi-Platform - Support for Etherscan, Sourcify, and Blockscout
  • 🔧 CLI Tool - Easy-to-use command line interface
  • 📦 Automatic Metadata - Uses deployment metadata for verification
  • ⚙️ Configurable - Custom endpoints, API keys, and options

Installation

# Using pnpm
pnpm add @rocketh/verifier

# Using npm
npm install @rocketh/verifier

# Using yarn
yarn add @rocketh/verifier

CLI Usage

The package provides a rocketh-verify CLI command.

Verify on Etherscan

# Basic usage
rocketh-verify -e mainnet etherscan

# With custom options
rocketh-verify -e mainnet etherscan --license MIT --force-license

# With custom endpoint (for Etherscan-compatible explorers)
rocketh-verify -e polygon etherscan --endpoint https://api.polygonscan.com/api

Verify on Sourcify

# Basic usage
rocketh-verify -e mainnet sourcify

# With custom endpoint
rocketh-verify -e mainnet sourcify --endpoint https://sourcify.dev/server

Verify on Blockscout

# Basic usage
rocketh-verify -e mainnet blockscout

# With custom endpoint
rocketh-verify -e gnosis blockscout --endpoint https://blockscout.com/xdai/mainnet/api

Export Metadata

Export contract metadata for manual verification:

rocketh-verify -e mainnet metadata --out ./metadata

CLI Options

Global Options

| Option | Description | |--------|-------------| | -e, --environment <value> | (Required) Environment/network name | | -d, --deployments <value> | Deployments folder path |

Etherscan Options

| Option | Description | |--------|-------------| | --endpoint <value> | Custom API endpoint | | --license <value> | Source code license (e.g., MIT, GPL-3.0) | | --force-license | Force the specified license | | --min-interval <value> | Minimum interval between requests (ms) | | --fix-mispell | Fix misspelled form fields (some APIs) |

Environment Variable: ETHERSCAN_API_KEY

Sourcify Options

| Option | Description | |--------|-------------| | --endpoint <value> | Custom Sourcify endpoint | | --min-interval <value> | Minimum interval between requests (ms) |

Blockscout Options

| Option | Description | |--------|-------------| | --endpoint <value> | Custom Blockscout API endpoint | | --min-interval <value> | Minimum interval between requests (ms) |

Programmatic Usage

You can also use the verifier programmatically:

import { run } from '@rocketh/verifier';

await run(resolvedConfig, 'mainnet', {
  verifier: {
    type: 'etherscan',
    apiKey: process.env.ETHERSCAN_API_KEY,
    license: 'MIT',
  },
  deploymentNames: ['MyContract', 'MyToken'], // Optional: specific contracts
  minInterval: 1000, // Optional: rate limiting
  logErrorOnFailure: true,
});

API Reference

run(config, environmentName, options)

Runs the verification process.

Parameters:

  • config: ResolvedUserConfig - Resolved Rocketh configuration
  • environmentName: string - Name of the environment (e.g., 'mainnet', 'sepolia')
  • options: VerificationOptions - Verification options

Verification Options

interface VerificationOptions {
  verifier: EtherscanOptions | SourcifyOptions | BlockscoutOptions;
  deploymentNames?: string[];   // Specific contracts to verify
  minInterval?: number;         // Rate limiting (ms between requests)
  logErrorOnFailure?: boolean;  // Log errors instead of throwing
}

Etherscan Options

interface EtherscanOptions {
  type: 'etherscan';
  endpoint?: string;      // Custom API endpoint
  apiKey?: string;        // Etherscan API key
  license?: string;       // SPDX license identifier
  forceLicense?: boolean; // Override contract license
  fixMispell?: boolean;   // Fix API form field spelling
}

Sourcify Options

interface SourcifyOptions {
  type: 'sourcify';
  endpoint?: string; // Custom Sourcify endpoint
}

Blockscout Options

interface BlockscoutOptions {
  type: 'blockscout';
  endpoint?: string; // Custom Blockscout API endpoint
}

Supported Networks

Etherscan Networks

The verifier automatically detects the correct Etherscan endpoint for common networks:

| Network | Chain ID | Endpoint | |---------|----------|----------| | Ethereum Mainnet | 1 | api.etherscan.io | | Goerli | 5 | api-goerli.etherscan.io | | Sepolia | 11155111 | api-sepolia.etherscan.io | | Polygon | 137 | api.polygonscan.com | | Arbitrum | 42161 | api.arbiscan.io | | Optimism | 10 | api-optimistic.etherscan.io | | Base | 8453 | api.basescan.org |

For other networks, use the --endpoint option.

Sourcify

Sourcify supports all EVM chains. The default endpoint is https://sourcify.dev/server.

Blockscout

Blockscout is self-hosted by many chains. Use the --endpoint option to specify the correct API URL for your chain.

Examples

Verify All Contracts on Mainnet

# Set your API key
export ETHERSCAN_API_KEY=your-api-key

# Verify all deployed contracts
rocketh-verify -e mainnet etherscan

Verify Specific Contracts

import { run } from '@rocketh/verifier';

await run(config, 'mainnet', {
  verifier: {
    type: 'etherscan',
    apiKey: process.env.ETHERSCAN_API_KEY,
  },
  deploymentNames: ['Token', 'TokenSale'], // Only verify these
});

Verify on Multiple Platforms

# Verify on Etherscan
rocketh-verify -e mainnet etherscan

# Also verify on Sourcify for decentralized verification
rocketh-verify -e mainnet sourcify

Custom Deployments Folder

rocketh-verify -d ./custom-deployments -e mainnet etherscan

Troubleshooting

"Already Verified"

This is not an error - it means the contract is already verified on the platform.

Rate Limiting

Use --min-interval to add delays between verification requests:

rocketh-verify -e mainnet etherscan --min-interval 5000

Missing API Key

Etherscan requires an API key. Get one at:

Wrong Network Endpoint

For Etherscan-compatible explorers, ensure you're using the correct API endpoint:

rocketh-verify -e bsc etherscan --endpoint https://api.bscscan.com/api

Related Packages

License

MIT